Fix Custom Entitlement Computation SPM installation test#6770
Merged
Conversation
The `SPMIntegration` scheme in `SPMCustomEntitlementComputationInstallation` had
an empty `<BuildAction>` and a dangling `<LaunchAction>` reference to a
non-existent `SPMInstallation.app` target. That meant
`xcodebuild -showBuildSettings -scheme SPMIntegration` returned no settings
at all (no `BUILT_PRODUCTS_DIR`, no `SUPPORTED_PLATFORMS`).
Until fastlane 2.233.1 this was masked: scan silently fell back to
`File.expand_path("../../..", nil)` as `derived_data_path`, which happened
to be a writable path on CI, so the test ran and scan found the
`.xcresult`. fastlane 2.234.0 (PR fastlane/fastlane#22231) added an
explicit nil-guard in `Scan::DetectValues.default_derived_data`, so
`derived_data_path` is now left unset. `xcodebuild test` then uses its
default `~/Library/Developer/Xcode/DerivedData/...`, scan can't find the
result bundle there, and the installation test fails with
"Cannot find .xcresult in derived data which is needed to determine test
results" even though the test itself passes.
Fix the scheme to match the pattern already used by other test-only
schemes in the repo (e.g. `BackendIntegrationTests.xcscheme`):
- Add a `<BuildActionEntry buildForTesting="YES" .../>` for the
`SPMInstallationTests.xctest` target so the scheme has a real buildable.
- Replace the dangling `SPMInstallation.app` reference in
`<LaunchAction><MacroExpansion>` with the test bundle (the app target
doesn't exist in this project).
- Declare `SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"` on the test
target so `xcodebuild -showBuildSettings -scheme` resolves cleanly
regardless of Xcode version.
- Drop the now-unnecessary Scanfile workaround
(`skip_build(true)` + accompanying comment) — the scheme is no longer
"only setup for testing, not building".
Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
|
@RCGitBot please test installation-tests-all-but-carthage |
|
🚀 Triggered installation-tests-all-but-carthage → Pipeline #37647 |
The previous commit added the test bundle to the scheme's <BuildAction>
to fix `xcodebuild -showBuildSettings` returning empty settings. That
worked in theory, but in practice CI showed that once xcodebuild has a
buildable in the scheme it enforces scheme-level destination validation
against the test target's effective platforms, and rejects iOS Simulator
destinations:
xcodebuild: error: Unable to find a destination matching the
provided destination specifier:
{ platform:iOS Simulator, id:... }
Available destinations for the "SPMIntegration" scheme:
{ platform:visionOS Simulator, ...Designed for [iPad,iPhone]... }
The empty <BuildAction> in the original scheme was effectively the
escape hatch that let fastlane pass an iOS Simulator destination and
have it accepted. Removing that escape hatch broke the build.
Revert the scheme and project.pbxproj changes back to main and instead
fix the real symptom: tell `fastlane scan` where to put / find derived
data. Once `derived_data_path` is set, `Scan::DetectValues
.default_derived_data` short-circuits before the
`BUILT_PRODUCTS_DIR is nil` early-return introduced in
fastlane/fastlane#22231 (fastlane 2.234.0), and the `.xcresult` lookup
works the same way it did under 2.233.1.
Use the same value (`scan_derived_data`) that the BackendIntegrationTests
and v3/v4 LoadShedderIntegration lanes already use in `fastlane/Fastfile`.
Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
|
@RCGitBot please test installation-tests-all-but-carthage |
|
🚀 Triggered installation-tests-all-but-carthage → Pipeline #37656 |
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.
Summary
Fixes the
Custom Entitlement Computation SPMstep in theinstallation-tests-all-but-carthageCircleCI job, broken since #6764 bumped fastlane from 2.233.1 to 2.234.0.Root cause
The
SPMIntegrationscheme has an empty<BuildAction>(it's test-only with no host app), soxcodebuild -showBuildSettings -scheme SPMIntegrationreturns noBUILT_PRODUCTS_DIR. fastlane 2.234.0 (fastlane/fastlane#22231) added a nil-guard inScan::DetectValues.default_derived_datathat now leavesderived_data_pathunset in this case, soxcodebuild testwrites the.xcresultto the default~/Library/Developer/Xcode/DerivedData/...and scan can't find it. The test passes but scan errors with:Fix
Set
derived_data_pathexplicitly in theScanfile. This short-circuitsdefault_derived_databefore it hits the new nil-guard, restoring 2.233.1 behavior.The value (
scan_derived_data) matches the convention already used infastlane/Fastfilefor the other test-only test bundles in this repo (BackendIntegrationTests,v3LoadShedderIntegration,v4LoadShedderIntegration).Test plan
installation-tests-all-but-carthagepasses theInstallation Test: Custom Entitlement Computation SPMstep (pipeline #37656).Note
Low Risk
Low risk change limited to Fastlane test configuration; it only affects where derived data is written so
scancan find.xcresultfor a test-only scheme.Overview
Fixes the
SPMCustomEntitlementComputationInstallationFastlanescanrun by explicitly settingderived_data_pathin itsScanfile, ensuring.xcresultoutput is discoverable for a test-only scheme after the fastlane 2.234.0 behavior change.Reviewed by Cursor Bugbot for commit 4eee87c. Bugbot is set up for automated code reviews on this repo. Configure here.