Fix --legacy flag detection for Xcode 26 beta 2 compatibility#24
Open
davidbean-hash wants to merge 1 commit into
Open
Fix --legacy flag detection for Xcode 26 beta 2 compatibility#24davidbean-hash wants to merge 1 commit into
davidbean-hash wants to merge 1 commit into
Conversation
When xcresulttool version detection fails (as with Xcode 26 beta 2), the --legacy flag was not being added to deprecated commands, causing: Warning: Could not determine xcresulttool version Error: This command is deprecated ... --legacy flag is required Changes: - Default shouldAddLegacyFlag to true when version detection fails, ensuring forward compatibility with newer Xcode versions - Add fallback version detection: try 'xcresulttool version --legacy' if the standard version command fails or returns unparseable output - Also check stderr for version info in case output destination changed - Extract version string parsing into a public testable method - Add --legacy flag to MetadataGet command (was missing) - Add legacyFlag parameter to Version command class - Add unit tests for version string parsing Fixes: ChargePoint#91 Co-Authored-By: david.bean <david.bean@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Change Description:
Fixes the error when using Xcode 26 beta 2 where
xcresulttoolrequires the--legacyflag for deprecated commands but version detection fails, causing the flag to not be added:Ref: ChargePoint#91
Root cause: In
shouldAddLegacyFlag, whenVersion.xcresulttool()returnsnil(version detection fails), the code defaulted tofalse— meaning--legacywas never added. In Xcode 26 beta 2, the xcresulttool version output format likely changed, breaking the parser.Changes:
Default
shouldAddLegacyFlagtotruewhen version detection fails (XCResultToolCommand.swift): If we can't determine the version, it's safer to assume--legacyis needed. Older Xcode versions parse fine, so this only affects newer unrecognized versions.Fallback version detection with
--legacy(Version+XCPTooling.swift): Ifxcresulttool versionfails or returns unparseable output, retry withxcresulttool version --legacyin case the version command itself is deprecated.Check stderr for version info (
Version+XCPTooling.swift): In case the version output destination changed in newer Xcode.Add
--legacyflag toMetadataGetcommand (XCResultToolCommand.swift): Was missing from the original--legacysupport in PR Add--legacyflag for Xcode 16 compatibility ChargePoint/xcparse#88.Add
legacyFlagparameter toVersioncommand (XCResultToolCommand.swift): Supports the fallback version detection.Extract version parsing into testable method (
Version+XCPTooling.swift):parseXCResultToolVersionString(_:)is now public and testable.Test Plan/Testing Performed:
VersionParsingTests.swiftwith 11 unit tests covering:xcresulttool version 23028)xcresulttool version 15500)23028.0.1,26000.1)XCTestManifests.swiftfor Linux test discoveryswift buildon this Linux VM (macOS-only project) — CI will verify compilationLink to Devin session: https://app.devin.ai/sessions/fac19a61bc9648dcaa1e8957888a7371
Requested by: @davidbean-hash