Closed cpswan closed 1 month ago
Weirdly it seems that sshnpd
does run on the build VM despite it seemingly not having libcjson1 installed.
We are deferring the cjson build via cmake: https://github.com/atsign-foundation/at_c/blob/trunk/cmake/find_cjson.cmake
I believe you can modify the behaviour of the cjson build to be explicitly static: https://github.com/DaveGamble/cJSON/blob/324973008ced4ea03d1626a00915d0399ecbd9db/CMakeLists.txt#L117-L120
Based on what I saw in the cjson repo, you should be able to turn this off: https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
and it should build statically:
cmake -B build -S . -DBUILD_SHARED_LIBS=off ...
This should be off by default (undefined actually), but it is possible another project on your build machine has created a cache entry for cjson with it turned on.
Confirmed that -DBUILD_SHARED_LIBS=off
gets me a binary that works without installing libcjson1
:)
Describe the bug
Steps to reproduce
git switch c_daemon
sshnpd
binary to a clean (Ubuntu 24.04 cloud image) test VMchmod +x sshnpd
then./sshnpd
Expected behavior
sshnpd shows help
Additional context
If I install cjson with
sudo apt install libcjson1
then I can get usage info from the daemon: