Skip to content

Commit

Permalink
Temporary gcc travis-ci build fixes
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jagerman authored and wjakob committed Feb 14, 2017
1 parent c137c0a commit ada763b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .travis.yml
Expand Up @@ -96,13 +96,18 @@ before_install:
fi
if [ -n "$DOCKER" ]; then
docker pull $DOCKER
# Disable LTO with gcc until gcc 79296 is fixed:
export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DPYBIND11_LTO_CXX_FLAGS="
export containerid=$(docker run --detach --tty \
--volume="$PWD":/pybind11 --workdir=/pybind11 \
--env="CXXFLAGS=$CXXFLAGS" \
--env="CC=$CC" --env="CXX=$CXX" --env="DEBIAN_FRONTEND=$DEBIAN_FRONTEND" \
--env=GCC_COLORS=\ \
$DOCKER)
docker exec --tty "$containerid" sh -c 'for s in 0 15; do sleep $s; apt-get update && apt-get -qy dist-upgrade && break; done'
export SCRIPT_RUN_PREFIX="docker exec --tty $containerid"
# gcc-7 currently generates warnings; some are upstream bugs, so just turn off -Werror for now
if [ "$GCC" = "7" ]; then WERROR=off; fi
else
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
pip install --user --upgrade pip virtualenv
Expand Down Expand Up @@ -138,7 +143,7 @@ script:
- $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS}
-DPYBIND11_PYTHON_VERSION=$PYTHON
-DPYBIND11_CPP_STANDARD=$CPP
-DPYBIND11_WERROR=ON
-DPYBIND11_WERROR=${WERROR:-ON}
- $SCRIPT_RUN_PREFIX make pytest -j 2
- $SCRIPT_RUN_PREFIX make test_cmake_build
after_failure: cat tests/test_cmake_build/*.log
Expand Down

0 comments on commit ada763b

Please sign in to comment.