Repository navigation
build: per-arch SwiftPM scratch paths (Swift 6.4's triple-independent layout breaks universal builds) - #6
Open
djbclark wants to merge 1 commit into
Conversation
Swift 6.4's default scratch layout is triple-independent (out/Products/Release), so with a shared scratch both --triple builds reported the same --show-bin-path and the x86_64 build overwrote the arm64 binary before lipo, failing with "lipo: same architectures (x86_64)". A per-arch --scratch-path also works on older triple-keyed layouts.
This branch has not been deployed
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.
On Swift 6.4 (swiftlang-6.4.0.34.1, macOS 27.x CLT), SwiftPM's default scratch layout is triple-independent:
--show-bin-pathreturns.build/out/Products/Releaseregardless of--triple, and.build/<triple>/is never created. With a shared scratch, both arch builds inscripts/build-app.shtherefore report the same bin path, the x86_64 build overwrites the arm64 binary, and the script fails at:Fix: give each architecture its own
--scratch-path. The bin path is still discovered via--show-bin-path, so the script keeps working on older triple-keyed layouts too.Verified on macOS 27.2 / Apple Swift 6.4:
scripts/build-app.shproducesbuild/Right Folder.appwith a fat binary (x86_64 + arm64), ad-hoc signed,codesign --verify --strictclean.Adversary security/correctness review verdict: "no defects requiring change." Flag name
--scratch-pathis valid since the--build-pathdeprecation (Swift 5.1/5.2 era) and strictly more portable than the since-removed alias; correct on both old ($scratch/$triple/Release) and new layouts; quoting,set -euo pipefailand path-collision checks clean.