Skip to content

Tools/jit/_llvm.py doesn't support LLVM_VERSION_SUFFIX #120602

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

Closed
xarblu opened this issue Jun 16, 2024 · 2 comments
Closed

Tools/jit/_llvm.py doesn't support LLVM_VERSION_SUFFIX #120602

xarblu opened this issue Jun 16, 2024 · 2 comments
Labels
build The build process and cross-build topic-JIT type-bug An unexpected behavior, bug, or error

Comments

@xarblu
Copy link
Contributor

xarblu commented Jun 16, 2024

Bug report

Bug description:

I initially encountered this build issue on Gentoo.

Currently the regex in Tools/jit/_llvm.py only allows strings of the form version MAJOR.MINOR.PATCH

_LLVM_VERSION_PATTERN = re.compile(rf"version\s+{_LLVM_VERSION}\.\d+\.\d+\s+")

However if LLVM was built with e.g. -DLLVM_VERSION_SUFFIX=+libcxx (as is the case on Gentoo) clang --version would return clang version 18.1.7+libcxx which is a valid version but doesn't match.

My proposed fix would be to simply allow a non-whitespace string of arbitrary length after the version, i.e.:

_LLVM_VERSION_PATTERN = re.compile(rf"version\s+{_LLVM_VERSION}\.\d+\.\d+\S*\s+")

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

@xarblu xarblu added the type-bug An unexpected behavior, bug, or error label Jun 16, 2024
@Eclips4 Eclips4 added build The build process and cross-build topic-JIT labels Jun 16, 2024
@Eclips4
Copy link
Member

Eclips4 commented Jun 16, 2024

Hello!
Would you like to send a PR? 🙂

xarblu added a commit to xarblu/cpython that referenced this issue Jun 16, 2024
@xarblu
Copy link
Contributor Author

xarblu commented Jun 16, 2024

Yes, I'm in the process of sending it. Just following the contribution guidelines and made the issue first :)

xarblu added a commit to xarblu/cpython that referenced this issue Jun 19, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 20, 2024
brandtbucher pushed a commit that referenced this issue Jun 20, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build topic-JIT type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants