Skip to content

Re-land: keep build-machine paths out of the Linux RUNPATH (#53 never reached main) - #55

Merged
jordlee merged 1 commit into
mainfrom
restore/linux-runpath
Aug 13, 2026
Merged

Re-land: keep build-machine paths out of the Linux RUNPATH (#53 never reached main)#55
jordlee merged 1 commit into
mainfrom
restore/linux-runpath

Conversation

@jordlee

@jordlee jordlee commented Aug 13, 2026

Copy link
Copy Markdown
Member

Re-lands the change from #53, which is marked MERGED but whose change never reached main.

What happened

#53 was opened with fix/linux-opencv-mcpb-bundling (the #51 branch) as its base rather than main — a stacked PR. I merged #51 into main first, then merged #53, which sent it into a branch that had already been merged and was no longer flowing anywhere. GitHub correctly reports #53 as MERGED; main never received the commit.

My error: I checked mergeable, mergeStateStatus and CI on all three PRs before merging, but not baseRefName. Merging #53 first, or retargeting it to main, would have avoided this.

This PR

git cherry-pick 78654ee onto main — the original commit by @takusaito-ctrl, unmodified, authorship preserved. No content changes from what was reviewed in #53.

Verified api/server/CMakeLists.txt now carries BUILD_WITH_INSTALL_RPATH TRUE on the elseif(UNIX) branch, and the macOS build is unaffected (the change is inside the non-Apple UNIX branch; if(APPLE) is untouched).

Closes #52.

🤖 Generated with Claude Code

CMakeLists already asked for $ORIGIN, but CMake prepends it to the automatic
build-tree RPATH rather than replacing it: because the target links libCr_Core
and the OpenCV libs by absolute path, their source-tree directories were
appended and shipped inside the binary.

Those entries were pure redundancy — POST_BUILD already copies every runtime
lib next to the executable, so $ORIGIN alone resolves everything. Their only
real effect was to let the loader fall back to the build machine's checkout,
which is how the missing OpenCV in the .mcpb (#33) stayed invisible: the bundle
tested fine on the machine that built it and failed with exit 127 everywhere
else.

BUILD_WITH_INSTALL_RPATH makes the build-tree link use INSTALL_RPATH directly
and skips the automatic computation, leaving RUNPATH as just $ORIGIN.

macOS is left alone — it likely has the same leak, but there is no hardware
here to verify it and the CrAdapter layout there is delicate.

Fixes #52

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jordlee
jordlee merged commit a82bdbf into main Aug 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build-machine absolute paths leak into the shipped binary's RUNPATH, masking missing bundled libs

1 participant