Skip to content

Work around a diagnostic using CommandLine.arguments on older toolchains. #2625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Apr 25, 2024

…hains. (#2622)

CommandLine.arguments is declared read/write in older toolchains and this causes an error diagnostic when it's used in Swift 6 mode. This PR uses CommandLine.argc and CommandLine.unsafeArgv directly instead so the diagnostic does not occur.

Cherry-picked from main (#2622, 6c459f2) because certain combinations of toolchains and swift-syntax versions are now incompatible. Until that issue is resolved and those toolchains have aged out, the workaround is needed, but we can presumably revert it in a few weeks if it's bothersome.

Explanation: Certain combinations of toolchains and swift-syntax versions are now incompatible. A build error occurs when using swift-syntax-600 with those toolchains.
Scope: Implementation only.
Issue: #2622
Original PR: #2622
Risk: No obvious risk. The implementation of CommandLine.arguments is equivalent to the code added in this PR.
Testing: Tested at desk with the change locally and pulling from the main branch after it was merged there. The diagnostic is gone.
Reviewer: @bnbarham @ahoppen

…hains. (#2622)

`CommandLine.arguments` is declared read/write in older toolchains and this
causes an error diagnostic when it's used in Swift 6 mode. This PR uses
`CommandLine.argc` and `CommandLine.unsafeArgv` directly instead so the
diagnostic does not occur.
@grynspan grynspan added the bug Something isn't working label Apr 25, 2024
@grynspan grynspan self-assigned this Apr 25, 2024
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan grynspan enabled auto-merge (squash) April 25, 2024 17:36
@grynspan grynspan merged commit 1099b16 into release/6.0 Apr 25, 2024
@grynspan grynspan deleted the jgrynspan/command-line-args-concurrency-6.0 branch April 25, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants