universal.py: search_version: make the version regex a bit more robust#15970
Open
jmarcoscosta wants to merge 1 commit into
Open
universal.py: search_version: make the version regex a bit more robust#15970jmarcoscosta wants to merge 1 commit into
jmarcoscosta wants to merge 1 commit into
Conversation
This change basically adds another check: the version number should not be followed by something other than a space. As an example, this is the output of 'clang --version' in a custom LLVM toolchain: (FooBar LLVM-Linux 5.0.0) clang version 21.9.0 Target: riscv64-unknown-linux-gnu Thread model: posix (...) where "5.0.0" is an internal tag, unrelated to clang's version itself. With the current regex, meson detects that clang's version is "5.0.0", and this breaks the build of some packages (e.g., appstream): | ../sources/AppStream-1.0.6/meson.build:1:0: ERROR: None of values ['gnu17'] are supported by the C compiler. Possible values for option "c_std" are ['none', 'c89', 'c99', 'c11', 'gnu89', 'gnu99', 'gnu11'] While I understand the root cause is this spurious internal version number being present left to clang's version, I belive the current regex would be more robust if it also checks what comes next after the 'X.Y.Z' pattern. Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change basically adds another check: the version number should not be followed by something other than a space.
As an example, this is the output of 'clang --version' in a custom LLVM toolchain:
(FooBar LLVM-Linux 5.0.0) clang version 21.9.0
Target: riscv64-unknown-linux-gnu
Thread model: posix
(...)
where "5.0.0" is an internal tag, unrelated to clang's version itself.
With the current regex, meson detects that clang's version is "5.0.0", and this breaks the build of some packages (e.g., appstream):
| ../sources/AppStream-1.0.6/meson.build:1:0: ERROR: None of values ['gnu17'] are supported by the C compiler. Possible values for option "c_std" are ['none', 'c89', 'c99', 'c11', 'gnu89', 'gnu99', 'gnu11']
While I understand the root cause is this spurious internal version number being present left to clang's version, I belive the current regex would be more robust if it also checks what comes next after the 'X.Y.Z' pattern.