Code Monkey home page Code Monkey logo

Comments (2)

rmszc81 avatar rmszc81 commented on June 26, 2024

So,

here's what I did:

I started by reading this:

https://docs.ntfy.sh/develop/

Then I cloned the sources into the following repository:

https://github.com/rmszc81/ntfy/tree/freebsd14

I made changes in the following files:

Makefile, .goreleaser.yml

To be able to build in FreeBSD 14.

I installed the following packages in the OS:

pkg install git go goreleaser node20 npm-node20 py311-mkdocs py311-pip py311-pylint-venv

Then I ran:

make cli-freebsd-amd64, apparently it builds the application correctly, and the binary is generated at ntfy_freebsd_amd64_freebsd_amd64_v1

When I run ./dist/ntfy_freebsd_amd64_freebsd_amd64_v1/ntfy, I get the following output:

root@ntfy:/app/ntfy # ./dist/ntfy_freebsd_amd64_freebsd_amd64_v1/ntfy
NAME:
   ntfy - Simple pub-sub notification service

USAGE:
   ntfy [OPTION..]

COMMANDS:
   help, h  Shows a list of commands or help for one command
   Client commands:
     publish, pub, send, trigger  Send message via a ntfy server
     subscribe, sub               Subscribe to one or more topics on a ntfy server
   Server commands:
     access   Grant/revoke access to a topic, or show access
     serve    Run the ntfy server
     tier     Manage/show tiers
     token    Create, list or delete user tokens
     user     Manage/show users
     webpush  Generate keys, in the future manage web push subscriptions

GLOBAL OPTIONS:
   --debug, -d
       enable debug logging (default: false) [$NTFY_DEBUG]
   --trace
       enable tracing (very verbose, be careful) (default: false) [$NTFY_TRACE]
   --no-log-dates, --no_log_dates
       disable the date/time prefix (default: false) [$NTFY_NO_LOG_DATES]
   --log-level value, --log_level value
       set log level (default: "INFO") [$NTFY_LOG_LEVEL]
   --log-level-overrides value, --log_level_overrides value [ --log-level-overrides value, --log_level_overrides value ]  set log level overrides [$NTFY_LOG_LEVEL_OVERRIDES]
   --log-format value, --log_format value
       set log format (default: "text") [$NTFY_LOG_FORMAT]
   --log-file value, --log_file value
       set log file, default is STDOUT [$NTFY_LOG_FILE]
   --help, -h
       show help

Try 'ntfy COMMAND --help' or https://ntfy.sh/docs/ for more information.

To report a bug, open an issue on GitHub: https://github.com/binwiederhier/ntfy/issues.
If you want to chat, simply join the Discord server (https://discord.gg/cT7ECsZj9w), or
the Matrix room (https://matrix.to/#/#ntfy:matrix.org).

ntfy v2.11.0-next (f0dc666), runtime go1.21.10, built at 2024-06-12T02:42:16Z
Copyright (C) 2022 Philipp C. Heckel, licensed under Apache License 2.0 & GPLv2

So it seems that the binary is working as intended.

make install-freebsd-amd64 shows the following error:

rm -f /usr/local/bin/ntfy
cp -a dist/ntfy_freebsd_amd64_freebsd_amd64/ntfy /usr/local/bin/ntfy
cp: dist/ntfy_freebsd_amd64_freebsd_amd64/ntfy: No such file or directory
*** Error code 1

Stop.
make: stopped in /app/ntfy

I know the error above is related to the target path being different. I just don't know why in FreeBSD _v1 is being concatenated to the end of the path when the binary is generated.

make web executes correctly and the UI works fine.

make docs stops at this point:

Successfully installed certifi-2024.6.2 charset-normalizer-3.3.2 colorama-0.4.6 csscompressor-0.9.5 htmlmin2-0.1.13 idna-3.7 jsmin-3.0.1 markdown-3.6 mkdocs-material-9.5.26 mkdocs-material-extensions-1.3.1 mkdocs-minify-plugin-0.8.0 paginate-0.5.6 pygments-2.18.0 pymdown-extensions-10.8.1 regex-2024.5.15 requests-2.32.3 urllib3-2.2.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behavior with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
(. venv/bin/activate && python3.11 -m mkdocs build)
/app/ntfy/venv/bin/python3.11: No module named mkdocs
*** Error code 1

Stop.
make: stopped in /app/ntfy

make docs-deps runs without any errors.

make docs-build returns the following:

root@ntfy:/app/ntfy # make docs-build
python3.11 -m venv ./venv
(. venv/bin/activate && python3.11 -m mkdocs build)
/app/ntfy/venv/bin/python3.11: No module named mkdocs
*** Error code 1

Stop.
make: stopped in /app/ntfy

I didn't have enough time to go deeper into this but still, I'd like to have some insights from you guys on how I could solve it.

Best!
@rmszc81

from ntfy.

positiveEV avatar positiveEV commented on June 26, 2024

Hi,
Thank you for doing most of the work

pkg install git go goreleaser node20 npm-node20 py311-mkdocs py311-pip py311-pylint-venv

No need to install py311-mkdocs as it will be installed by pip in the venv

make install-freebsd-amd64 shows the following error:

rm -f /usr/local/bin/ntfy
cp -a dist/ntfy_freebsd_amd64_freebsd_amd64/ntfy /usr/local/bin/ntfy
cp: dist/ntfy_freebsd_amd64_freebsd_amd64/ntfy: No such file or directory
*** Error code 1

Stop.
make: stopped in /app/ntfy

I know the error above is related to the target path being different. I just don't know why in FreeBSD _v1 is being concatenated to the end of the path when the binary is generated.

Look at install-linux-amd64 _v1 is also append to the directory name so I guess that it is an expected behavior when building for amd64.

root@ntfy:/app/ntfy # make docs-build
python3.11 -m venv ./venv
(. venv/bin/activate && python3.11 -m mkdocs build)
/app/ntfy/venv/bin/python3.11: No module named mkdocs
*** Error code 1

Stop.
make: stopped in /app/ntfy

You set pip-3.11 as the pip command but it is only available at /usr/local/bin/pip-3.11 and not in the venv. So when running docs-dep it installed the requirements on the system, not in the venv.
pip commands available in the venv are pip, pip3 and pip3.11

from ntfy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.