Skip to content

Commit

Permalink
Deny warnings in rust code globally in CI
Browse files Browse the repository at this point in the history
Use the new environment variable support for `buildbot_steps.yml`
to do this globally instead of having to patch every call,
which is error prone.

Set this variable globally in .travis.yml and appveyor.yml as well.
  • Loading branch information
aneeshusa authored and SimonSapin committed Jan 9, 2018
1 parent d0abd1c commit e9eaadc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ matrix:
- export LLVM_CONFIG=/usr/lib/llvm-3.9/bin/llvm-config - export LLVM_CONFIG=/usr/lib/llvm-3.9/bin/llvm-config
- export CC=gcc-5 CXX=g++-5 - export CC=gcc-5 CXX=g++-5
script: script:
- RUSTFLAGS='-D warnings' ./mach build -d --verbose - ./mach build -d --verbose
- RUSTFLAGS='-D warnings' ./mach test-unit - ./mach test-unit
- ./mach clean - ./mach clean
- RUSTFLAGS='-D warnings' ./mach build-geckolib - ./mach build-geckolib
- RUSTFLAGS='-D warnings' ./mach test-stylo - ./mach test-stylo
- bash etc/ci/lockfile_changed.sh - bash etc/ci/lockfile_changed.sh
cache: cache:
directories: directories:
Expand All @@ -34,7 +34,9 @@ matrix:
before_cache: before_cache:
- ./mach clean-nightlies --keep 2 --force - ./mach clean-nightlies --keep 2 --force
- ./mach clean-cargo-cache --keep 2 --force - ./mach clean-cargo-cache --keep 2 --force
env: CCACHE=/usr/bin/ccache env:
CCACHE=/usr/bin/ccache
RUSTFLAGS=-Dwarnings
addons: addons:
apt: apt:
sources: sources:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: 1.0.{build}
environment: environment:
CCACHE_DIR: "%APPVEYOR_BUILD_FOLDER%\\.ccache" CCACHE_DIR: "%APPVEYOR_BUILD_FOLDER%\\.ccache"
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
# The appveyor image we use has a pretty huge set of things installed... we make the # The appveyor image we use has a pretty huge set of things installed... we make the
# initial PATH something sane so we know what to expect # initial PATH something sane so we know what to expect
PATH: "C:\\windows\\system32;\ PATH: "C:\\windows\\system32;\
Expand Down Expand Up @@ -48,7 +49,6 @@ cache:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))


build_script: build_script:
- set RUSTFLAGS=-D warnings
- mach build -d -v - mach build -d -v
- mach test-unit - mach test-unit


Expand Down
34 changes: 18 additions & 16 deletions etc/ci/buildbot_steps.yml
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,6 @@
env:
RUSTFLAGS: -Dwarnings

mac-rel-wpt1: mac-rel-wpt1:
- ./mach clean-nightlies --keep 3 --force - ./mach clean-nightlies --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release - env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release
Expand Down Expand Up @@ -32,11 +35,11 @@ mac-rel-wpt4:


mac-dev-unit: mac-dev-unit:
- ./mach clean-nightlies --keep 3 --force - ./mach clean-nightlies --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig RUSTFLAGS=-Dwarnings ./mach build --dev - env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --dev
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig RUSTFLAGS=-Dwarnings ./mach test-unit - env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach test-unit
- env ./mach package --dev - ./mach package --dev
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig RUSTFLAGS=-Dwarnings ./mach build-cef - env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build-cef
- env RUSTFLAGS=-Dwarnings ./mach build-geckolib - ./mach build-geckolib
- bash ./etc/ci/lockfile_changed.sh - bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh - bash ./etc/ci/manifest_changed.sh


Expand Down Expand Up @@ -80,13 +83,13 @@ linux-dev:
- ./mach clean-nightlies --keep 3 --force - ./mach clean-nightlies --keep 3 --force
- ./mach test-tidy --no-progress --all - ./mach test-tidy --no-progress --all
- ./mach test-tidy --no-progress --self-test - ./mach test-tidy --no-progress --self-test
- env CC=gcc-5 CXX=g++-5 RUSTFLAGS=-Dwarnings ./mach build --dev - env CC=gcc-5 CXX=g++-5 ./mach build --dev
- env CC=gcc-5 CXX=g++-5 RUSTFLAGS=-Dwarnings ./mach test-unit - env CC=gcc-5 CXX=g++-5 ./mach test-unit
- env ./mach package --dev - ./mach package --dev
- env CC=gcc-5 CXX=g++-5 RUSTFLAGS=-Dwarnings ./mach build-cef - env CC=gcc-5 CXX=g++-5 ./mach build-cef
- env CC=gcc-5 CXX=g++-5 RUSTFLAGS=-Dwarnings ./mach build --dev --no-default-features --features default-except-unstable - env CC=gcc-5 CXX=g++-5 ./mach build --dev --no-default-features --features default-except-unstable
- env RUSTFLAGS=-Dwarnings ./mach build-geckolib - ./mach build-geckolib
- env RUSTFLAGS=-Dwarnings ./mach test-stylo - ./mach test-stylo
- bash ./etc/ci/lockfile_changed.sh - bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh - bash ./etc/ci/manifest_changed.sh
- bash ./etc/ci/check_no_panic.sh - bash ./etc/ci/check_no_panic.sh
Expand Down Expand Up @@ -120,7 +123,7 @@ linux-nightly:


android: android:
- ./mach clean-nightlies --keep 3 --force - ./mach clean-nightlies --keep 3 --force
- env ANDROID_SDK=/home/servo/android/sdk/r25.2.3 RUSTFLAGS=-Dwarnings ./mach build --android --dev - env ANDROID_SDK=/home/servo/android/sdk/r25.2.3 ./mach build --android --dev
- env ANDROID_SDK=/home/servo/android/sdk/r25.2.3 ./mach package --android --dev - env ANDROID_SDK=/home/servo/android/sdk/r25.2.3 ./mach package --android --dev
- bash ./etc/ci/lockfile_changed.sh - bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh - bash ./etc/ci/manifest_changed.sh
Expand All @@ -134,19 +137,18 @@ android-nightly:


arm32: arm32:
- ./mach clean-nightlies --keep 3 --force - ./mach clean-nightlies --keep 3 --force
- env RUSTFLAGS=-Dwarnings ./mach build --rel --target=arm-unknown-linux-gnueabihf - ./mach build --rel --target=arm-unknown-linux-gnueabihf
- bash ./etc/ci/lockfile_changed.sh - bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh - bash ./etc/ci/manifest_changed.sh


arm64: arm64:
- ./mach clean-nightlies --keep 3 --force - ./mach clean-nightlies --keep 3 --force
- env RUSTFLAGS=-Dwarnings ./mach build --rel --target=aarch64-unknown-linux-gnu - ./mach build --rel --target=aarch64-unknown-linux-gnu
- bash ./etc/ci/lockfile_changed.sh - bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh - bash ./etc/ci/manifest_changed.sh


windows-msvc-dev: windows-msvc-dev:
- mach.bat clean-nightlies --keep 3 --force - mach.bat clean-nightlies --keep 3 --force
- set RUSTFLAGS=-D warnings
- mach.bat build --dev - mach.bat build --dev
- mach.bat test-unit - mach.bat test-unit
- mach.bat package --dev - mach.bat package --dev
Expand Down

0 comments on commit e9eaadc

Please sign in to comment.