Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makesetup can fail on macOS and uses wrong CFLAGS #94404

Closed
tiran opened this issue Jun 29, 2022 · 0 comments
Closed

makesetup can fail on macOS and uses wrong CFLAGS #94404

tiran opened this issue Jun 29, 2022 · 0 comments
Labels
3.11 only security fixes 3.12 bugs and security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@tiran
Copy link
Member

tiran commented Jun 29, 2022

Bug report

The script Modules/makesetup has two issues

  1. It uses sed i command with multiple escapes newlines. The feature works fine in GNU sed but does not work correctly with macOS' BSD sed. @ned-deily found a workaround for the problem. The r command with an external replacement file works correctly on GNU and BSD sed.

  2. makesetup creates wrong compile rules for object files that end up in a shared library. The variables $(CCSHARED) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) are missing some flags like address sanitizer. The script should create rules with $(PY_STDMODULE_CFLAGS) $(CCSHARED) instead.

  3. the order of cflags can break builds. For example macOS ARM64 builds are broken because -I./Modules/_decimal/libmpdec comes after -I/opt/homebrew/include and the buildbot seems to come with an incompatible libmpdec header. Module-specific CFLAGs should come before Python CFLAGs. It is probably easier to move module CFLAGS before PY_STDMODULE_CFLAGS. The homebrew flag comes from PY_CPPFLAGS and CONFIGURE_CPPFLAGS.

@tiran tiran added type-bug An unexpected behavior, bug, or error build The build process and cross-build 3.11 only security fixes 3.12 bugs and security fixes labels Jun 29, 2022
tiran added a commit to tiran/cpython that referenced this issue Jun 29, 2022
``makesetup`` now works around an issue with sed on macOS and uses correct
CFLAGS for object files that end up in a shared extension.
tiran added a commit that referenced this issue Jun 29, 2022
``makesetup`` now works around an issue with sed on macOS and uses correct
CFLAGS for object files that end up in a shared extension.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 29, 2022
…ythonGH-94405)

``makesetup`` now works around an issue with sed on macOS and uses correct
CFLAGS for object files that end up in a shared extension.
(cherry picked from commit 5150cbc)

Co-authored-by: Christian Heimes <christian@python.org>
miss-islington added a commit that referenced this issue Jun 29, 2022
``makesetup`` now works around an issue with sed on macOS and uses correct
CFLAGS for object files that end up in a shared extension.
(cherry picked from commit 5150cbc)

Co-authored-by: Christian Heimes <christian@python.org>
tiran added a commit to tiran/cpython that referenced this issue Jun 29, 2022
``PY_STDMODULE_CFLAGS`` may contain include directories with system
headers. This can break compiling with built-in libmpdec.
tiran added a commit that referenced this issue Jun 29, 2022
``PY_STDMODULE_CFLAGS`` may contain include directories with system
headers. This can break compiling with built-in libmpdec.
tiran added a commit to tiran/cpython that referenced this issue Jun 29, 2022
…ythonGH-94413)

``PY_STDMODULE_CFLAGS`` may contain include directories with system
headers. This can break compiling with built-in libmpdec.
(cherry picked from commit 6485c3c)

Co-authored-by: Christian Heimes <christian@python.org>
tiran added a commit that referenced this issue Jun 29, 2022
…) (GH-94415)

``PY_STDMODULE_CFLAGS`` may contain include directories with system
headers. This can break compiling with built-in libmpdec.
Co-authored-by: Christian Heimes <christian@python.org>
gvanrossum pushed a commit to gvanrossum/cpython that referenced this issue Jun 30, 2022
…ythonGH-94405)

``makesetup`` now works around an issue with sed on macOS and uses correct
CFLAGS for object files that end up in a shared extension.
gvanrossum pushed a commit to gvanrossum/cpython that referenced this issue Jun 30, 2022
…H-94413)

``PY_STDMODULE_CFLAGS`` may contain include directories with system
headers. This can break compiling with built-in libmpdec.
@tiran tiran closed this as completed Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes 3.12 bugs and security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant