Skip to content

Make clang version parsing logic more robust#1996

Merged
emilio merged 1 commit intorust-lang:masterfrom
hlopko:parse_clang_version
Feb 15, 2021
Merged

Make clang version parsing logic more robust#1996
emilio merged 1 commit intorust-lang:masterfrom
hlopko:parse_clang_version

Conversation

@hlopko
Copy link
Copy Markdown
Contributor

@hlopko hlopko commented Feb 15, 2021

Previously the function assumed that the version number appeared in the
third word. This PR adds a heuristic - take the first word that starts
with a number.

This way we can also parse:

  • Debian clang version 11.0
  • Apple clang version 12.0.0

Previously the function assumed that the version number appeared in the
third word. This PR adds a heuristic - take the first word that starts
with a number.

This way we can also parse: `debian clang version 11.0` that my clang
reports.
@hlopko
Copy link
Copy Markdown
Contributor Author

hlopko commented Feb 15, 2021

r? @emilio

Copy link
Copy Markdown
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks!

@emilio emilio merged commit e92dcf2 into rust-lang:master Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants