From b9a569e7be6131f0691ed7bac150723a383e1a08 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 18 Feb 2020 18:58:17 -0500 Subject: [PATCH] LUCENE-9230: explicitly call python version we want from builds On newer linux distros, at least, 'python' now means python3. So we can't rely on what version of python it will invoke (at least for a few years). For example in Fedora Linux: https://fedoraproject.org/wiki/Changes/Python_means_Python3 For python2.x code, explicitly call 'python2.7' and for python3.x code, explicitly call 'python3'. Ant variable names are cleaned up, e.g. 'python.exe' is renamed to 'python2.exe' and 'python32.exe' is renamed to 'python3.exe'. This also makes it easy to identify remaining python 2.x code that should be migrated to python 3.x --- build.xml | 4 ++-- gradle/generation/util.gradle | 4 ++-- lucene/analysis/common/build.xml | 2 +- lucene/common-build.xml | 12 ++++++------ lucene/core/build.xml | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/build.xml b/build.xml index 1d82544443a..a1e8ccb4f2e 100755 --- a/build.xml +++ b/build.xml @@ -441,7 +441,7 @@ File | Project Structure | Platform Settings | SDKs): - + @@ -460,7 +460,7 @@ File | Project Structure | Platform Settings | SDKs): - + diff --git a/gradle/generation/util.gradle b/gradle/generation/util.gradle index 8bf9bede441..b6981f57ca8 100644 --- a/gradle/generation/util.gradle +++ b/gradle/generation/util.gradle @@ -57,7 +57,7 @@ configure(project(":lucene:core")) { logger.lifecycle("Executing: ${prog} in ${targetDir}") project.exec { workingDir targetDir - executable "python" + executable "python2.7" args = ['-B', "${prog}"] } } @@ -82,7 +82,7 @@ configure(project(":lucene:core")) { ['True', 'False'].each { transpose -> project.exec { workingDir targetDir - executable "python" + executable "python2.7" args = ['-B', 'createLevAutomata.py', num, transpose, "${momanDir}/finenight/python"] } } diff --git a/lucene/analysis/common/build.xml b/lucene/analysis/common/build.xml index c3d4fcca8b2..0e14d91a17c 100644 --- a/lucene/analysis/common/build.xml +++ b/lucene/analysis/common/build.xml @@ -45,7 +45,7 @@ + executable="${python2.exe}" failonerror="true" logerror="true"> diff --git a/lucene/common-build.xml b/lucene/common-build.xml index 1e3da88250b..ca6db1b32ad 100644 --- a/lucene/common-build.xml +++ b/lucene/common-build.xml @@ -247,10 +247,10 @@ - - - - + + + + @@ -2440,7 +2440,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list} - + @@ -2453,7 +2453,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list} - + diff --git a/lucene/core/build.xml b/lucene/core/build.xml index be42c56e7d6..1759b3f44b9 100644 --- a/lucene/core/build.xml +++ b/lucene/core/build.xml @@ -69,7 +69,7 @@ + executable="${python2.exe}" failonerror="true"> @@ -79,7 +79,7 @@ + executable="${python2.exe}" failonerror="true"> @@ -94,13 +94,13 @@ + executable="${python2.exe}" failonerror="true"> + executable="${python2.exe}" failonerror="true">