Skip to content
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

Fix regression in compiler family detection #1014

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

russelltg
Copy link
Contributor

f36d6a7 introduced a regression where if your output directory had any of the special strings in it it would erronously find the string.

For example, my output dir is /workspaces/ars/build_windows_clang_x86_64_relnoopt/./cargo/build/x86_64-pc-windows-msvc/release/

But i'm using clang (and not clang-cl), so it finds msvc in the output and decides this is clang-cl.

Adding the quotes still feels messy--but I'm not sure if there is a bettery way--you can't just search for the pragma comment as at least clang seems to insert the parenthesis. We could use a regular expression of something like #\s*pragma\s*message\s*\(?\s*"clang"\s*\)? but that's kinda icky as well.

f36d6a7 introduced a regression where if your output directory had any of the special strings in it it would erronously find the string.

For example, my output dir is /workspaces/ars/build_windows_clang_x86_64_relnoopt/./cargo/build/x86_64-pc-windows-msvc/release/

But i'm using clang (and not clang-cl), so it finds `msvc` in the output and decides this is clang-cl.

Adding the quotes still feels messy--but I'm not sure if there is a bettery way--you can't just search for the pragma comment as at least clang seems to insert the parenthesis. We could use a regular expression of something like `#\s*pragma\s*message\s*\(?\s*"clang"\s*\)?` but that's kinda icky as well.
Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@NobodyXu NobodyXu merged commit 0195ebf into rust-lang:main Mar 19, 2024
21 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.

None yet

2 participants