Apache Lucene open-source search software
LUCENE-9230: explicitly call python version we want from builds
Robert Muirb9a569e7be61
diff --git a/build.xml b/build.xmlindex 1d82544443a..a1e8ccb4f2e 100755--- a/build.xml+++ b/build.xml@@ -441,7 +441,7 @@ File | Project Structure | Platform Settings | SDKs):</condition></fail><property name="-smokeTestRelease.java12params" value=""/><!-- (if not yet defined) -->- <exec executable="${python32.exe}" failonerror="true" taskname="python32">+ <exec executable="${python3.exe}" failonerror="true" taskname="python3"><arg value="-V"/></exec><subant target="prepare-release-no-sign" inheritall="false" failonerror="true">@@ -460,7 +460,7 @@ File | Project Structure | Platform Settings | SDKs):</copy><local name="url"/><makeurl file="${smokeTestRelease.dir}" validate="false" property="url"/>- <exec executable="${python32.exe}" failonerror="true" taskname="smoker">+ <exec executable="${python3.exe}" failonerror="true" taskname="smoker"><arg value="-u"/><!-- Tell Python not to write any bytecode cache into the filesystem: --><arg value="-B"/>diff --git a/gradle/generation/util.gradle b/gradle/generation/util.gradleindex 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.xmlindex c3d4fcca8b2..0e14d91a17c 100644--- a/lucene/analysis/common/build.xml+++ b/lucene/analysis/common/build.xml@@ -45,7 +45,7 @@<target name="generate-jflex-html-char-entities"><exec dir="src/java/org/apache/lucene/analysis/charfilter"output="src/java/org/apache/lucene/analysis/charfilter/HTMLCharacterEntities.jflex"- executable="${python.exe}" failonerror="true" logerror="true">+ executable="${python2.exe}" failonerror="true" logerror="true"><!-- Tell Python not to write any bytecode cache into the filesystem: --><arg value="-B"/><arg value="htmlentity.py"/>diff --git a/lucene/common-build.xml b/lucene/common-build.xmlindex 1e3da88250b..ca6db1b32ad 100644--- a/lucene/common-build.xml+++ b/lucene/common-build.xml@@ -247,10 +247,10 @@<property name="git.exe" value="git" /><property name="perl.exe" value="perl" />-- <property name="python.exe" value="python" />- <!-- todo: rename this variable -->- <property name="python32.exe" value="python3" />++ <!-- we default to python2.7 because not all OSs (e.g. mac) have a python2 link -->+ <property name="python2.exe" value="python2.7" />+ <property name="python3.exe" value="python3" /><property name="gpg.exe" value="gpg" /><property name="gpg.key" value="CODE SIGNING KEY" />@@ -2440,7 +2440,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}<macrodef name="check-broken-links"><attribute name="dir"/><sequential>- <exec dir="." executable="${python32.exe}" failonerror="true">+ <exec dir="." executable="${python3.exe}" failonerror="true"><!-- Tell Python not to write any bytecode cache into the filesystem: --><arg value="-B"/><arg value="${dev-tools.dir}/scripts/checkJavadocLinks.py"/>@@ -2453,7 +2453,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}<attribute name="dir"/><attribute name="level" default="class"/><sequential>- <exec dir="." executable="${python32.exe}" failonerror="true">+ <exec dir="." executable="${python3.exe}" failonerror="true"><!-- Tell Python not to write any bytecode cache into the filesystem: --><arg value="-B"/><arg value="${dev-tools.dir}/scripts/checkJavaDocs.py"/>diff --git a/lucene/core/build.xml b/lucene/core/build.xmlindex be42c56e7d6..1759b3f44b9 100644--- a/lucene/core/build.xml+++ b/lucene/core/build.xml@@ -69,7 +69,7 @@<attribute name="n"/><sequential><exec dir="src/java/org/apache/lucene/util/automaton"- executable="${python.exe}" failonerror="true">+ executable="${python2.exe}" failonerror="true"><!-- Tell Python not to write any bytecode cache into the filesystem: --><arg value="-B"/><arg value="createLevAutomata.py"/>@@ -79,7 +79,7 @@<arg value="../../../../../../../../build/core/moman/finenight/python"/></exec><exec dir="src/java/org/apache/lucene/util/automaton"- executable="${python.exe}" failonerror="true">+ executable="${python2.exe}" failonerror="true"><!-- Tell Python not to write any bytecode cache into the filesystem: --><arg value="-B"/><arg value="createLevAutomata.py"/>@@ -94,13 +94,13 @@<target name="createPackedIntSources"><exec dir="src/java/org/apache/lucene/util/packed"- executable="${python.exe}" failonerror="true">+ executable="${python2.exe}" failonerror="true"><!-- Tell Python not to write any bytecode cache into the filesystem: --><arg value="-B"/><arg value="gen_BulkOperation.py"/></exec><exec dir="src/java/org/apache/lucene/util/packed"- executable="${python.exe}" failonerror="true">+ executable="${python2.exe}" failonerror="true"><!-- Tell Python not to write any bytecode cache into the filesystem: --><arg value="-B"/><arg value="gen_Packed64SingleBlock.py"/>