From d23b15cc160775dcc5b6e2c2d7706a67be1225f1 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Mon, 3 Aug 2020 10:51:14 +0100 Subject: [PATCH] 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 --- llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn | 1 + llvm/utils/llvm-lit/llvm-lit.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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