Skip to content

Commit ada763b

Browse files
jagermanwjakob
authored andcommitted
Temporary gcc travis-ci build fixes
Recent gcc snapshots (both gcc 7 snapshots and recent gcc 6 stable branch snapshots) are triggering an upstream gcc bug when -flto is enabled (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79296). This has been hitting the gcc-7 builds for a while now, but is going to start hitting the debian testing builds in a few days as well. The issue is triggered by using -flto in combination with structs or classes declared in a function, as done in test_alias_initialization, test_isses, test_methods_and_attributes (and possibly more). I'm subscribed to the upstream bug, and will submit another PR to reenable LTO once a fixed gcc is available. The gcc-7 build also generates some warnings; just ignore them for now (by turning off -Werror).
1 parent c137c0a commit ada763b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,18 @@ before_install:
9696
fi
9797
if [ -n "$DOCKER" ]; then
9898
docker pull $DOCKER
99+
# Disable LTO with gcc until gcc 79296 is fixed:
100+
export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DPYBIND11_LTO_CXX_FLAGS="
99101
export containerid=$(docker run --detach --tty \
100102
--volume="$PWD":/pybind11 --workdir=/pybind11 \
103+
--env="CXXFLAGS=$CXXFLAGS" \
101104
--env="CC=$CC" --env="CXX=$CXX" --env="DEBIAN_FRONTEND=$DEBIAN_FRONTEND" \
102105
--env=GCC_COLORS=\ \
103106
$DOCKER)
104107
docker exec --tty "$containerid" sh -c 'for s in 0 15; do sleep $s; apt-get update && apt-get -qy dist-upgrade && break; done'
105108
export SCRIPT_RUN_PREFIX="docker exec --tty $containerid"
109+
# gcc-7 currently generates warnings; some are upstream bugs, so just turn off -Werror for now
110+
if [ "$GCC" = "7" ]; then WERROR=off; fi
106111
else
107112
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
108113
pip install --user --upgrade pip virtualenv
@@ -138,7 +143,7 @@ script:
138143
- $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS}
139144
-DPYBIND11_PYTHON_VERSION=$PYTHON
140145
-DPYBIND11_CPP_STANDARD=$CPP
141-
-DPYBIND11_WERROR=ON
146+
-DPYBIND11_WERROR=${WERROR:-ON}
142147
- $SCRIPT_RUN_PREFIX make pytest -j 2
143148
- $SCRIPT_RUN_PREFIX make test_cmake_build
144149
after_failure: cat tests/test_cmake_build/*.log

0 commit comments

Comments
 (0)