From 8603182caffaecfba070b159addd6e1bd85c56ad Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Wed, 5 Aug 2026 05:41:22 +0200 Subject: [PATCH] ci fix --- .forgejo/workflows/deploy.yaml | 12 ++++++++++++ project.cpp | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 2675853..8e07a6b 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -293,6 +293,18 @@ jobs: # --delete on content/ is safe: it is regenerated every build. Note it # does NOT touch /deploy-app/media, which must survive. 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. + 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 + exit 1 + fi + install -m 0755 "$MSQ" /deploy-app/libmsquic.so.2.new + mv -f /deploy-app/libmsquic.so.2.new /deploy-app/libmsquic.so.2 # Swap the binary into place atomically, so a request arriving mid-copy # never hits a truncated executable. mv -f /deploy-app/catcrafts-server.new /deploy-app/catcrafts-server diff --git a/project.cpp b/project.cpp index de8db99..7b9b498 100644 --- a/project.cpp +++ b/project.cpp @@ -134,6 +134,13 @@ extern "C" Configuration CrafterBuildProject(std::span a cfg.linkFlags.push_back("-lssl"); cfg.linkFlags.push_back("-lcrypto"); + // 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"); + ApplyReleaseTrimming(cfg); return cfg; }