scripts: fix clang version detection on certain Linux distributions#651
Conversation
|
Oh, I used that regex precisely to allow for any trailing part while keeping the command as simple as possible, but I didn't expect another 3-part full version in the trailing part... Thanks a lot for catching this! I think we can be a bit more strict on the matching (to still match a single thing), something like:
By the way, please keep the first |
|
No worries. Agree, I will resubmit another patch tomorrow for review. I
found this while setting up my environment to contribute further. It was a
showstopper even though my toolchain version is the expected one (I could
not see the Rust support option in menuconfig).
…On Wed, 26 Jan 2022, 20:15 Miguel Ojeda, ***@***.***> wrote:
Oh, I used that regex precisely to allow for any trailing part while
keeping the command as simple as possible, but I didn't expect another
3-part version in the trailing part...
I think we can be a bit more strict on the matching (to still match a
single thing), something like:
sed -nE 's:.*version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
By the way, please keep the first head -n 1 or use 1s -- the idea is that
the version should really be on the first line, so we should not look
elsewhere.
—
Reply to this email directly, view it on GitHub
<#651 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6KEGXFZCAYAGKR3FNCIJDUYBB43ANCNFSM5M32CNWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Prevents the libclang vs clang version mismatch warning message from showing up when the clang version reported by 'clang --version' contains the Linux distro version Signed-off-by: macano953 <macanroj@gmail.com>
50be0ed to
47889d7
Compare
|
Looks good. We will probably want to update the other places in the file with a similar approach to be consistent, but this can go in already. Thanks! |
|
By the way, in the PR message above you correctly had your full name in the |
Prevents the libclang vs clang version mismatch warning message from showing up when the clang version reported by 'clang --version' contains a trailing Linux distro version.
Example of non-working scenario:
$ LC_ALL=C clang --version 2>/dev/null Ubuntu clang version 11.0.0-2~ubuntu20.04.1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/binSigned-off-by: Miguel Cano macanroj@gmail.com