◐ Shell
clean mode source ↗

bpo-45950: Fix macOS framework builds of _bootstrap_python (GH-29936) by tiran · Pull Request #29936 · python/cpython

@bedevere-bot

🤖 New build scheduled with the buildbot fleet by @tiran for commit 02dc19dd98f2eaa19c2de25eb5a48dec857fa7b1 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@tiran tiran marked this pull request as ready for review

December 6, 2021 14:19

ambv

ambv approved these changes Dec 6, 2021

@tiran tiran changed the title bpo-45950: Attempt to fix macOS builds of _bootstrap_python when usin… bpo-45950: Fix macOS framework builds of _bootstrap_python (GH-29936)

Dec 6, 2021

@tiran tiran deleted the bpo-45950-macos branch

December 6, 2021 16:13

gvanrossum

Comment on lines +1208 to +1217

# like getpath.o with additional -DPY_BOOTSTRAP_PYTHON=1
Modules/getpath_bootstrap.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)"' \
-DVERSION='"$(VERSION)"' \
-DVPATH='"$(VPATH)"' \
-DPLATLIBDIR='"$(PLATLIBDIR)"' \
-DPY_BOOTSTRAP_PYTHON=1 \
-o $@ $(srcdir)/Modules/getpath.c

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be more elegant to have a two-line file named getpath_bootstrap.c using the default .c.o rule?

#define BOOTSTRAP_PYTHON 1
#include "getpath.c"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that the approach is not elegant. getpath.c requires additional macros

#if (!defined(PREFIX) || !defined(EXEC_PREFIX) \
|| !defined(VERSION) || !defined(VPATH) \
|| !defined(PLATLIBDIR))
#error "PREFIX, EXEC_PREFIX, VERSION, VPATH and PLATLIBDIR macros must be defined"
#endif

@tiran tiran mentioned this pull request

May 9, 2022