Fix Xcode 26 beta 2 version detection failure#2
Open
davidbean-hash wants to merge 3 commits into
Open
Conversation
- Default shouldAddLegacyFlag to true when xcresulttool version cannot be determined, since newer Xcode versions that change the version format also require the --legacy flag - Add more robust version parsing with fallback regex pattern to handle different version output formats (e.g. dotted versions like 26.0.0) 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:
|
- Extract parseXcresulttoolVersionOutput() as a public testable method - Add XCParseCoreTests target with VersionParsingTests covering: - Plain integer versions (e.g., 23028) - Dotted versions (e.g., 26.0, 26.0.0, 26.1.2) - Unparseable output returning nil - Fallback regex parsing - Legacy flag threshold comparisons - Edge cases (multiline, whitespace, comma-separated) Co-Authored-By: david.bean <david.bean@cognition.ai>
Xcode 16+ changed xcresulttool version output from large build numbers (e.g. 15500, 23028) to semantic versions (e.g. 26.0). The previous commit correctly parsed the new format but broke two comparisons: 1. shouldAddLegacyFlag: Version(26,0,0) >= Version(23028,0,0) was false, so --legacy flag was NOT added for Xcode 26 (the original bug) 2. Unicode export paths: Version(26,0,0) < Version(15500,0,0) was true, incorrectly marking Xcode 26 as not supporting Unicode paths Fix: Add usesSemanticVersioning() to detect the new scheme (major < 100), and needsLegacyFlag()/supportsUnicodeExportPaths() helpers that handle both schemes correctly. Update XCResultToolCommand.swift and XCPParser.swift to use these helpers instead of raw comparisons. Credit: Issue identified by Devin Review automated analysis. Co-Authored-By: david.bean <david.bean@cognition.ai>
Test Results — Xcode 26 Version Detection FixEnvironment: Ubuntu 22.04, Swift 5.9.2 | Devin Session
Results: 25/25 passed
Full test outputFiles changed |
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 ChargePoint#91 — xcparse fails with Xcode 26 beta 2 because
Version.xcresulttool()cannot parse the new version format.Changes:
XCResultToolCommand.swift– WhenVersion.xcresulttool()returnsnil,shouldAddLegacyFlagnow defaults totrueinstead offalse. UsesVersion.needsLegacyFlag()for version-aware comparison.Version+XCPTooling.swift– Made version parsing more robust:parseXcresulttoolVersionOutput(_:)as a public testable methodVersion(string:)fails (handles formats like26.0,26.0.0)version X.Y.Zorversion XpatternusesSemanticVersioning()to detect new Xcode 16+ version scheme (major < 100)needsLegacyFlag()andsupportsUnicodeExportPaths()helpers that handle both old (build number) and new (semantic) versioning schemesXCPParser.swift– Updated Unicode compatibility check to useVersion.supportsUnicodeExportPaths()instead of raw comparison, fixing a regression whereVersion(26, 0, 0) < Version(15500, 0, 0)incorrectly disabled Unicode path support.Unit tests – Added
XCParseCoreTeststarget with 21 tests covering:23028) and dotted versions (e.g.,26.0,26.0.0)needsLegacyFlag()for both schemes (Xcode 26 correctly needs legacy flag)supportsUnicodeExportPaths()for both schemes (Xcode 26 correctly supports Unicode)Test Plan/Testing Performed:
Version(26, 0, 0)correctly:--legacyflag (vianeedsLegacyFlag)supportsUnicodeExportPaths)Link to Devin session: https://app.devin.ai/sessions/3d7908cc7c164d0fa73749ce376539f3
Requested by: @davidbean-hash