Skip to content

Commit 0beba8a

Browse files
authored
Upgrade Travis CI system (#2252)
This upgrades the OS in the Travis CI to Bionic and GCC version to 7. This also fixes a bug that COMPILER_FLAGS was not correctly added at build time in gcc tests. Somehow this bug hasn't manifested so far, but after upgrading, this failed thread sanitizer tests because -fsanitize=thread was added only at link time and not in build time.
1 parent 00d02f7 commit 0beba8a

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
sudo: false
2-
dist: trusty
2+
dist: bionic
33
language: cpp
44

55
stages:
@@ -64,7 +64,7 @@ jobs:
6464
- ./scripts/gen-s-parser.py | diff src/gen-s-parser.inc -
6565
- BUILD_SUBDIR=${BUILD_SUBDIR:-.}
6666
- mkdir -p ${BUILD_SUBDIR} && cd ${BUILD_SUBDIR}
67-
- cmake ${TRAVIS_BUILD_DIR} -DCMAKE_C_FLAGS="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS="$COMPILER_FLAGS" -DCMAKE_INSTALL_PREFIX=install -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
67+
- cmake ${TRAVIS_BUILD_DIR} -DCMAKE_C_FLAGS="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS="$COMPILER_FLAGS" -DCMAKE_EXE_LINKER_FLAGS="$LINKER_FLAGS" -DCMAKE_INSTALL_PREFIX=install -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
6868
# clang-tidy-diff.sh may not exist when BUILD_SUBDIR is a subdirectory
6969
- if [ -f clang-tidy-diff.sh ]; then ./clang-tidy-diff.sh; fi
7070
- make -j2 install
@@ -87,13 +87,14 @@ jobs:
8787
- <<: *test-ubuntu
8888
env: |
8989
COMPILER_FLAGS="-fsanitize=thread"
90+
LINKER_FLAGS="-fsanitize=thread"
9091
91-
# Build with gcc 5 and run tests on the host system (Ubuntu).
92+
# Build with gcc 7 and run tests on the host system (Ubuntu).
9293
- <<: *test-ubuntu
9394
compiler: gcc
9495
env: |
95-
CC="gcc-5"
96-
CXX="g++-5"
96+
CC="gcc-7"
97+
CXX="g++-7"
9798
9899
# Build the .js outputs using emcc
99100
- &test-emcc

check.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ def run_gcc_tests():
482482
'-I' + os.path.join(options.binaryen_root, 'src'), '-g', '-L' + libpath, '-pthread']
483483
if src.endswith('.cpp'):
484484
extra += ['-std=c++11']
485+
if os.environ.get('COMPILER_FLAGS'):
486+
for f in os.environ.get('COMPILER_FLAGS').split(' '):
487+
extra.append(f)
485488
print 'build: ', ' '.join(extra)
486489
subprocess.check_call(extra)
487490
# Link against the binaryen C library DSO, using an executable-relative rpath

0 commit comments

Comments
 (0)