Message406988
The FREEZE_MODULE trick fails with out-of-tree builds when SRCDIR contains the frozen_modules header files from a previous build. When doing OOT building, make includes the SRCDIR in the search path for dependencies (VPATH). It considers $(srcdir)/Python/frozen_modules/importlib._bootstrap_external.h as recent enough and therefore does not generate $(builddir)/Python/frozen_modules/importlib._bootstrap_external.h. The freeze_module program does not know about VPATH and looks up the file in the $(builddir) tree:
$ make FREEZE_MODULE=/cpython/builddep/ubuntu-impish-x86_64/Programs/_freeze_module
...
python3.9 ../../Tools/scripts/deepfreeze.py Python/frozen_modules/importlib._bootstrap_external.h -m importlib._bootstrap_external -o Python/deepfreeze/importlib._bootstrap_external.c
Traceback (most recent call last):
File "/cpython/builddep/wasi/../../Tools/scripts/deepfreeze.py", line 463, in <module>
main()
File "/cpython/builddep/wasi/../../Tools/scripts/deepfreeze.py", line 451, in main
with open(args.file, encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'Python/frozen_modules/importlib._bootstrap_external.h'
make: *** [Makefile:1055: Python/deepfreeze/importlib._bootstrap_external.c] Error 1
$ make FREEZE_MODULE=/cpython/builddep/ubuntu-impish-x86_64/Programs/_freeze_module Python/frozen_modules/importlib._bootstrap_external.h
make: '../../Python/frozen_modules/importlib._bootstrap_external.h' is up to date.
I see two possible solutions for the problem:
* extend ``make clean`` to also remove $(FROZEN_FILES_OUT). The make clean command is suppose to remove all files that interferes with OOT builds (see check-clean-src in Makefile.pre.in).
* prefix $(FROZEN_FILES_OUT) and their targets with $(abs_builddir) to avoid VPATH lookups. abs_builddir is the absolute path to the build directory. |
|
Date |
User |
Action |
Args |
2021-11-25 11:25:01 | christian.heimes | set | recipients:
+ christian.heimes, gvanrossum, eric.snow |
2021-11-25 11:25:01 | christian.heimes | set | messageid: <1637839501.04.0.0823297326226.issue45886@roundup.psfhosted.org> |
2021-11-25 11:25:01 | christian.heimes | link | issue45886 messages |
2021-11-25 11:25:00 | christian.heimes | create | |
|