Skip to content

Commit 99299ab

Browse files
authored
Merge pull request #43 from Reedtrullz/codex/cleanup-vifty-swift-products-dir-2026-08-23
Fix SwiftPM product path discovery across toolchains
2 parents cc4c944 + 9e411b4 commit 99299ab

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ RELEASE_SWIFT_PLATFORM_DIR ?= $(RELEASE_ARCHITECTURE)-apple-macosx
1818
SWIFT_TRIPLE_ARGS = $(if $(filter release,$(CONFIGURATION)),--triple "$(RELEASE_SWIFT_TRIPLE)",)
1919
SWIFT_PROVENANCE_ARGS = $(if $(SWIFT_BUILD_PROVENANCE_FILE),-Xlinker -sectcreate -Xlinker __TEXT -Xlinker __vifty_src -Xlinker "$(SWIFT_BUILD_PROVENANCE_FILE)",)
2020
SWIFT_BUILD_ARGS = $(if $(SWIFT_BUILD_PATH),--build-path "$(SWIFT_BUILD_PATH)",) $(SWIFT_TRIPLE_ARGS) $(SWIFT_PROVENANCE_ARGS) $(SWIFT_BUILD_EXTRA_ARGS)
21-
SWIFT_PRODUCTS_DIR = $(if $(filter release,$(CONFIGURATION)),$(if $(SWIFT_BUILD_PATH),$(SWIFT_BUILD_PATH)/$(RELEASE_SWIFT_PLATFORM_DIR)/$(CONFIGURATION),.build/$(RELEASE_SWIFT_PLATFORM_DIR)/$(CONFIGURATION)),$(if $(SWIFT_BUILD_PATH),$(SWIFT_BUILD_PATH)/$(CONFIGURATION),.build/$(CONFIGURATION)))
21+
# SwiftPM's product layout is toolchain-dependent (for example, Xcode 26
22+
# places release products under .build/out/Products/Release). Ask SwiftPM for
23+
# the path it actually selected, while preserving explicit caller overrides.
24+
SWIFT_PRODUCTS_DIR ?= $(shell swift build $(SWIFT_BUILD_ARGS) -c $(CONFIGURATION) --show-bin-path)
2225
VERIFY_TEST_TARGET ?= test-fast
2326
SLOW_TEST_SKIP_ARGS := --skip 'ViftyCoreTests\.(AgentCoolingEvidenceScriptTests|AgentRunSmokeEvidenceScriptTests|GuardedRunScriptTests|HelperLifecycleScriptTests|InstallReplacementPreflightScriptTests|ReleaseArtifactScriptTests|ReleaseManifestScriptTests|ReleaseMetadataScriptTests|UIReviewEvidenceScriptTests|ValidationEvidenceReviewScriptTests|ValidationEvidenceScriptTests|ValidationReportSummaryScriptTests)'
2427
RELEASE_VERSION ?= $(shell /usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' Resources/Info.plist)

Tests/ViftyCoreTests/MakefileTrustGateTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ final class MakefileTrustGateTests: XCTestCase {
7878
XCTAssertTrue(makefile.contains("SWIFT_BUILD_PROVENANCE_FILE ?="))
7979
XCTAssertTrue(makefile.contains("SWIFT_PROVENANCE_ARGS = $(if $(SWIFT_BUILD_PROVENANCE_FILE),-Xlinker -sectcreate -Xlinker __TEXT -Xlinker __vifty_src"))
8080
XCTAssertTrue(makefile.contains("SWIFT_BUILD_ARGS = $(if $(SWIFT_BUILD_PATH),--build-path \"$(SWIFT_BUILD_PATH)\",) $(SWIFT_TRIPLE_ARGS) $(SWIFT_PROVENANCE_ARGS)"))
81-
XCTAssertTrue(makefile.contains("SWIFT_PRODUCTS_DIR = $(if $(filter release,$(CONFIGURATION))"))
81+
XCTAssertTrue(makefile.contains("SWIFT_PRODUCTS_DIR ?= $(shell swift build $(SWIFT_BUILD_ARGS) -c $(CONFIGURATION) --show-bin-path)"))
8282
XCTAssertTrue(makefile.contains("APP_DIR ?= .build/$(APP_NAME).app"))
8383
XCTAssertTrue(makefile.contains("ui-review-build-products: ## Build one clean-tree provenance-bound UI review product transaction"))
8484
XCTAssertTrue(makefile.contains("./scripts/build-ui-review-products.sh"))

0 commit comments

Comments
 (0)