-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
static_assert undefined (with C11 compiler) on macOS <= 10.10 #99069
Comments
Isn't MacOS 10.10 unsupported since 2017? |
Several platforms don't define the static_assert macro despite having compiler support for the _Static_assert keyword. The macro needs to be defined since it is used unconditionally in the Python code. So it should always be safe to define it if undefined and not in C++11 (or later) mode. Hence, remove the checks for particular platforms or libc versions, and just define static_assert anytime it needs to be defined but isn't. That way, all platforms that need the fix will get it, regardless of whether someone specifically thought of them. Also document that certain macOS versions are among the platforms that need this.
By Apple, but there are still many users of older versions of macOS. The python.org macOS installers currently support running on systems back through macOS 10.9 (but the binaries are built on newer versions on macOS so would not see this build error) and the MacPorts project (where this issue originated) supports back to macOS 10.6 and earlier. |
I have no issue on principle with supporting builds on Mac OS X 10.9 even if that's no longer supported by Apple. That being said, it's a question worth asking: how long will we commit to supporting ancient macOS versions with the latest Python? I mean, GH-94766 isn't particularly bad but it's one example of additional maintenance required. For Windows we dropped Windows 7 support not long after it was dropped by Microsoft and the first Windows 7-specific issue arose. There are some complaints about that but it's a somewhat strange requirement: the latest Python version on a very old operating system. For Windows users, we said: hey, Python 3.7 and 3.8 are still supported, use those instead on Windows 7. Maybe at some point we should say the same about 10.9 Mavericks, unsupported since September 2016? Again, there are still-supported versions of Python that you can install on those old operating systems. The question is: should 3.12 keep piling workarounds for it? |
From our (MacPorts) point of view, we're going to be adding these workarounds downstream anyway for a long time to come, so we might as well send them upstream. |
Off-topic for this issue, but we need to start thinking about which OS releases we want to support in the installer. The Xcode 14 release notes mention:
Apple no longer supports deploying to older macOS versions than 10.13 with the latest version of Xcode, while we should use the latest compiler and SDK to get best performance and access to new APIs. W.r.t. this particular issue I don't mind adding a workaround for this given that a similar workaround is present for FreeBSD. |
WRT the dropping of support for older macOS releases in the latest Xcode/CLT, I plan to provide a new installer variant for 3.12 pre-releases that will use the latest tools. More to follow after alpha 2. |
Several platforms don't define the static_assert macro despite having compiler support for the _Static_assert keyword. The macro needs to be defined since it is used unconditionally in the Python code. So it should always be safe to define it if undefined and not in C++11 (or later) mode. Hence, remove the checks for particular platforms or libc versions, and just define static_assert anytime it needs to be defined but isn't. That way, all platforms that need the fix will get it, regardless of whether someone specifically thought of them. Also document that certain macOS versions are among the platforms that need this.
Pinging as per the dev guide since the PR has been awaiting review for over a month. |
Several platforms don't define the static_assert macro despite having compiler support for the _Static_assert keyword. The macro needs to be defined since it is used unconditionally in the Python code. So it should always be safe to define it if undefined and not in C++11 (or later) mode. Hence, remove the checks for particular platforms or libc versions, and just define static_assert anytime it needs to be defined but isn't. That way, all platforms that need the fix will get it, regardless of whether someone specifically thought of them. Also document that certain macOS versions are among the platforms that need this. The C2x draft (currently expected to become C23) makes static_assert a keyword to match C++. So only define the macro for up to C17. Co-authored-by: Victor Stinner <vstinner@python.org>
Several platforms don't define the static_assert macro despite having compiler support for the _Static_assert keyword. The macro needs to be defined since it is used unconditionally in the Python code. So it should always be safe to define it if undefined and not in C++11 (or later) mode. Hence, remove the checks for particular platforms or libc versions, and just define static_assert anytime it needs to be defined but isn't. That way, all platforms that need the fix will get it, regardless of whether someone specifically thought of them. Also document that certain macOS versions are among the platforms that need this. The C2x draft (currently expected to become C23) makes static_assert a keyword to match C++. So only define the macro for up to C17. (cherry picked from commit 96e1901) Co-authored-by: Joshua Root <jmr@macports.org> Co-authored-by: Victor Stinner <vstinner@python.org>
Several platforms don't define the static_assert macro despite having compiler support for the _Static_assert keyword. The macro needs to be defined since it is used unconditionally in the Python code. So it should always be safe to define it if undefined and not in C++11 (or later) mode. Hence, remove the checks for particular platforms or libc versions, and just define static_assert anytime it needs to be defined but isn't. That way, all platforms that need the fix will get it, regardless of whether someone specifically thought of them. Also document that certain macOS versions are among the platforms that need this. The C2x draft (currently expected to become C23) makes static_assert a keyword to match C++. So only define the macro for up to C17. (cherry picked from commit 96e1901) Co-authored-by: Joshua Root <jmr@macports.org> Co-authored-by: Victor Stinner <vstinner@python.org>
Several platforms don't define the static_assert macro despite having compiler support for the _Static_assert keyword. The macro needs to be defined since it is used unconditionally in the Python code. So it should always be safe to define it if undefined and not in C++11 (or later) mode. Hence, remove the checks for particular platforms or libc versions, and just define static_assert anytime it needs to be defined but isn't. That way, all platforms that need the fix will get it, regardless of whether someone specifically thought of them. Also document that certain macOS versions are among the platforms that need this. The C2x draft (currently expected to become C23) makes static_assert a keyword to match C++. So only define the macro for up to C17. Co-authored-by: Victor Stinner <vstinner@python.org>
Several platforms don't define the static_assert macro despite having compiler support for the _Static_assert keyword. The macro needs to be defined since it is used unconditionally in the Python code. So it should always be safe to define it if undefined and not in C++11 (or later) mode. Hence, remove the checks for particular platforms or libc versions, and just define static_assert anytime it needs to be defined but isn't. That way, all platforms that need the fix will get it, regardless of whether someone specifically thought of them. Also document that certain macOS versions are among the platforms that need this. The C2x draft (currently expected to become C23) makes static_assert a keyword to match C++. So only define the macro for up to C17. Co-authored-by: Victor Stinner <vstinner@python.org>
I believe this last patch #103282 is what makes build to fail on ARMv5 using gcc 4.6.4. This was working previously with Python 3.11.3 and fails since 3.11.4. Here's my related PR to build Python 3.10 and 3.11 pacakges for Synology linux NAS EDIT: Confirmed, now having a revert patch for that specific arch armv5. SynoCommunity/spksrc@8ca07f5 |
Relying on |
Bug report
Python 3.11 fails to build on macOS 10.10 because
static_assert
is not defined by the libc headers, even when using a C11 compiler. A workaround like the one in place for FreeBSD is needed.Your environment
The text was updated successfully, but these errors were encountered: