Fix analyze handling of Xcode 26 @response files - #6887
Draft
aryansk wants to merge 1 commit into
Draft
Conversation
Xcode 26 passes swiftc arguments via @response files. The log parser's expandingResponseFiles only split response files by newlines, so space-separated files (Xcode 26) were treated as a single argument and no source files were discovered, causing analyze to report 0 violations with exit 0. Fix by reusing parseCLIArguments for response files so both newline-separated (Xcode 25) and space-separated (Xcode 26) layouts are handled, including quoted paths and nested @ files. Also fix parseCLIArguments to correctly handle leading quotes and to split on whitespace/newlines instead of only spaces, and to filter empty components. Fixes realm#6877
Here's an example of your CHANGELOG entry: * Fix analyze handling of Xcode 26 @response files.
[aryansk](https://github.com/aryansk)
[#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)note: There are two invisible spaces after the entry's text. Generated by 🚫 Danger |
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.
Fixes #6877
Problem
swiftlint analyzereported 0 files with exit 0 on Xcode 26 build logs:Xcode 26 passes swiftc arguments via
@responsefiles (.../swiftc -module-name Sovran -Onone @/path/to/response). The log parser'sexpandingResponseFilesonly split response files by newlines (components(separatedBy: "\n")), so space-separated files (Xcode 26) were treated as a single argument and no source files were discovered.Quoted paths with spaces and nested
@files were also at risk, andparseCLIArgumentsmishandled leading quotes.Change
parseCLIArgumentsfor response file contents so both newline-separated (Xcode 25) and space-separated (Xcode 26) layouts are handled, including quoted paths and nested@files.parseCLIArgumentsto correctly handle leading quotes and to split onwhitespacesAndNewlines(not just" "), filtering empty components. This preserves existing log parsing while fixing response-file parsing.Validation
swiftc -module-name Sovran -Onone @/pathcorrectly expandsbash -nequivalent file check passes;swift buildofSwiftLintFrameworktarget compiles (change is isolated toCompilerArgumentsExtractor.swift)