Closed Voronsky closed 5 months ago
The problem is that your system has a static version of libsystemd
that requires libcap
but that library is not being linked. Try running this to finish the build:
g++ -o fah-client -Wl,--as-needed -Wl,-s -Wl,-x -Wl,--gc-sections -no-pie -pthread -static-libstdc++ -static-libgcc -Wl,--wrap=glob -Wl,--wrap=logf -Wl,--wrap=log -Wl,--wrap=expf -Wl,--wrap=exp -Wl,--wrap=powf -Wl,--wrap=pow -Wl,--wrap=fcntl64 build/client.o build/fah/client/Account.o build/fah/client/App.o build/fah/client/Config.o build/fah/client/Core.o build/fah/client/CoreState.o build/fah/client/Cores.o build/fah/client/ExitCode.o build/fah/client/GPUResource.o build/fah/client/GPUResources.o build/fah/client/Group.o build/fah/client/Groups.o build/fah/client/NodeRemote.o build/fah/client/OS.o build/fah/client/PasskeyConstraint.o build/fah/client/Remote.o build/fah/client/RunResult.o build/fah/client/Server.o build/fah/client/Unit.o build/fah/client/UnitState.o build/fah/client/Units.o build/fah/client/WebsocketRemote.o build/fah/client/glibc.o build/libfahclient-resources.a build/fah/client/lin/LinOSImpl.o build/build_info.o -L/home/ivan/programming/github/fah-client-v8/cbang/lib -Wl,--start-group /home/ivan/programming/github/fah-client-v8/cbang/lib/libcbang.a /home/ivan/programming/github/fah-client-v8/cbang/lib/libcbang-boost.a /usr/lib/x86_64-linux-gnu/libsystemd.a -lpthread -lv8_libplatform -lv8 /usr/lib/x86_64-linux-gnu/libssl.a /usr/lib/x86_64-linux-gnu/libcrypto.a -ldl /home/ivan/programming/github/fah-client-v8/cbang/lib/libre2.a /home/ivan/programming/github/fah-client-v8/cbang/lib/libevent.a /home/ivan/programming/github/fah-client-v8/cbang/lib/liblz4.a /usr/lib/x86_64-linux-gnu/libmysqlclient.a /home/ivan/programming/github/fah-client-v8/cbang/lib/libyaml.a /usr/lib/x86_64-linux-gnu/libsqlite3.a -ldl -lpthread /usr/lib/x86_64-linux-gnu/libexpat.a -lbz2 -lz -lpthread -Wl,--end-group -lcap
I've committed a change to cbang to look for libcap
when libsystemd
is linked. You might want to try that.
Ubuntu 23.10+ now ships a static libsystemd.a
in libsystemd-dev. Upstream does not encourage its usage:
https://github.com/systemd/systemd/blob/v255/README#L311-L321
We should prefer the shared one.
You can build with: scons prefer_dynamic=systemd
You can build with:
scons prefer_dynamic=systemd
This solved it! I assume this will also be an issue for users who will be using Ubuntu 24.04 LTS ? I believe that is set to go into beta later this Month
You can build with:
scons prefer_dynamic=systemd
Can we add systemd to PREFER_DYNAMIC by default? It is a core library and both DEB and RPM packages automatically add proper versioned dependency.
I did recently change the defaults such that the option mostly_static
is no longer defaulted true. That makes prefer_dynamic
unnecessary.
The whole reason for mostly_static
builds is that the binaries tend to run on more Linux systems If you're building the package for a specific version of a Linux distro then static linking is not necessary. Even though there are risks to static linking it usually lets you cover more OS releases with one package.
Ideally, now that the client is Open-Source, we'd get someone to add native packages to major Linux distributions. The only possible hang up is that the client downloads the cores which are not 100% Open-Source. I believe this is forbidden by distros such as Debian.
Yes, it's useful when we do a mostly_static
build.
Currently trying to build this fah-client on Ubuntu 23.10.
And it seems I run into the following error while doing this build step
scons -C fah-client-bastet
What I did
Ran the
scons -C cbang
scons -C fah-client-bastet
What I expected
fah-client-*.deb
to install.