[test-release] fallback to py3's venv module
authorBrian Cain <brian.cain@gmail.com>
Wed, 22 Jul 2020 00:47:38 +0000 (19:47 -0500)
committerBrian Cain <brian.cain@gmail.com>
Wed, 22 Jul 2020 00:51:15 +0000 (19:51 -0500)
If virtualenv is not available, we can look for py3's venv instead. We only
use this particular env for installing and running the test suite.

llvm/utils/release/test-release.sh

index 5351ae1064f9eb51c8c8734a6892b0a52adbbfe9..6bb6f42b080589209813a36754843096f1cec784 100755 (executable)
@@ -502,12 +502,18 @@ fi
 # Setup the test-suite.  Do this early so we can catch failures before
 # we do the full 3 stage build.
 if [ $do_test_suite = "yes" ]; then
+  venv=virtualenv
+  if ! type -P 'virtualenv' > /dev/null 2>&1 ; then
+    check_program_exists 'python3'
+    venv="python3 -m venv"
+  fi
+
   SandboxDir="$BuildDir/sandbox"
   Lit=$SandboxDir/bin/lit
   TestSuiteBuildDir="$BuildDir/test-suite-build"
   TestSuiteSrcDir="$BuildDir/llvm-test-suite"
 
-  virtualenv $SandboxDir
+  ${venv} $SandboxDir
   $SandboxDir/bin/python $BuildDir/llvm-project/llvm/utils/lit/setup.py install
   mkdir -p $TestSuiteBuildDir
 fi