Skip to content

Commit 512dbf6

Browse files
authored
Fix out-of-tree build support for multissltest (GH-29694)
1 parent 718cee0 commit 512dbf6

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Makefile.pre.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -1709,10 +1709,10 @@ quicktest: @DEF_MAKE_RULE@ platform
17091709
# SSL tests
17101710
.PHONY: multisslcompile multissltest
17111711
multisslcompile: build_all
1712-
$(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py --steps=modules
1712+
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py --steps=modules
17131713

17141714
multissltest: build_all
1715-
$(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py
1715+
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py
17161716

17171717
install: @FRAMEWORKINSTALLFIRST@ commoninstall bininstall maninstall @FRAMEWORKINSTALLLAST@
17181718
if test "x$(ENSUREPIP)" != "xno" ; then \

Tools/ssl/multissltests.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,10 @@ class AbstractBuilder(object):
153153
install_target = 'install'
154154
jobs = os.cpu_count()
155155

156-
module_files = ("Modules/_ssl.c",
157-
"Modules/_hashopenssl.c")
156+
module_files = (
157+
os.path.join(PYTHONROOT, "Modules/_ssl.c"),
158+
os.path.join(PYTHONROOT, "Modules/_hashopenssl.c"),
159+
)
158160
module_libs = ("_ssl", "_hashlib")
159161

160162
def __init__(self, version, args):
@@ -357,7 +359,7 @@ def recompile_pymods(self):
357359
env["LD_RUN_PATH"] = self.lib_dir
358360

359361
log.info("Rebuilding Python modules")
360-
cmd = [sys.executable, "setup.py", "build"]
362+
cmd = [sys.executable, os.path.join(PYTHONROOT, "setup.py"), "build"]
361363
self._subprocess_call(cmd, env=env)
362364
self.check_imports()
363365

@@ -372,7 +374,11 @@ def check_pyssl(self):
372374

373375
def run_python_tests(self, tests, network=True):
374376
if not tests:
375-
cmd = [sys.executable, 'Lib/test/ssltests.py', '-j0']
377+
cmd = [
378+
sys.executable,
379+
os.path.join(PYTHONROOT, 'Lib/test/ssltests.py'),
380+
'-j0'
381+
]
376382
elif sys.version_info < (3, 3):
377383
cmd = [sys.executable, '-m', 'test.regrtest']
378384
else:

0 commit comments

Comments
 (0)