[llvm] d23b15c - Execute llvm-lit with the python found by CMake by default

Alex Richardson via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 02:52:26 PDT 2020


Author: Alex Richardson
Date: 2020-08-03T10:51:35+01:00
New Revision: d23b15cc160775dcc5b6e2c2d7706a67be1225f1

URL: https://github.com/llvm/llvm-project/commit/d23b15cc160775dcc5b6e2c2d7706a67be1225f1
DIFF: https://github.com/llvm/llvm-project/commit/d23b15cc160775dcc5b6e2c2d7706a67be1225f1.diff

LOG: Execute llvm-lit with the python found by CMake by default

The check-* targets run ${Python3_EXECUTABLE} $BUILD/bin/llvm-lit, but
running `./bin/llvm-lit $ARGS` from the build directory currently always
uses "python" to run llvm-lit. On most systems this will be python2.7 even
if we found python3 at CMake time.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D84625

Added: 
    

Modified: 
    llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
    llvm/utils/llvm-lit/llvm-lit.in

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn b/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
index 526b93b4f0b9..648646e4188d 100644
--- a/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
@@ -86,6 +86,7 @@ write_cmake_config("llvm-lit") {
 
   values = [
     "LLVM_SOURCE_DIR=" + rebase_path("//llvm", dir),
+    "Python3_EXECUTABLE=$python_path",
     "BUILD_MODE=.",
     "LLVM_LIT_CONFIG_MAP=" + config_map,
   ]

diff  --git a/llvm/utils/llvm-lit/llvm-lit.in b/llvm/utils/llvm-lit/llvm-lit.in
index bfa55c6abfac..33ec8017cf05 100755
--- a/llvm/utils/llvm-lit/llvm-lit.in
+++ b/llvm/utils/llvm-lit/llvm-lit.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!@Python3_EXECUTABLE@
 # -*- coding: utf-8 -*-
 
 import os


        


More information about the llvm-commits mailing list