Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Pass hostrunner as env var so shell expressions are evaluated
  • Loading branch information
tiran committed Jun 10, 2022
commit bbca5c258db3d74c93fce6acc7262d6d96d6d067
4 changes: 3 additions & 1 deletion Tools/scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def main(regrtest_args):
]

cross_compile = '_PYTHON_HOST_PLATFORM' in os.environ
hostrunner = sysconfig.get_config_var("HOSTRUNNER")
hostrunner = os.environ.get("_PYTHON_HOSTRUNNER")
if hostrunner is None:
Comment thread
tiran marked this conversation as resolved.
Outdated
hostrunner = sysconfig.get_config_var("HOSTRUNNER")
if cross_compile:
# emulate -E, but keep PYTHONPATH + cross compile env vars, so
# test executable can load correct sysconfigdata file.
Expand Down
6 changes: 5 additions & 1 deletion configure

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

7 changes: 6 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1492,13 +1492,18 @@ then
dnl TODO: support other WASI runtimes
dnl wasmtime starts the proces with "/" as CWD. For OOT builds add the
dnl directory containing _sysconfigdata to PYTHONPATH.
[WASI/*], [HOSTRUNNER='wasmtime run --env PYTHONPATH=$$(realpath --relative-to $(abs_srcdir) $(abs_builddir))/$$(cat pybuilddir.txt) --mapdir /::$(srcdir) --'],
[WASI/*], [HOSTRUNNER='wasmtime run --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt) --mapdir /::$(srcdir) --'],
[HOSTRUNNER='']
)
fi
AC_SUBST([HOSTRUNNER])
AC_MSG_RESULT([$HOSTRUNNER])

if test -n "$HOSTRUNNER"; then
dnl Pass hostrunner variable as env var in order to expand shell expressions.
PYTHON_FOR_BUILD="_PYTHON_HOSTRUNNER='$HOSTRUNNER' $PYTHON_FOR_BUILD"
fi

AC_MSG_RESULT($LDLIBRARY)

# LIBRARY_DEPS, LINK_PYTHON_OBJS and LINK_PYTHON_DEPS variable
Expand Down