Skip to content

Commit

Permalink
Merge pull request #2544 from cloudflare/npaun/werror
Browse files Browse the repository at this point in the history
Do not allow code with warnings to pass CI
  • Loading branch information
npaun authored Aug 19, 2024
2 parents b601ea6 + 97dc005 commit c1f8e1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ build --@dawn//src/tint:tint_build_wgsl_writer=True
# Our dependencies (ICU, zlib, etc.) produce a lot of these warnings, so we disable them. Depending
# on the clang version, zlib either produces warnings for -Wdeprecated-non-prototype or does not
# have that option, so disable -Wunknown-warning-option there too.
build --per_file_copt='external@-Wno-error'
build --per_file_copt='external/v8@-Wno-deprecated-declarations'
build --per_file_copt='external/com_googlesource_chromium_icu@-Wno-ambiguous-reversed-operator,-Wno-deprecated-declarations'
build --host_per_file_copt='external/com_googlesource_chromium_icu@-Wno-ambiguous-reversed-operator,-Wno-deprecated-declarations'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ jobs:
sudo apt-get install -y --no-install-recommends clang-16 lld-16 libunwind-16 libc++abi1-16 libc++1-16 libc++-16-dev libclang-rt-16-dev
echo "build:linux --action_env=CC=/usr/lib/llvm-16/bin/clang --action_env=CXX=/usr/lib/llvm-16/bin/clang++" >> .bazelrc
echo "build:linux --host_action_env=CC=/usr/lib/llvm-16/bin/clang --host_action_env=CXX=/usr/lib/llvm-16/bin/clang++" >> .bazelrc
echo "build:linux --copt='-Werror'" >> .bazelrc
echo "build:linux --copt='-Wno-error=#warnings'" >> .bazelrc
echo "build:linux --copt='-Wno-error=deprecated-declarations'" >> .bazelrc
sed -i -e "s%llvm-symbolizer%/usr/lib/llvm-16/bin/llvm-symbolizer%" .bazelrc
- name: Setup macOS
if: matrix.os.name == 'macOS'
Expand Down
3 changes: 2 additions & 1 deletion src/workerd/io/worker.c++
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,8 @@ Worker::Worker(kj::Own<const Script> scriptParam,
}
KJ_CASE_ONEOF(limitError, kj::Exception) { }
}
}
} else {} // Added to suppress a compiler warning

startupMetrics->done();
} catch (const kj::Exception& e) {
lock.throwException(kj::cp(e));
Expand Down

0 comments on commit c1f8e1c

Please sign in to comment.