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

python PortGroup: require C11 with py313 packages due to atomics requirement, adjust a few subports #26830

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions _resources/port1.0/group/python-1.0.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ proc python_set_versions {option action args} {
lappend pycxxflags -isysroot${configure.sysroot}
lappend pyobjcflags -isysroot${configure.sysroot}
}
# Only needed for Python 3.12, since later require C11.
if {${python.version} == 312} {
# python3.12/internal/pycore_frame.h:134: error:
# ‘for’ loop initial declaration used outside C99 mode
if {[string match *gcc-4.* ${configure.compiler}]} {
python.add_cflags yes
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this does anything, since add_cflags is checked earlier in this method.

lappend pycflags -std=c99
}
}
if {$pycflags ne ""} {
build.env-append CFLAGS=[join $pycflags]
}
Expand Down Expand Up @@ -368,6 +377,13 @@ proc python_add_dependencies {} {
} else {
depends_lib-delete port:python${python.version}
depends_lib-append port:python${python.version}
if {${python.version} >= 313} {
# Python 3.13 uses atomics, which is not supported in old Xcode compilers.
# Python.framework/Versions/3.13/include/python3.13/cpython/pyatomic.h:543:4:
# error: #error "no available pyatomic implementation for this platform/compiler"
# error: command '/usr/bin/gcc-4.2' failed with exit code 1
compiler.c_standard 2011
}
if {[option python.pep517]} {
depends_build-delete port:py${python.version}-build
depends_build-append port:py${python.version}-build
Expand Down
5 changes: 0 additions & 5 deletions python/py-acor/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,4 @@ python.versions 311 312 313
if {${name} ne ${subport}} {
depends_lib-append \
port:py${python.version}-numpy

# pyatomic.h: error: #error "no available pyatomic implementation for this platform/compiler"
if {${python.version} > 312} {
compiler.c_standard 2011
}
}
5 changes: 0 additions & 5 deletions python/py-bigfloat/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ if {${name} ne ${subport}} {
build.cmd-prepend CFLAGS=-std=c99
}

# pyatomic.h: error: #error "no available pyatomic implementation for this platform/compiler"
if {${python.version} > 312} {
compiler.c_standard 2011
}

test.run yes
python.test_framework unittest

Expand Down