Skip to content

🍒[Swift 6.0] Allow overriding clang++ with an environment variable #1638

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 2 commits into from
Nov 4, 2024

Conversation

etcwilde
Copy link
Contributor

Cherry-picking: #1605

'+' isn't allowed in environment variable names so it's impossible to set the Clang++ executable at the moment. Replace + with X so that we can set SWIFT_DRIVER_CLANGXX_EXEC to set the clang++ executable.

Fixes: rdar://128007218

Explanation: Replaces + with X in the toolchain while doing tool lookup from an environment variable because + is not allowed in valid environment variable names. This prevents us from telling the driver where to look for the clang++ binary.

Risk: Low. Only affects projects that set the SWIFT_DRIVER_CLANGXX_EXEC environment variable. Since that doesn't do anything today, that would be a silly thing to do. Otherwise, projects cannot currently set SWIFT_DRIVER_CLANG++_EXEC because that's an invalid environment variable name.

Testing: Added test to verify that the substitution is made correctly.

Fixes: rdar://128007218

etcwilde added 2 commits June 21, 2024 08:26
Check that the clang override environment variables actually do
something. Note that clang++ is only used to link on non-Darwin
platforms when the interop mode is swift-5.9.
'+' isn't allowed in environment variable names so it's impossible to
set the Clang++ executable at the moment. Replace `+` with `X` so that
we can set `SWIFT_DRIVER_CLANGXX_EXEC` to set the clang++ executable.
@etcwilde etcwilde requested review from artemcm and tshortli June 21, 2024 16:20
@etcwilde
Copy link
Contributor Author

@swift-ci please test

@etcwilde etcwilde merged commit ac0b93f into swiftlang:release/6.0 Nov 4, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants