macOS: build with RUNTIME_PREFIX for a relocatable dist - #4
Merged
Conversation
The macOS build ran `make install prefix=/` without RUNTIME_PREFIX, which bakes the absolute exec-path //libexec/git-core into the binary. The portable dist then cannot locate its own libexec/git-core unless extracted at /, so `git --exec-path` reports //libexec/git-core regardless of the binary's location and non-builtins like `git lfs` fail with "not a git command". config.mak.uname auto-enables RUNTIME_PREFIX only for Windows/MinGW targets (why MinGit / the Windows asset was always relocatable), not Darwin. Darwin does auto-enable HAVE_NS_GET_EXECUTABLE_PATH, so RUNTIME_PREFIX=YesPlease alone is sufficient: git derives its prefix from the binary's own path at runtime. Verified on a relocated copy: `git --exec-path` tracks the new location and `git lfs version` resolves the bundled Anchorpoint fork.
jochenhz
force-pushed
the
fix-macos-runtime-prefix
branch
from
June 1, 2026 12:39
c787a2c to
8c8e56d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
build_git_macosranmake install prefix=/withoutRUNTIME_PREFIX, baking the absolute exec-path//libexec/git-coreinto the binary. A portable dist then can't locate its ownlibexec/git-coreunless it happens to be extracted at/:git --exec-pathreturns//libexec/git-coreregardless of where the binary livesgit lfsfail ("not a git command")The Windows asset was unaffected because
config.mak.unameauto-enablesRUNTIME_PREFIXfor Windows/MinGW targets — but not for Darwin.Fix
Add
RUNTIME_PREFIX=YesPleaseto the macOS make invocation. Darwin already auto-enablesHAVE_NS_GET_EXECUTABLE_PATH, so this single flag is sufficient — git resolves its prefix from the binary's own path at runtime.prefix=/keepsgitexecdirrelative (libexec/git-core), satisfying the Makefile's relative-path requirement for RUNTIME_PREFIX.Test plan
Rebuilt arm64 with the change and verified from a relocated copy:
git --exec-path→/tmp/reloc/libexec/git-core(tracks the move; previously fixed at//libexec/git-core)git lfs version→git-lfs/3.7.1 (Anchorpoint; darwin arm64; …), exit 0GIT-BUILD-OPTIONSshowsRUNTIME_PREFIX='true'Both arm64 + x64 archives were rebuilt, re-notarized (Accepted), and the corrected assets published to
v2.54.0.anchorpoint.1(Windows asset untouched).🤖 Generated with Claude Code