git / moonbite-core / doc/linux-runpath.md · raw
# Linux release binaries: RUNPATH for /opt/moonbite/libThe MoonBite seed nodes run Ubuntu 24.04 but the Linux `moonbited` /`moonbite-cli` binaries are built natively on Ubuntu 22.04 against the 22.04system libraries (libboost 1.74, libevent, libdb5.3, libzmq, libfmt8, ...).Those exact `.so` versions are not in the 24.04 archive, so the seeds carry acopy of them in `/opt/moonbite/lib` (shipped once with `ship_libs.sh`).For the dynamic loader to find them the binaries must carry a RUNPATH thatpoints at that directory. Binaries built without it fail with`libboost_filesystem.so.1.74.0: not found` on the seeds and had to be fixedon-host with `patchelf --set-rpath /opt/moonbite/lib` (regression seen withthe 981ca8669 build, 2026-10-09).**Every native Linux build intended for the seeds must therefore be configuredwith:**```sh./configure --prefix=/ --disable-tests --disable-bench --with-incompatible-bdb \ CPPFLAGS=-DBOOST_NO_CXX98_FUNCTION_BASE \ LDFLAGS="-Wl,-rpath,/opt/moonbite/lib"```and verified before staging:```shreadelf -d src/litecoind | grep -i runpath # -> Library runpath: [/opt/moonbite/lib]readelf -d src/litecoin-cli | grep -i runpath```Notes:- The RUNPATH is only *searched*; it does not break hosts that have the libs in the normal system paths (the loader falls through to `/usr/lib/...`), so the same binary still runs on a plain 22.04 box or in WSL.- The GitHub Actions `release.yml` builds with the `depends` system (static boost/libevent/zmq), so RUNPATH is not strictly needed there; it is still set on the Linux matrix entry so the public tarball and the seed-staged build are linked identically and `patchelf` is never required on-host again.- `deploy/deploy-droplet-node.sh` in moonbite-network still contains the `patchelf` fallback as a safety net, but a correctly built binary never hits it.