folkertvanheusden / HTTPing

Ping an HTTP server
GNU Affero General Public License v3.0
31 stars 9 forks source link

Expected build steps #17

Open SMillerDev opened 6 months ago

SMillerDev commented 6 months ago

I'm trying to build 3.6 in Homebrew in https://github.com/Homebrew/homebrew-core/pull/171238 But cmake --install isn't working and the configure script is removed.

Do you have any hints on what the best way to install the software is now with CMake?

folkertvanheusden commented 6 months ago

Can you try the 3.7a version from github? It has an make install target.

On Thu, May 9, 2024 at 12:24 PM Sean Molenaar @.***> wrote:

I'm trying to build 3.6 in Homebrew in Homebrew/homebrew-core#171238 https://github.com/Homebrew/homebrew-core/pull/171238 But cmake --install isn't working and the configure script is removed.

Do you have any hints on what the best way to install the software is now with CMake?

— Reply to this email directly, view it on GitHub https://github.com/folkertvanheusden/HTTPing/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUN5IW6QIUQBIPM6D46KTGDZBNFENAVCNFSM6AAAAABHOR55XCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4DOMZYGI4TENA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

SMillerDev commented 6 months ago

I don't see a 3.7a version, do you have a link?

folkertvanheusden commented 6 months ago

It is not a release, it is the current version in git.

On Thu, May 9, 2024 at 6:11 PM Sean Molenaar @.***> wrote:

I don't see a 3.7a version, do you have a link?

— Reply to this email directly, view it on GitHub https://github.com/folkertvanheusden/HTTPing/issues/17#issuecomment-2102973930, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUN5IW4BCGUPAVKZVOW4PBDZBON2XAVCNFSM6AAAAABHOR55XCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBSHE3TGOJTGA . You are receiving this because you commented.Message ID: @.***>

ehaupt commented 6 months ago

947525e39deb49c37a7350f748e511ab85325d6e works on FreeBSD. Could you maybe make gettext, nc and fftw3 support optional/switchable?

See for instance: https://github.com/tildearrow/furnace/blob/master/CMakeLists.txt

SMillerDev commented 6 months ago

For Homebrew it now tries to install, but is missing the nl.mo. Maybe https://cmake.org/cmake/help/latest/module/FindGettext.html would work better than the bash command that is currently used? I can't find any usage of bash in the output.

folkertvanheusden commented 6 months ago

Hi Emanuel,

I believe it already is: if for example the ncurses package is not found, httping will not be built to use it.

On Fri, May 10, 2024 at 3:44 PM Emanuel Haupt @.***> wrote:

947525e https://github.com/folkertvanheusden/HTTPing/commit/947525e39deb49c37a7350f748e511ab85325d6e works on FreeBSD. Could you maybe make gettext, nc and fftw3 support optional/switchable?

See for instance: https://github.com/tildearrow/furnace/blob/master/CMakeLists.txt

— Reply to this email directly, view it on GitHub https://github.com/folkertvanheusden/HTTPing/issues/17#issuecomment-2104637377, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUN5IW2TFQPFCTDD5R45RZTZBTFL7AVCNFSM6AAAAABHOR55XCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUGYZTOMZXG4 . You are receiving this because you commented.Message ID: @.***>

ehaupt commented 6 months ago

My concern is that if libraries such as ncurses are already present on the system, there isn’t an option to exclude them from the build. This isn't a problem in a clean build environment but can be problematic when compiling from source in systems like the FreeBSD ports system. FreeBSD’s OPTIONS framework allows users to customize builds by enabling or disabling specific features and dependencies. Similarly, Gentoo’s Portage system provides USE flags for these purposes. Incorporating a similar option to disable certain dependencies even when they are present on the system could offer greater flexibility and control over the build process.

folkertvanheusden commented 6 months ago

Ok I looked at it and I can indeed make nc + fftw3 switchable. Gettext as well. See README.md for details. It's all in the latest v3.7a tag on github. thanks for the feedback by the way

On Sat, May 11, 2024 at 9:23 PM Emanuel Haupt @.***> wrote:

My concern is that if libraries such as ncurses are already present on the system, there isn’t an option to exclude them from the build. This isn't a problem in a clean build environment but can be problematic when compiling from source in systems like the FreeBSD ports system. FreeBSD’s OPTIONS framework allows users to customize builds by enabling or disabling specific features and dependencies. Similarly, Gentoo’s Portage system provides USE flags for these purposes. Incorporating a similar option to disable certain dependencies even when they are present on the system could offer greater flexibility and control over the build process.

— Reply to this email directly, view it on GitHub https://github.com/folkertvanheusden/HTTPing/issues/17#issuecomment-2105998242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUN5IWYZTKTDMSCYB6QGDB3ZBZV3LAVCNFSM6AAAAABHOR55XCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVHE4TQMRUGI . You are receiving this because you commented.Message ID: @.***>

folkertvanheusden commented 6 months ago

Hi, Please see my message to Emanuel: I've made gettext now an optional component.

On Fri, May 10, 2024 at 7:55 PM Sean Molenaar @.***> wrote:

For Homebrew it now tries to install, but is missing the nl.mo. Maybe https://cmake.org/cmake/help/latest/module/FindGettext.html would work better than the bash command that is currently used? I can't find any usage of bash in the output.

— Reply to this email directly, view it on GitHub https://github.com/folkertvanheusden/HTTPing/issues/17#issuecomment-2105034993, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUN5IW64VFKXDWCL7RGHE63ZBUCWRAVCNFSM6AAAAABHOR55XCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGAZTIOJZGM . You are receiving this because you commented.Message ID: @.***>

ehaupt commented 6 months ago

Hello @folkertvanheusden,

Thank you for taking the time to look into this.

I've tested version v3.7a and here are some findings:

Thank you again for your hard work on this project. I appreciate your attention to these details.

EDIT:

I also had to fix the installation path for the man page:

-install(FILES httping.1 DESTINATION ${CMAKE_INSTALL_MANDIR})
+install(FILES httping.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
folkertvanheusden commented 6 months ago

Hello @folkertvanheusden https://github.com/folkertvanheusden,

Thank you for taking the time to look into this.

I've tested version v3.7a and here are some findings:

-

Would it be possible to switch the usage of bash to sh? On FreeBSD, sh comes with the base system, whereas bash is an additional dependency that I have to add as a build dependency. I've patched it locally to use sh and it worked fine. Additionally, maybe @SMillerDev https://github.com/SMillerDev's suggestion of using FindGettext https://cmake.org/cmake/help/latest/module/FindGettext.html could be even better.

I've now replaced it by sh in a706930175e1b3eca153f57de9f241d1f10eaf99

For FindGetText, see 2520430bb17e28bfc62b3970aa45e2c29d5fa785 (and further) It compiles, it runs, but I'm not sure if it installs correctly on systems different from Linux.

-

I'm not sure about other distributions, but on FreeBSD, the LICENSE file is installed via a separate macro but not into the DOCDIR. This might be specific to FreeBSD, so I am okay with patching this in the FreeBSD port.

They paths for that are now pulled in using include(GNUInstallDirs) Is there an equivalent for FreeBSD? Then I can maybe add a special case for that?

-

FreeBSD requires -lintl to be passed to the linker, otherwise it won't find bindtextdomain and textdomain. This can be resolved by changing:

-target_link_libraries(httping m) +target_link_libraries(httping intl m)

Done (in 238ea284173d83d66d8eb3d3d637d5d9e14a1c0f):

+if (BSD) +target_link_libraries(httping intl m) +else() target_link_libraries(httping m) +endif()

  • A few thoughts on versioning. Is v3.7a an alpha release? Regardless, would you consider adopting semantic versioning https://semver.org/? Semantic versioning helps convey the significance of changes in new releases, making it easier for users and developers to understand the impact of updating to a new version. This clarity can improve collaboration and dependency management.

3.7a is an alpha indeed. Semantic version is ok. Shall I start with 4.0.0? To make a clean slate?

Thank you again for your hard work on this project. I appreciate your attention to these details.

Thanks!

Message ID: @.***>

ehaupt commented 6 months ago

The BSD conditional intl linker block would have worked:

if (BSD)
target_link_libraries(httping intl m)
else()
target_link_libraries(httping m)
endif()

I've seen you've changed afterwards which fails on FreeBSD:

: && /usr/local/libexec/ccache/cc -O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong -L/usr/local/lib CMakeFiles/httping.dir/colors.c.o CMakeFiles/httping.dir/cookies.c.o CMakeFiles/httping.dir/error.c.o CMakeFiles/httping.dir/fft.c.o CMakeFiles/httping.dir/gen.c.o CMakeFiles/httping.dir/help.c.o CMakeFiles/httping.dir/http.c.o CMakeFiles/httping.dir/io.c.o CMakeFiles/httping.dir/kalman.c.o CMakeFiles/httping.dir/main.c.o CMakeFiles/httping.dir/mssl.c.o CMakeFiles/httping.dir/nc.c.o CMakeFiles/httping.dir/res.c.o CMakeFiles/httping.dir/socks5.c.o CMakeFiles/httping.dir/tcp.c.o CMakeFiles/httping.dir/utils.c.o -o httping  -lm  -lncursesw  -ltinfow  -lfftw3  -lssl  -lssl  -lcrypto && :
ld: error: undefined symbol: libintl_gettext
>>> referenced by io.c
>>>               CMakeFiles/httping.dir/io.c.o:(read_to)
>>> referenced by io.c
>>>               CMakeFiles/httping.dir/io.c.o:(myread)
>>> referenced by io.c
>>>               CMakeFiles/httping.dir/io.c.o:(mywrite)
>>> referenced 243 more times

ld: error: undefined symbol: libintl_bindtextdomain
>>> referenced by main.c
>>>               CMakeFiles/httping.dir/main.c.o:(main)

ld: error: undefined symbol: libintl_textdomain
>>> referenced by main.c
>>>               CMakeFiles/httping.dir/main.c.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Using GNUInstallDirs is ok for FreeBSD but you'll still have to suffix it with man1 otherwise it'll end up as:

share/man/httping.1.gz

Man pages ending with .1 should specifically go to share/man/man1 for proper organization, not just share/man. See the Filesystem Hierarchy Standard (FHS).

Starting with a semantic version of either 3.8.0 or 4.0.0 would be fine.

Thank again @folkertvanheusden!

ehaupt commented 5 months ago

@folkertvanheusden: friendly ping.

folkertvanheusden commented 5 months ago

Hi

Sorry for the long delay. Can't get it to work. I'm hoping someone with cmake knowledge will step forward and lead me the way :-) Or did we have a version that was ok? I can then undo the latest change(s) after it and just make that into a release version?

On Mon, Jun 3, 2024 at 10:50 AM Emanuel Haupt @.***> wrote:

@folkertvanheusden https://github.com/folkertvanheusden: friendly ping.

— Reply to this email directly, view it on GitHub https://github.com/folkertvanheusden/HTTPing/issues/17#issuecomment-2144641515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUN5IWZHLLOU3SFQDJNYJL3ZFQU5JAVCNFSM6AAAAABHOR55XCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBUGY2DCNJRGU . You are receiving this because you were mentioned.Message ID: @.***>