diff --git a/Lib/test/test_tools/test_freeze.py b/Lib/test/test_tools/test_freeze.py index 671ec2961e7f8f..780179170cb62b 100644 --- a/Lib/test/test_tools/test_freeze.py +++ b/Lib/test/test_tools/test_freeze.py @@ -14,7 +14,6 @@ @support.requires_zlib() @unittest.skipIf(sys.platform.startswith('win'), 'not supported on Windows') -@support.skip_if_buildbot('not all buildbots have enough space') # gh-103053: Skip test if Python is built with Profile Guided Optimization # (PGO), since the test is just too slow in this case. @unittest.skipIf(support.check_cflags_pgo(), diff --git a/Makefile.pre.in b/Makefile.pre.in index f1f5c8557e7ffc..2851b65faa5a16 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -783,7 +783,16 @@ clinic-tests: check-clean-src $(srcdir)/Lib/test/clinic.test.c # Build the interpreter $(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS) - $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) + echo "BUILDPYTHON: run $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)" + @ # Use -o $(BUILDPYTHON) instead of -o $@ to write the program in the + @ # build directory instead of the source directory with FreeBSD make + @ # (gh-103053). + $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $(BUILDPYTHON) Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) + echo "BUILDPYTHON: BUILDPYTHON=$(BUILDPYTHON) target=$@" + echo "BUILDPYTHON: built successfully" + echo "BUILDPYTHON: pwd" + pwd + echo "BUILDPYTHON: --" platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform @@ -797,12 +806,18 @@ platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt # or removed in case of failure. pybuilddir.txt: $(PYTHON_FOR_BUILD_DEPS) @echo "none" > ./pybuilddir.txt + echo "[pybuilddir.txt] ls" + ls + echo "[pybuilddir.txt] pwd" + pwd + echo "[pybuilddir.txt] RUN: $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars" $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\ if test $$? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi + echo "[pybuilddir.txt]--" # blake2s is auto-generated from blake2b $(srcdir)/Modules/_blake2/blake2s_impl.c: $(srcdir)/Modules/_blake2/blake2b_impl.c $(srcdir)/Modules/_blake2/blake2b2s.py diff --git a/Tools/freeze/test/freeze.py b/Tools/freeze/test/freeze.py index 9030ad4d4e5f93..82ff79db198e4d 100644 --- a/Tools/freeze/test/freeze.py +++ b/Tools/freeze/test/freeze.py @@ -27,8 +27,17 @@ class UnsupportedError(Exception): """The operation isn't supported.""" +def _run(cmd, cwd=None): + print('+', shlex.join(cmd), flush=True) + return subprocess.run( + cmd, + cwd=cwd, + check=True, + ) + + def _run_quiet(cmd, cwd=None): - #print(f'# {" ".join(shlex.quote(a) for a in cmd)}') + print('+', shlex.join(cmd), flush=True) try: return subprocess.run( cmd, @@ -44,7 +53,7 @@ def _run_quiet(cmd, cwd=None): print(err.stdout) print("--- STDERR ---") print(err.stderr) - print("---- END ----") + print("---- END ----", flush=True) raise @@ -125,7 +134,16 @@ def prepare(script=None, outdir=None): ensure_opt(cmd, 'cache-file', os.path.join(outdir, 'python-config.cache')) prefix = os.path.join(outdir, 'python-installation') ensure_opt(cmd, 'prefix', prefix) - _run_quiet(cmd, builddir) + _run(cmd, builddir) + + # Dump Makefile + build_Makefile = os.path.join(builddir, 'Makefile') + with open(build_Makefile, encoding="utf8", errors="backslashreplace") as fp: + content = fp.read() + print("Makefile") + print("--") + print(content) + print("--") if not MAKE: raise UnsupportedError('make')