Skip to content

Commit 6a04388

Browse files
committed
Support LLVM_VERSION configuration via env
This patch makes possible to override the llvm version used during build using "LLVM_VERSION" and "EXTERNALS_LLVM_TAG" environment variables. This is useful to test the build with other LLVM versions without changing the sources, for example to build with llvm-20.
1 parent e46d403 commit 6a04388

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
LLVM version can be modified during build with environment variables
2+
"LLVM_VERSION" and "EXTERNALS_LLVM_TAG".

Tools/jit/_llvm.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010

1111
import _targets
1212

13-
_LLVM_VERSION = 19
13+
_LLVM_VERSION_DEFAULT = "19"
14+
_EXTERNALS_LLVM_TAG_DEFAULT = "llvm-19.1.7.0"
15+
16+
_LLVM_VERSION = os.getenv("LLVM_VERSION", _LLVM_VERSION_DEFAULT)
1417
_LLVM_VERSION_PATTERN = re.compile(rf"version\s+{_LLVM_VERSION}\.\d+\.\d+\S*\s+")
15-
_EXTERNALS_LLVM_TAG = "llvm-19.1.7.0"
18+
_EXTERNALS_LLVM_TAG = os.getenv("EXTERNALS_LLVM_TAG", _EXTERNALS_LLVM_TAG_DEFAULT)
1619

1720
_P = typing.ParamSpec("_P")
1821
_R = typing.TypeVar("_R")

0 commit comments

Comments
 (0)