mason
mason copied to clipboard
Maintaining boost cxx11abi packages
@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:
- [ ] Does the boost new release script work? https://github.com/mapbox/mason/blob/master/utils/new_boost.sh
- [ ] Other existing cxx11abi packages need be ported to be built on travis (rather than manually pushed) (notably gtest - refs https://github.com/mapbox/mason/pull/209)
- [ ] Do we want to maintain cxx11abi packages for all boost libraries?
@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?
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 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:
- trusty packages of libstdc++ don't disable
GLIBCXX_USE_DUAL_ABI
(like the precise packages) and... - travis trusty
sudo:false
machines get their whitelisted packages finished by the travis team - refs https://github.com/travis-ci/apt-package-whitelist/issues/3597
Other alternatives could be:
- Package libstdc++ in mason to avoid being burned by the ubuntu-toolchain-r default of disabling
GLIBCXX_USE_DUAL_ABI