#64563 closed defect (fixed)
MyPaint @2.0.1: fatal error: 'future' file not found on 10.7/10.8
Reported by: | evanmiller (Evan Miller) | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.1 |
Keywords: | lion mountainlion | Cc: | |
Port: | MyPaint |
Description
Failing buildbots:
https://build.macports.org/builders/ports-10.7_x86_64-builder/builds/84319
https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/76171
Interestingly, the 10.6 build succeeds.
Change History (13)
comment:1 follow-ups: 2 7 Changed 3 years ago by jmroot (Joshua Root)
comment:2 follow-up: 3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to jmroot:
It's also building C++ code using
configure.cc
and seems to be ignoring CXXFLAGS
Unfortunately this is how setuputils/distutils works (i.e. it doesn't work). For a time I tried to get the developers of setuputils/distutils to acknowledge and fix this but nobody seemed to care.
Maybe pep517 fixes all this but I don't understand pep517 well enough to switch any ports to using it.
comment:3 Changed 3 years ago by jmroot (Joshua Root)
Replying to ryandesign:
Replying to jmroot:
It's also building C++ code using
configure.cc
and seems to be ignoring CXXFLAGSUnfortunately this is how setuputils/distutils works (i.e. it doesn't work). For a time I tried to get the developers of setuputils/distutils to acknowledge and fix this but nobody seemed to care.
Yes, hence the workaround.
Maybe pep517 fixes all this but I don't understand pep517 well enough to switch any ports to using it.
PEP 517 doesn't define how the actual building is to be done, that's up to the back end, which in this case is still setuptools. Please do switch to using python.pep517 yes
whenever possible anyway; I have no idea how long we have before setup.py install
is disabled in setuptools entirely. Setting the option should be all that's needed in most cases as long as you're not using any python versions older than 3.6.
comment:4 Changed 3 years ago by evanmiller (Evan Miller)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:5 follow-up: 6 Changed 3 years ago by evanmiller (Evan Miller)
Hmm, fixed on 10.7 but still broken on 10.8:
https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/79908
Is MacPorts mistaken about the system clang's C++11 support?
comment:6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to evanmiller:
Is MacPorts mistaken about the system clang's C++11 support?
I don't think so. With a small test program that includes <future>
, I am able to reproduce the error if I do not use -stdlib=libc++
, and when I do use -stdlib=libc++
then the problem goes away. This tells us that the build is not using this flag, even though it should.
It is difficult to tell for sure what the build is doing because the build system uses silent rules and I do not know how to make it use verbose rules. I do not know enough about python build systems to know if that is even possible. Without this, I cannot know for certain which compiler is actually being used or with which arguments it is being run.
comment:7 follow-up: 8 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
It's probably exactly what Josh said above:
Replying to jmroot:
It's also building C++ code using
configure.cc
and seems to be ignoring CXXFLAGS, so it may also need the workaround used by e.g. py-re2 in order to use the right stdlib.
The workaround in py-re2 is to set configure.cc
to the C++ compiler, which is terrible but since setuptools/distutils is terrible I don't know that there's a better option. py-re2, for the record, still doesn't use CXXFLAGS, so it too fails to build on 10.8.
The reason why these ports are able to build on 10.7 and earlier may be that they use a MacPorts clang compiler on those OS versions, and unlike Xcode clang compilers which default to libstdc++ on 10.8 and earlier, MacPorts clang compilers default to libc++.
comment:8 Changed 3 years ago by jmroot (Joshua Root)
Replying to ryandesign:
The workaround in py-re2 is to set
configure.cc
to the C++ compiler, which is terrible but since setuptools/distutils is terrible I don't know that there's a better option. py-re2, for the record, still doesn't use CXXFLAGS, so it too fails to build on 10.8.
It does fail, but I'm not sure if that's the reason. The stdlib flag should be added via the compiler wrapper:
DEBUG: compiler_wrapper: -> Comp Flags: Will embed ' -Os -stdlib=libc++' in cxx wrapper script
comment:9 follow-up: 13 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
It is why it fails. compiler_wrapper does embed -stdlib=libc++
in the cxx wrapper script but it does not embed -stdlib=libc++
in the cc wrapper script, which is the one that's being used for py-re2.
comment:10 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
$ diff -u work/compwrap/cc/usr/bin/clang++ work/compwrap/cxx/usr/bin/clang++ --- work/compwrap/cc/usr/bin/clang++ 2022-02-08 15:48:23.000000000 -0600 +++ work/compwrap/cxx/usr/bin/clang++ 2022-02-08 15:48:23.000000000 -0600 @@ -1,3 +1,3 @@ #!/bin/bash export CCACHE_DIR=/opt/local/var/macports/build/.ccache -exec /opt/local/bin/ccache /usr/bin/clang++ -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -pipe ${MACPORTS_LEGACY_SUPPORT_CPPFLAGS} "${@}" +exec /opt/local/bin/ccache /usr/bin/clang++ -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -pipe ${MACPORTS_LEGACY_SUPPORT_CPPFLAGS} "${@}"
comment:11 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
I think this would work:
configure.cc ${configure.cxx} {*}${configure.cxxflags}
Is there a better solution?
comment:12 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
configure.cc ${configure.cxx} configure.cflags {*}${configure.cxxflags}
comment:13 Changed 3 years ago by jmroot (Joshua Root)
Replying to ryandesign:
compiler_wrapper does embed
-stdlib=libc++
in the cxx wrapper script but it does not embed-stdlib=libc++
in the cc wrapper script, which is the one that's being used for py-re2.
Oh. That's even less useful than I thought then.
<future>
is a C++11 thing, so the port probably needs to set compiler.cxx_standard accordingly. It's also building C++ code usingconfigure.cc
and seems to be ignoring CXXFLAGS, so it may also need the workaround used by e.g. py-re2 in order to use the right stdlib.