Skip to content

fix: deduplicate Apple libraries in the Start9 builder - #1

Closed
helix-white wants to merge 2 commits into
dr-bonez:mainfrom
helix-white:fix/apple-duplicate-dylibs
Closed

helix-white wants to merge 2 commits into
dr-bonez:mainfrom
helix-white:fix/apple-duplicate-dylibs

Conversation

@helix-white

Copy link
Copy Markdown

Backport rust-cross#464 (58c6443), deduplicating Apple -l arguments in direct and response-file linking while preserving Linux library repetition. Retains Start9's compiler patches and Rust/Zig versions instead of merging upstream's unrelated refactor. Addresses the builder-side cause of Start9Labs/start-technologies#4372.

Version the backport 0.23.0-start9.1, giving publish.sh a distinct image tag. Extend tests for both macOS architectures and response-file rewriting; run library unit tests in CI, which previously built the test fixtures without executing the unit suite. Shorten the imported helper comment.

Verified: 35 library unit tests; Rust formatting; all-target/all-feature Clippy. Using the existing Start9 image's Zig 0.16.0 and macOS SDK, linked real arm64 and x86_64 Mach-O executables through both argument paths: the old tool emits two libobjc load commands, the patched tool emits one with no duplicate dylibs. Full multi-platform image publication and start-cli rebuilds have not been performed.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

messense and others added 2 commits October 23, 2026 19:26
…rust-cross#464)

Zig's self-hosted Mach-O linker (since 0.14) emits one LC_LOAD_DYLIB
load command per -l flag instead of deduplicating like ld64 does. When
multiple crates declare the same native library (e.g. two crates each
emitting cargo:rustc-link-lib=objc), the resulting binary contains
duplicate linked dylib entries, which newer macOS dyld refuses to load:

    Termination Reason: Namespace DYLD, Code 0,
    duplicate linked dylib '/usr/lib/libobjc.A.dylib'

Deduplicate repeated -l arguments (keeping the first occurrence) for
Apple targets in both the response-file and direct-args linker paths.
This matches ld64 behavior, which warns and ignores duplicates.

Fixes rust-cross#457

Claude-Session: https://claude.ai/code/session_012W2Vg9xdxKaD8sEE2HiUQb

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 58c6443)
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white

Copy link
Copy Markdown
Author

Superseded by Start9Labs/start-technologies#4377. The replacement layers a checksum-pinned upstream cargo-zigbuild 0.24.0 rebuild and a one-line RVA23 patch onto the existing pinned image, with native image verification and GHCR publishing in the monorepo. No repository fork transfer is needed.

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