8000 Tools/jit/_llvm.py doesn't support LLVM_VERSION_SUFFIX · Issue #120602 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Tools/jit/_llvm.py doesn't support LLVM_VERSION_SUFFIX #120602
Closed
@xarblu

Description

@xarblu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtopic-JITtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0