Repository navigation
feat(box): embed Info.plist in the shipped macOS binaries - #109
Merged
Merged
Conversation
## Problem CD Signer refuses a bare Mach-O executable that carries no embedded Info.plist with CFBundleIdentifier and CFBundleName. The three shipped macOS binaries have no such section, so the signing task for the GitHub release cannot start. ## Solution A build.rs in the box and containment crates attaches an Info.plist to each shipped binary through the darwin `-sectcreate __TEXT __info_plist` link argument. All three share the identifier `com.amazon.strands.box`, which iBuild accepted on P515573077; the sibling helpers only ever run as children of strands-box, so a distinct public identity buys nothing. The section is macOS-only, and `rustc-link-arg-bin` scopes it to the three product binaries, so Linux links unchanged and the test probes carry no section. The plist is a template: build.rs substitutes CARGO_PKG_VERSION into __VERSION__ at build time, because the release workflow stamps the version with `cargo set-version` and a hardcoded version would disagree with `--version` on every release after 0.1.0. ## Testing Built release and all-targets on macOS arm64. `otool -P` reads com.amazon.strands.box back from strands-box, strands-box-sock-alias and strands-box-contain-trampoline, and reports no section on box-egress-probe, box-exit-probe, containment-test-probe or box-mcp-fetch-server. An explicit ad-hoc re-sign makes codesign adopt it: `Identifier=com.amazon.strands.box` on all three, where the linker's own signature had a per-crate hash. Bumping the containment crate to 9.9.9 moved the embedded version with it. cargo fmt and the CI clippy invocation both pass.
|
Assessment: Comment The change is well-scoped and correct: the Review Categories
I also checked the macOS diagnostics tool, which only records the |
zastrowm
approved these changes
Oct 15, 2026
8 tasks done
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
CD Signer refuses a bare Mach-O executable that carries no embedded
Info.plistwith
CFBundleIdentifierandCFBundleName. The three shipped macOS binarieshave no such section, so the signing task for the GitHub release cannot start
(P515573077).
Solution
A
build.rsin the box and containment crates attaches anInfo.plistto eachshipped binary through the darwin
-sectcreate __TEXT __info_plistlinkargument. All three share
com.amazon.strands.box, which iBuild accepted on theticket; the sibling helpers only ever run as children of
strands-box, so adistinct public identity buys nothing. The section is macOS-only, and
rustc-link-arg-binscopes it to the three product binaries, so Linux linksunchanged and the test probes carry no section.
The plist is a template —
build.rssubstitutesCARGO_PKG_VERSIONinto__VERSION__at build time. The release workflow stamps the version withcargo set-version, so a hardcoded version would disagree with--versiononevery release after 0.1.0.
Testing
otool -Pon the 3 shipped binariescom.amazon.strands.boxon eachotool -Pon egress/exit/test-probe/mcp-fetch probescodesign -dIdentifier=com.amazon.strands.boxon all 39.9.9cargo fmt --check(CI's crate set)cargo clippy --workspace --all-targets --all-features(CI's flags)cargo build --workspace --locked --all-targets --all-featuresThe linker's own ad-hoc signature keeps a per-crate hash as its identifier
(
strands_box-d727831dd2ebd7b4);codesignadopts the plist identifier only onan explicit re-sign, which is what the signing task performs.
Notes
Ported from the retired
box-stagingrepo (fee12345+855af89f), as the endstate of both: the first commit gave the helpers sub-identifiers, the second
collapsed them onto the shared one. Linux is unverified locally — only
aarch64-apple-darwinis installed here — butbuild.rsreturns before emittingany link argument when
CARGO_CFG_TARGET_OS != "macos", and CI covers the Linuxleg.