Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use python3/python/python2 instead of just python #16560

Merged
merged 3 commits into from Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -48,8 +48,9 @@
MAKEFLAGS = --no-print-directory

export CHPL_MAKE_HOME=$(shell pwd)
export CHPL_MAKE_PYTHON := $(shell $(CHPL_MAKE_HOME)/util/config/find-python.sh)

NEEDS_LLVM_RUNTIME=${CHPL_MAKE_HOME}/util/chplenv/chpl_llvm.py \
NEEDS_LLVM_RUNTIME=$(CHPL_MAKE_PYTHON) ${CHPL_MAKE_HOME}/util/chplenv/chpl_llvm.py \
--needs-llvm-runtime

default: all
Expand Down
4 changes: 3 additions & 1 deletion Makefile.devel
Expand Up @@ -16,7 +16,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

PYTHON_VERSION_DIR = py$(shell $(CHPL_MAKE_HOME)/util/chplenv/chpl_python_version.py)
export CHPL_MAKE_PYTHON := $(shell $(CHPL_MAKE_HOME)/util/config/find-python.sh)

PYTHON_VERSION_DIR = py$(shell $(CHPL_MAKE_PYTHON) $(CHPL_MAKE_HOME)/util/chplenv/chpl_python_version.py)

develall:
@$(MAKE) always-build-man
Expand Down
7 changes: 4 additions & 3 deletions compiler/Makefile
Expand Up @@ -113,7 +113,8 @@ ifndef CHPL_MAKE_THIRD_PARTY
CHPL_MAKE_THIRD_PARTY = $(CHPL_MAKE_HOME)/third-party
endif

FIXPATH_CMD := $(CHPL_MAKE_HOME)/util/config/replace-paths.py \
FIXPATH_CMD := $(CHPL_MAKE_PYTHON) \
$(CHPL_MAKE_HOME)/util/config/replace-paths.py \
--fixpath '$$CHPL_THIRD_PARTY' $(CHPL_MAKE_THIRD_PARTY) \
--fixpath '$$CHPL_HOME' $(CHPL_MAKE_HOME)

Expand Down Expand Up @@ -146,11 +147,11 @@ $(CHPL_MAKE_HOME)/configured-prefix:

$(CONFIGURED_PREFIX_FILE): FORCE $(COMPILER_BUILD) $(CHPL_MAKE_HOME)/configured-prefix
@echo '"'`cat $(CHPL_MAKE_HOME)/configured-prefix`'"' \ > $(CONFIGURED_PREFIX_FILE).incoming
@$(CHPL_MAKE_HOME)/util/config/update-if-different $(CONFIGURED_PREFIX_FILE) $(CONFIGURED_PREFIX_FILE).incoming
@$(CHPL_MAKE_PYTHON) $(CHPL_MAKE_HOME)/util/config/update-if-different $(CONFIGURED_PREFIX_FILE) $(CONFIGURED_PREFIX_FILE).incoming

$(CLANG_SETTINGS_FILE): FORCE $(COMPILER_BUILD)
@echo '{"'$(CLANG_CC)'","'$(CLANG_CXX)'","'`$(CHPL_MAKE_HOME)/util/config/gather-clang-sysroot-arguments $(CLANG_CC)`'"}' | $(FIXPATH_CMD) > $(CLANG_SETTINGS_FILE).incoming
@$(CHPL_MAKE_HOME)/util/config/update-if-different $(CLANG_SETTINGS_FILE) $(CLANG_SETTINGS_FILE).incoming
@$(CHPL_MAKE_PYTHON) $(CHPL_MAKE_HOME)/util/config/update-if-different $(CLANG_SETTINGS_FILE) $(CLANG_SETTINGS_FILE).incoming

$(CHPL_CONFIG_CHECK): | $(CHPL_BIN_DIR)
rm -rf $(CHPL_CONFIG_CHECK_PREFIX)
Expand Down
2 changes: 1 addition & 1 deletion compiler/util/files.cpp
Expand Up @@ -566,7 +566,7 @@ std::string runPrintChplEnv(std::map<std::string, const char*> varMap) {
std::string getVenvDir() {
// Runs `util/chplenv/chpl_home_utils.py --venv` and removes the newline

std::string command = "CHPL_HOME=" + std::string(CHPL_HOME) + " python ";
std::string command = "CHPL_HOME=" + std::string(CHPL_HOME) + " python3 ";
command += std::string(CHPL_HOME) + "/util/chplenv/chpl_home_utils.py --venv 2> /dev/null";

std::string venvDir = runCommand(command);
Expand Down
2 changes: 1 addition & 1 deletion doc/rst/developer/bestPractices/TestSystem.rst
Expand Up @@ -318,7 +318,7 @@ For instance:

.. code-block:: python

#!/usr/bin/env python
#!/usr/bin/env python3

import os
print(os.getenv('CHPL_TEST_PERF') == 'on' and
Expand Down
2 changes: 1 addition & 1 deletion doc/util/chpl2rst.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# encoding: utf-8

"""chpl2rst converts a chapel program to an rst file, where all comments are
Expand Down
2 changes: 1 addition & 1 deletion doc/util/extract-rst-tests.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# encoding: utf-8

"""
Expand Down
3 changes: 3 additions & 0 deletions make/Makefile.base
Expand Up @@ -99,6 +99,9 @@ $(eval $(CHPL_MAKE_SETTINGS))
# Try this to debug issues with CHPL_MAKE_* variables
# $(info $(CHPL_MAKE_CHPLENV_CACHE))

# Compute python command name
export CHPL_MAKE_PYTHON := $(shell $(CHPL_MAKE_HOME)/util/config/find-python.sh)

# Now do some minor situational clean-ups.

# The config variable for segment is CHPL_GASNET_SEGMENT
Expand Down
8 changes: 6 additions & 2 deletions man/Makefile
Expand Up @@ -2,16 +2,20 @@ ifndef CHPL_MAKE_HOME
export CHPL_MAKE_HOME=$(shell pwd)/..
endif

ifndef CHPL_MAKE_PYTHON
export CHPL_MAKE_PYTHON := $(shell $(CHPL_MAKE_HOME)/util/config/find-python.sh)
endif

PROGRAM = chpl
CHPLDOC = chpldoc

MANPAGE = man1/$(PROGRAM).1
CHPLDOC_MANPAGE = man1/$(CHPLDOC).1
TARGETS = $(MANPAGE) $(PROGRAM).pdf $(CHPLDOC).pdf

VENV_DIR = $(shell python $(CHPL_MAKE_HOME)/util/chplenv/chpl_home_utils.py --venv)
VENV_DIR = $(shell $(CHPL_MAKE_PYTHON) $(CHPL_MAKE_HOME)/util/chplenv/chpl_home_utils.py --venv)

RST2MAN = $(shell which rst2man.py || echo $(VENV_DIR)/bin/rst2man.py)
RST2MAN = $(shell which rst2man.py || echo $(CHPL_MAKE_PYTHON) $(VENV_DIR)/bin/rst2man.py)

STARS = \*\*\*\*\*

Expand Down
4 changes: 2 additions & 2 deletions modules/Makefile
Expand Up @@ -59,11 +59,11 @@ MAKE_SYS_BASIC_TYPES=$(CHPL_MAKE_HOME)/util/config/make_sys_basic_types.py

$(SYS_CTYPES_MODULE): $(MAKE_SYS_BASIC_TYPES)
mkdir -p $(@D)
cd $(@D) && $(MAKE_SYS_BASIC_TYPES) $(@F)
cd $(@D) && $(CHPL_MAKE_PYTHON) $(MAKE_SYS_BASIC_TYPES) $(@F)

$(SYS_CTYPES_MODULE_DOC): $(MAKE_SYS_BASIC_TYPES)
mkdir -p $(@D)
cd $(@D) && $(MAKE_SYS_BASIC_TYPES) --doc $(@F)
cd $(@D) && $(CHPL_MAKE_PYTHON) $(MAKE_SYS_BASIC_TYPES) --doc $(@F)

MODULES_TO_DOCUMENT = \
standard/Assert.chpl \
Expand Down
2 changes: 1 addition & 1 deletion runtime/Makefile
Expand Up @@ -65,7 +65,7 @@ $(CHPL_ENV_HEADER): $(CHPL_MAKE_HOME)/util/printchplenv $(CHPL_MAKE_HOME)/util/c
awk '{ print "#define " $$1 "_" toupper($$2) }' >> $(CHPL_ENV_HEADER)
@echo "#endif /* _CHPL_ENV_GEN_H_ */" >> $(CHPL_ENV_HEADER)

THIRD_PARTY_PKGS = $(shell $(CHPL_MAKE_HOME)/util/chplenv/third-party-pkgs)
THIRD_PARTY_PKGS = $(shell $(CHPL_MAKE_PYTHON) $(CHPL_MAKE_HOME)/util/chplenv/third-party-pkgs)
# NOTE: If any of these builds fail, we won't stop building
third-party-pkgs:
ifneq (, $(THIRD_PARTY_PKGS))
Expand Down
3 changes: 2 additions & 1 deletion runtime/Makefile.config
Expand Up @@ -41,7 +41,8 @@ ifndef CHPL_MAKE_THIRD_PARTY
CHPL_MAKE_THIRD_PARTY = $(CHPL_MAKE_HOME)/third-party
endif

FIXPATH_CMD := $(CHPL_MAKE_HOME)/util/config/replace-paths.py \
FIXPATH_CMD := $(CHPL_MAKE_PYTHON) \
$(CHPL_MAKE_HOME)/util/config/replace-paths.py \
--fixpath '$$CHPL_RUNTIME_LIB' $(CHPL_MAKE_RUNTIME_LIB) \
--fixpath '$$CHPL_RUNTIME_INCL' $(CHPL_MAKE_RUNTIME_INCL) \
--fixpath '$$CHPL_THIRD_PARTY' $(CHPL_MAKE_THIRD_PARTY) \
Expand Down
2 changes: 1 addition & 1 deletion test/analysis/alias/PREDIFF
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys

Expand Down
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

#
# This test ensures that the generated code contains instances of foo,
Expand Down
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

#
# This test ensures that the generated code contains instances of certain
Expand Down
2 changes: 1 addition & 1 deletion test/compflags/bradc/mungeUserIdents/testmunge.prediff
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, os, shutil

Expand Down
2 changes: 1 addition & 1 deletion test/compflags/ferguson/default-binary-name/sub_test
@@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/env python3

import subprocess
import sys
Expand Down
2 changes: 1 addition & 1 deletion test/compflags/link/sungeun/static_dynamic.prediff
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, os, subprocess, string

Expand Down
2 changes: 1 addition & 1 deletion test/compflags/sungeun/configs/basic/PREDIFF
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, string

Expand Down
2 changes: 1 addition & 1 deletion test/compflags/sungeun/configs/type_variables/PREDIFF
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# WARNING: This script is pretty touchy wrt to its input
#
Expand Down
2 changes: 1 addition & 1 deletion test/distributions/robust/arithmetic/PREDIFF
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Figure out which of TESTNAME.*.good is applicable; copy it to TESTNAME.good.
#
Expand Down
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Figure out which of TESTNAME.*.good is applicable; copy it to TESTNAME.good.
#
Expand Down
2 changes: 1 addition & 1 deletion test/domains/sungeun/assoc/index_not_in_domain_1.prediff
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, re

Expand Down
2 changes: 1 addition & 1 deletion test/domains/sungeun/assoc/index_not_in_domain_2.prediff
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, re

Expand Down
2 changes: 1 addition & 1 deletion test/domains/sungeun/sparse/index_not_in_domain_1.prediff
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, re

Expand Down
2 changes: 1 addition & 1 deletion test/domains/sungeun/sparse/index_not_in_domain_2.prediff
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, re

Expand Down
2 changes: 1 addition & 1 deletion test/execflags/bradc/errors/PREDIFF
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, os, string

Expand Down
2 changes: 1 addition & 1 deletion test/execflags/bradc/gdbddash/gdbSetConfig.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os, os.path

Expand Down
2 changes: 1 addition & 1 deletion test/execflags/dinan/PREDIFF
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, os, string

Expand Down
2 changes: 1 addition & 1 deletion test/execflags/ferguson/help2.prediff
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, re

Expand Down
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, os, string

Expand Down
2 changes: 1 addition & 1 deletion test/execflags/shannon/configs/help/PREDIFF
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, re

Expand Down
2 changes: 1 addition & 1 deletion test/execflags/shannon/help.prediff
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys, re

Expand Down
2 changes: 1 addition & 1 deletion test/execflags/sungeun/about.prediff
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# This script fixes up the test output to remove the compiler version
# number and then generates a .good file based on the output of
Expand Down
2 changes: 1 addition & 1 deletion test/execflags/thomasvandoren/exceedMemInts.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""Only run this test on 32-bit platforms."""

Expand Down
2 changes: 1 addition & 1 deletion test/functions/ferguson/main/sub_test
@@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/env python3

import subprocess
import sys
Expand Down
2 changes: 1 addition & 1 deletion test/interop/C/multilocale.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""
Multilocale interoperability requires ZMQ
Expand Down
2 changes: 1 addition & 1 deletion test/interop/python/errorMessages/abiIncompatible.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os

Expand Down
2 changes: 1 addition & 1 deletion test/interop/python/multilocale.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""
Multilocale interoperability requires ZMQ
Expand Down
2 changes: 1 addition & 1 deletion test/io/ferguson/ctests/qio_bits_test.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""For valgrind, see qio_test.valgrind.test.c. Skip test when atomics are
implemented with locks and tasking layer is not fifo.
Expand Down
2 changes: 1 addition & 1 deletion test/io/ferguson/ctests/qio_test.compopts
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os

Expand Down
2 changes: 1 addition & 1 deletion test/io/ferguson/ctests/qio_test.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""Skip test when atomics are implemented with locks and tasking layer is not
fifo.
Expand Down
2 changes: 1 addition & 1 deletion test/io/ferguson/ctests/skip_non_fifo_atomic_locks.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""Skip test when atomics are implemented with locks and tasking layer is not fifo.

Expand Down
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# This prediff exists to change an absolute
# paths like /home/user/chapel/test/io/ferguson/test-dir
Expand Down
2 changes: 1 addition & 1 deletion test/io/thomasvandoren/lustre/SKIPIF
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""Skip test if lustre is not set in CHPL_AUX_FILESYS."""

Expand Down
2 changes: 1 addition & 1 deletion test/io/vass/time-write.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os

Expand Down
4 changes: 2 additions & 2 deletions test/library/draft/Vector/PREDIFF
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import os.path

Expand All @@ -13,4 +13,4 @@ with open(sys.argv[2], 'r') as f:
output += os.path.basename(line[:pos]) + ':xxx' + line[pos2:]

open(sys.argv[2], 'w').write(output)


2 changes: 1 addition & 1 deletion test/library/packages/Crypto/saru.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import subprocess
from distutils.version import LooseVersion
Expand Down
2 changes: 1 addition & 1 deletion test/library/packages/Crypto/saru/COMPOPTS
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import subprocess

Expand Down
2 changes: 1 addition & 1 deletion test/library/packages/FFTW/SKIPIF
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

#
# skip this test when FFTW_DIR is not set or we're using pgi (JIRA 195).
Expand Down
2 changes: 1 addition & 1 deletion test/library/packages/LAPACK.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""
Require BLAS and LAPACK modules
Expand Down
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# encoding: utf-8

"""
Expand Down
2 changes: 1 addition & 1 deletion test/library/packages/MPI/multilocale.skipif
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3


import os
Expand Down