mapbox / mason

Cross platform package manager for C/C++ apps
BSD 2-Clause "Simplified" License
254 stars 69 forks source link

Maintaining boost cxx11abi packages #319

Open springmeyer opened 7 years ago

springmeyer commented 7 years ago

@tmpsantos (in https://github.com/mapbox/mason/pull/268) has figured out how to build cxx11abi packages for boost libraries on travis 🎉 .

The key is that we need to edit the headers of the libstdc++ installed to enable the "duel API":

sudo perl -i -p -e "s/# define _GLIBCXX_USE_DUAL_ABI 0/# define _GLIBCXX_USE_DUAL_ABI 1/g;" /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h

per https://github.com/mapbox/mason/issues/157#issuecomment-272378928

Then one can set -D_GLIBCXX_USE_CXX11_ABI=1 and it is respected and will no longer default to 0.

Now we need to think through how to keep these maintained.

TODO:

tmpsantos commented 7 years ago

@springmeyer what if we make CXX11ABI the default and we install a newer libc when running tests on the bots so Travis can execute code with CXX11ABI like if it had a newer Linux distro?

jfirebaugh commented 7 years ago

what if we make CXX11ABI the default

I'd love it if we could make that the case.

a newer libc

Did you mean to say "newer libstdc++"?

Also, isn't it not just CI bots but anywhere we deploy a binary that links against libstdc++, that needs to have a version of that library that includes the cxx11abi symbols? Is this going to be an issue? This topic isn't covered by https://github.com/mapbox/cpp#should-i-install-libstdc6-instead-of-libstdc-5-dev.

springmeyer commented 7 years ago

@springmeyer what if we make CXX11ABI the default and we install a newer libc when running tests on the bots so Travis can execute code with CXX11ABI like if it had a newer Linux distro?

I would also like to push for this being the default. The challenge however is that it would force CI bots running on precise to change from being sudo:false to sudo:required so they also could edit the C++ header files to enable -DGLIBCXX_USE_DUAL_ABI=1 per https://github.com/mapbox/mason/pull/268#issuecomment-272380280. And this is not desirable because sudo:required machines boot much slower and are generally less powerful than sudo:false machines. However maybe we could try sudo:false with dist:trusty. This might work if:

Other alternatives could be: