Skip to content

Fix the gitx tool being unable to load the app frameworks - #595

Merged
hannesa2 merged 1 commit into
gitx:masterfrom
goneng:fix-helper-tool-signing-identity
Sep 5, 2026
Merged

hannesa2 merged 1 commit into
gitx:masterfrom
goneng:fix-helper-tool-signing-identity

Conversation

@goneng

@goneng goneng commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Let the two helper tools take the code signing identity from the xcconfig
like every other target, so that a build made with a development
certificate signs them with the team the app is signed with.

Both targets pinned an ad-hoc identity in their own build settings, which
beats the project xcconfig, so the app and its frameworks were signed with
the developer team while the tools were not. The hardened runtime refuses
to map a team-signed library into a process carrying no team, so gitx .
died before it started:

dyld: Library not loaded: @rpath/ObjectiveGit.framework/ObjectiveGit
  Reason: ... code signature ... not valid for use in process: mapping
  process and mapped file (non-platform) have different Team IDs
  • Drop CODE_SIGN_IDENTITY from the cli tool target, Debug and Release
  • Drop it from gitx_askpasswd, which pins the same value
  • Leave GitX.xcconfig to supply the ad-hoc identity when no development
    certificate is configured

Test plan

  • xcodebuild -target "cli tool" -showBuildSettings reports the identity
    from the xcconfig rather than -
  • make build with a Dev.xcconfig in place signs gitx and
    gitx_askpasswd with the same team as the app
  • Running the rebuilt gitx --version from outside the checkout prints
    the version instead of aborting in dyld

Let the two helper tools take the code-signing identity from the
xcconfig like every other target, so that a build made with a
development certificate signs them with the same team the app is
signed with.

Both targets pinned an ad-hoc identity in their own build settings,
which beats the project xcconfig, so the app and its frameworks were
signed with the developer team while the tools were not.
The hardened runtime refuses to map a team-signed library into a process
carrying no team, leaving `gitx` aborting on ObjectiveGit before it starts.

- Drop CODE_SIGN_IDENTITY from the cli tool target, Debug and Release
- Drop it from gitx_askpasswd, which pins the same value
- Leave GitX.xcconfig to supply the ad-hoc identity when no development
  certificate is configured
@goneng
goneng force-pushed the fix-helper-tool-signing-identity branch from f4220a7 to c060742 Compare September 5, 2026 18:40
@goneng
goneng marked this pull request as ready for review September 5, 2026 18:45
@hannesa2
hannesa2 merged commit f9d4772 into gitx:master Sep 5, 2026
3 checks passed
@goneng
goneng deleted the fix-helper-tool-signing-identity branch September 7, 2026 20:04
hannesa2 pushed a commit that referenced this pull request Sep 8, 2026
Run the packaged gitx tool out of a release archive, so that a bundle
whose helper cannot load the frameworks beside it fails a target here
rather than on a user's machine.

The hardened runtime is turned on for Release only, and the team
mismatch that trips library validation needs a real signing identity.
The test targets build Debug and sign ad-hoc, so nothing in the suite
assembles the configuration that ships, which is how the tool reached
users unable to load ObjectiveGit until #595.

- Add smoke-test, running Contents/Resources/gitx from the archive
- Read the tool's output rather than its exit status, since it exits 1
  after printing the version either way
- Refuse a bundle without the hardened runtime, which asking for `dmg`
  in the same invocation would otherwise leave the check passing on
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.

2 participants