Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#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

Change History (13)

comment:1 Changed 2 years ago by jmroot (Joshua Root)

<future> is a C++11 thing, so the port probably needs to set compiler.cxx_standard accordingly. 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.

comment:2 in reply to:  1 ; Changed 2 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 in reply to:  2 Changed 2 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 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.

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 2 years ago by evanmiller (Evan Miller)

Resolution: fixed
Status: assignedclosed

In 6370d23d2e877fb2de7d82bb4a02e721b7a458e1/macports-ports (master):

MyPaint: require C++11

Closes: #64563

comment:5 Changed 2 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 in reply to:  5 Changed 2 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 in reply to:  1 ; Changed 2 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 in reply to:  7 Changed 2 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 Changed 2 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 2 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 2 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 2 years ago by ryandesign (Ryan Carsten Schmidt)

configure.cc    ${configure.cxx}
configure.cflags {*}${configure.cxxflags}

comment:13 in reply to:  9 Changed 2 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.

Note: See TracTickets for help on using tickets.