diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 8e07a6b..3cd201f 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -295,9 +295,9 @@ jobs: rsync -a --delete content/ /deploy-app/content/ # The server links libmsquic as a SHARED lib out of crafter-build's # external cache; the RUNPATH into that cache only exists on this - # build machine. The binary carries an $ORIGIN rpath (project.cpp), - # so the .so must travel with it. install dereferences the - # libmsquic.so.2 -> .so.2.x.y symlink into a regular file. + # build machine. The binary carries an rpath to /srv/catcrafts-app + # (project.cpp), so the .so must travel with it. install dereferences + # the libmsquic.so.2 -> .so.2.x.y symlink into a regular file. MSQ=$(find ~/.cache/crafter.build/external -name 'libmsquic.so.2*' -type f | head -1) if [ -z "$MSQ" ]; then echo "ERROR: libmsquic.so.2 not found in the external build cache." >&2 diff --git a/project.cpp b/project.cpp index 7b9b498..8f37f5d 100644 --- a/project.cpp +++ b/project.cpp @@ -137,9 +137,13 @@ extern "C" Configuration CrafterBuildProject(std::span a // libmsquic.so.2 is built in crafter-build's external cache, and the // RUNPATH pointing there only exists on the build machine — the first // deploy to a real host died in the loader (exit 127) because of it. - // $ORIGIN makes the loader also look next to the binary itself, and CI - // ships the .so alongside it into /srv/catcrafts-app. - cfg.linkFlags.push_back("-Wl,-rpath,$ORIGIN"); + // CI ships the .so alongside the binary into /srv/catcrafts-app, and + // this rpath makes the loader look there. The path is spelled out + // rather than $ORIGIN: the flag passes through a shell on its way to + // the linker, where $ORIGIN expands to empty — leaving a bare -rpath + // that swallows the next input file (libCatcrafts.Shared.a) and fails + // the link with every Shared symbol undefined. + cfg.linkFlags.push_back("-Wl,-rpath,/srv/catcrafts-app"); ApplyReleaseTrimming(cfg); return cfg;