From d97c697f66ecd7e649aea662d33f8d4655077e6c Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 3 Dec 2021 09:42:59 +0100 Subject: [PATCH 1/3] bpo-45582: Fix out-of-tree build issues with new getpath * Create getpath.h in builddir tree instead of srcdir tree * Move getpath.h to Python/frozen_modules so it gets removed on ``make clean`` and to make it more obvious that it is a frozen file. * Add dependency on header files * Remove target body from getpath_noop.o so it uses the ``.c.o:`` template --- Makefile.pre.in | 15 +++++++-------- Modules/getpath.c | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in index 3dc131b6c9651b..264011f226bbc3 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1062,10 +1062,9 @@ FROZEN_FILES_OUT = \ Programs/_freeze_module.o: Programs/_freeze_module.c Makefile Modules/getpath_noop.o: $(srcdir)/Modules/getpath_noop.c Makefile - $(CC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Modules/getpath_noop.c -Programs/_freeze_module: Programs/_freeze_module.o $(LIBRARY_OBJS_OMIT_FROZEN) Modules/getpath_noop.o - $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o $(LIBRARY_OBJS_OMIT_FROZEN) Modules/getpath_noop.o $(LIBS) $(MODLIBS) $(SYSLIBS) +Programs/_freeze_module: Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN) + $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) # BEGIN: freezing modules @@ -1131,11 +1130,11 @@ Python/frozen_modules/frozen_only.h: $(FREEZE_MODULE) Tools/freeze/flag.py # END: freezing modules -Tools/scripts/freeze_modules.py: $(FREEZE_MODULE) - # We manually freeze getpath.py rather than through freeze_modules -Modules/getpath.h: Programs/_freeze_module Modules/getpath.py - Programs/_freeze_module getpath $(srcdir)/Modules/getpath.py $(srcdir)/Modules/getpath.h +Python/frozen_modules/getpath.h: $(FREEZE_MODULE) Modules/getpath.py + $(FREEZE_MODULE) getpath $(srcdir)/Modules/getpath.py Python/frozen_modules/getpath.h + +Tools/scripts/freeze_modules.py: $(FREEZE_MODULE) .PHONY: regen-frozen regen-frozen: Tools/scripts/freeze_modules.py $(FROZEN_FILES_IN) @@ -1177,7 +1176,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \ -o $@ $(srcdir)/Modules/getbuildinfo.c -Modules/getpath.o: $(srcdir)/Modules/getpath.c Modules/getpath.h Makefile +Modules/getpath.o: $(srcdir)/Modules/getpath.c Python/frozen_modules/getpath.h Makefile $(PYTHON_HEADERS) $(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ -DPREFIX='"$(prefix)"' \ -DEXEC_PREFIX='"$(exec_prefix)"' \ diff --git a/Modules/getpath.c b/Modules/getpath.c index 32d5db9d2c4dc2..f66fc8abbd4ffe 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -19,7 +19,7 @@ #endif /* Reference the precompiled getpath.py */ -#include "getpath.h" +#include "../Python/frozen_modules/getpath.h" #if (!defined(PREFIX) || !defined(EXEC_PREFIX) \ || !defined(VERSION) || !defined(VPATH) \ From cfd3a3449dd6ef3e24257adbcc3c95c18d154c4b Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 3 Dec 2021 09:59:33 +0100 Subject: [PATCH 2/3] Remove Modules/getpath.h from .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7e80446d4d4a60..0363244bdaf637 100644 --- a/.gitignore +++ b/.gitignore @@ -74,7 +74,6 @@ Mac/pythonw Misc/python.pc Misc/python-embed.pc Misc/python-config.sh -Modules/getpath.h Modules/Setup.config Modules/Setup.local Modules/Setup.stdlib From cd85c8f89aa8ff11277838dede47edc35c3188c8 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 3 Dec 2021 10:04:03 +0100 Subject: [PATCH 3/3] Attempt to fix Windows builds --- PCbuild/_freeze_module.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCbuild/_freeze_module.vcxproj b/PCbuild/_freeze_module.vcxproj index 7b2df4b8afcc2c..07a6bfdde7402d 100644 --- a/PCbuild/_freeze_module.vcxproj +++ b/PCbuild/_freeze_module.vcxproj @@ -379,7 +379,7 @@ getpath $(IntDir)getpath.g.h - $(PySourcePath)Modules\getpath.h + $(PySourcePath)Python\frozen_modules\getpath.h pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy