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

gh-84461: Add HOSTRUNNER for program to run Python executable #91931

Merged
merged 6 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ LIBOBJS= @LIBOBJS@
PYTHON= python$(EXE)
BUILDPYTHON= python$(BUILDEXE)

HOSTRUNNER= @HOSTRUNNER@

PYTHON_FOR_REGEN?=@PYTHON_FOR_REGEN@
UPDATE_FILE=$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/update_file.py
PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
Expand Down Expand Up @@ -1348,7 +1350,7 @@ regen-keyword:
$(UPDATE_FILE) $(srcdir)/Lib/keyword.py $(srcdir)/Lib/keyword.py.new

.PHONY: regen-stdlib-module-names
regen-stdlib-module-names: build_all Programs/_testembed
regen-stdlib-module-names: all Programs/_testembed
# Regenerate Python/stdlib_module_names.h
# using Tools/scripts/generate_stdlib_module_names.py
$(RUNSHARED) ./$(BUILDPYTHON) \
Expand Down Expand Up @@ -1645,15 +1647,15 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS)
######################################################################

TESTOPTS= $(EXTRATESTOPTS)
TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
TESTPYTHON= $(RUNSHARED) $(PYTHON_FOR_BUILD) $(TESTPYTHONOPTS)
TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
TESTTIMEOUT= 1200

.PHONY: test testall testuniversal buildbottest pythoninfo

# Remove "test_python_*" directories of previous failed test jobs.
# Pass TESTOPTS options because it can contain --tempdir option.
cleantest: build_all
cleantest: all
$(TESTRUNNER) $(TESTOPTS) --cleanup

# Run a basic set of regression tests.
Expand Down Expand Up @@ -1688,14 +1690,14 @@ testuniversal: @DEF_MAKE_RULE@ platform

# Like testall, but with only one pass and without multiple processes.
# Run an optional script to include information about the build environment.
buildbottest: build_all platform
buildbottest: all platform
-@if which pybuildbot.identify >/dev/null 2>&1; then \
pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
fi
$(TESTRUNNER) -j 1 -u all -W --slowest --fail-env-changed --timeout=$(TESTTIMEOUT) $(TESTOPTS)

pythoninfo: build_all
$(RUNSHARED) ./$(BUILDPYTHON) -m test.pythoninfo
pythoninfo: all
$(RUNSHARED) $(HOSTRUNNER) ./$(BUILDPYTHON) -m test.pythoninfo

QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
test_multibytecodec test_urllib2_localnet test_itertools \
Expand All @@ -1708,10 +1710,10 @@ quicktest: @DEF_MAKE_RULE@ platform

# SSL tests
.PHONY: multisslcompile multissltest
multisslcompile: build_all
multisslcompile: all
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py --steps=modules

multissltest: build_all
multissltest: all
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py

install: @FRAMEWORKINSTALLFIRST@ commoninstall bininstall maninstall @FRAMEWORKINSTALLLAST@
Expand Down Expand Up @@ -1983,7 +1985,7 @@ TESTSUBDIRS= ctypes/test \
unittest/test unittest/test/testmock

TEST_MODULES=@TEST_MODULES@
libinstall: build_all $(srcdir)/Modules/xxmodule.c
libinstall: all $(srcdir)/Modules/xxmodule.c
@for i in $(SCRIPTDIR) $(LIBDEST); \
do \
if test ! -d $(DESTDIR)$$i; then \
Expand Down
19 changes: 19 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,18 @@ if test "$cross_compiling" = yes; then
RUNSHARED=
fi

AC_ARG_VAR([HOSTRUNNER], [Program to run CPython for the host platform])
AC_MSG_CHECKING([HOSTRUNNER])
if test -z "$HOSTRUNNER"
then
AS_CASE([$ac_sys_system/$ac_sys_emscripten_target],
[Emscripten/node*], [HOSTRUNNER='node'],
emmatyping marked this conversation as resolved.
Show resolved Hide resolved
[HOSTRUNNER='']
)
fi
AC_SUBST([$HOSTRUNNER])
AC_MSG_RESULT([$HOSTRUNNER])

AC_MSG_RESULT($LDLIBRARY)

# LIBRARY_DEPS, LINK_PYTHON_OBJS and LINK_PYTHON_DEPS variable
Expand Down