-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
py313-mypy: fix compilation on OS X <= 10.9 #26719
base: master
Are you sure you want to change the base?
py313-mypy: fix compilation on OS X <= 10.9 #26719
Conversation
Notifying maintainers: |
@erikbs If the code uses C11 now, it should declare |
I tried, but that did not work. Do I need to add a special port group? |
@erikbs It could be a special case for that clang (no idea on that), but if C11 is required, it is still better to declare that, even if blacklist is needed for clangs regardless. |
I believe that |
Once #26830 is merged, we will not need per-port requirement for C11 with Python 3.13. |
@barracuda156 Is this working now? (Without changes to the mypy port.) |
@tobypeterson |
I still cannot build |
But does it work with other Python ports for you? In other cases do you get the correct compiler picked? |
I picked a random Python 3.13 port and installed it from source: |
@erikbs Ok, it does not work now indeed. There is no problem on your end, |
My first comment today was not correct. A few weeks have passed, so I forgot the details. The correct description is that the chosen compiler is C11 compatible, but it does not enable C11 by default. As an experiment, I added Then I tried
The compiler blacklist PortGroup is sourced multiple times. Note that once the incompatible compiler passes because the blacklist pattern is only clang < 500. I have no idea where these blacklist entries come from – in The goal must be either to make MacPorts use a Clang version that defaults to C>=11 or somehow make MacPorts pass |
Someone has to look into why it does not work as expected, but anyway, it should be fixed in the portgroup, not in a given port (as long as requirements match). Commit history does not have anything immediately obvious. Maybe the change of python313 to the default one affected how options are processed? |
I agree. And I think that there are two things that need to be fixed:
|
It is not ignored if added into portfile (or already present there). What seems to have broken is adding it via PG automatically for py313 subports. |
It was ignored when I added |
An interesting observation: I can make MacPorts honour Setup:
Now I install using I only have experience with Tcl scripting through MacPorts and do not really know the language, so I do not know the difference between - compiler.c_standard 2011
+ set compiler.c_standard 2011 This makes MacPorts honour I also discovered that if I set @barracuda156 Any ideas? |
@jmroot @ryandesign Could someone comment on this, please? You know MacPorts base much better. |
* Set c_standard 2011 * Blacklist old Clang versions
384dd7a
to
b1f6e26
Compare
Attaching the complete build log, in case that helps: main.log |
My understanding after reading that thread is that it is intentional that compiler.c_standard 2011
configure.cflags -std=c11
python.add_cflags yes With this I can build |
Description
Build failed on 10.9 because the code uses C11 features, but AppleClang 600 (provided by Xcode 6.2, the latest available version on 10.9) defaults to an earlier dialect. It issues a warning, which turns into an error because of compiler flags. Clang 3.6, upon which AppleClang 602 (from Xcode 6.3, which requires OS X 10.10) is based, switched to C11 as its default dialect. Setting
compiler.c_standard 2011
did not seem to set the correct flags to fix the problem, so the easiest solution was to blacklist Clang < 602. This causes MacPorts to pick a newer compiler, MacPorts Clang 17 in my case, and the build succeeds.Type(s)
Tested on
macOS 10.9.5 13F1911 x86_64
Xcode 6.2 6C131e
Verification
Have you
port lint --nitpick
?sudo port test
?sudo port -vst install
?Tested by running the binaries without options.