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

[5.2] [tibs] Detect clang index support using -help instead of --version #106

Merged
merged 1 commit into from
Jul 8, 2020

Conversation

drexin
Copy link

@drexin drexin commented Jul 8, 2020

The previous check for apple-clang, swift-clang, etc. was failing on
released toolchains, since they don't contain the repo name, and on
clones of the repo that didn't match the pattern.

Check clang -help for index store support. It would be better to check
that clang -index-store-path /dev/null --version does not produce an
error, but unfortunately older versions of clang accepted
-index-store-path due to the existince of a -i option that has since
been removed. While we could check a full compile command, I have not
found a robust command that detects index support without also doing I/O
in the index directory when it succeeds. To avoid I/O, we check -help.

The previous check for apple-clang, swift-clang, etc. was failing on
released toolchains, since they don't contain the repo name, and on
clones of the repo that didn't match the pattern.

Check clang -help for index store support. It would be better to check
that `clang -index-store-path /dev/null --version` does not produce an
error, but unfortunately older versions of clang accepted
`-index-store-path` due to the existince of a `-i` option that has since
been removed. While we could check a full compile command, I have not
found a robust command that detects index support without also doing I/O
in the index directory when it succeeds. To avoid I/O, we check -help.
@drexin drexin changed the title [tibs] Detect clang index support using -help instead of --version [5.2] [tibs] Detect clang index support using -help instead of --version Jul 8, 2020
@drexin drexin merged commit 20a17d4 into swiftlang:swift-5.2-branch Jul 8, 2020
@drexin drexin deleted the wip-backport-clang-fix branch July 8, 2020 21:47
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