SPIRV-Tools requires python3 (#2510)
Updates:
- CMake configuration
- Kokoro build scripts on Linux and macos (Windows already uses Python 3.6)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3524475..abe89d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -178,7 +178,8 @@
endmacro()
endif()
-find_host_package(PythonInterp)
+# Tests require Python3
+find_host_package(PythonInterp 3 REQUIRED)
# Check for symbol exports on Linux.
# At the moment, this check will fail on the OSX build machines for the Android NDK.
diff --git a/README.md b/README.md
index b759a70..a9b70c1 100644
--- a/README.md
+++ b/README.md
@@ -276,14 +276,8 @@
- [CMake](http://www.cmake.org/): for generating compilation targets. Version
2.8.12 or later.
-- [Python](http://www.python.org/): for utility scripts and running the test
-suite. Version 2 or 3.
-
-We will be moving to Python3 only in the future. If you are using Python2, you
-will need to install Python-future:
-```
-pip install future
-```
+- [Python 3](http://www.python.org/): for utility scripts and running the test
+suite.
SPIRV-Tools is regularly tested with the the following compilers:
diff --git a/kokoro/scripts/linux/build.sh b/kokoro/scripts/linux/build.sh
index 5eef411..3d20b38 100644
--- a/kokoro/scripts/linux/build.sh
+++ b/kokoro/scripts/linux/build.sh
@@ -77,7 +77,7 @@
# Invoke the build.
BUILD_SHA=${KOKORO_GITHUB_COMMIT:-$KOKORO_GITHUB_PULL_REQUEST_COMMIT}
echo $(date): Starting build...
-cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2.7 -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=install -DRE2_BUILD_TESTING=OFF $ADDITIONAL_CMAKE_FLAGS $CMAKE_C_CXX_COMPILER ..
+cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=install -DRE2_BUILD_TESTING=OFF $ADDITIONAL_CMAKE_FLAGS $CMAKE_C_CXX_COMPILER ..
echo $(date): Build everything...
ninja
diff --git a/kokoro/scripts/macos/build.sh b/kokoro/scripts/macos/build.sh
index a7f0453..8e6d298 100644
--- a/kokoro/scripts/macos/build.sh
+++ b/kokoro/scripts/macos/build.sh
@@ -41,7 +41,14 @@
# Invoke the build.
BUILD_SHA=${KOKORO_GITHUB_COMMIT:-$KOKORO_GITHUB_PULL_REQUEST_COMMIT}
echo $(date): Starting build...
-cmake -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
+# We need Python 3. At the moment python3.7 is the newest Python on Kokoro.
+cmake \
+ -GNinja \
+ -DPYTHON_EXECUTABLE:FILEPATH=/usr/local/bin/python3.7 \
+ -DCMAKE_C_COMPILER=clang \
+ -DCMAKE_CXX_COMPILER=clang++ \
+ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
+ ..
echo $(date): Build everything...
ninja