Skip to content

Commit f11598b

Browse files
authored
[CI] Add a no-asserts build (#7611)
All our testing has asserts enabled, to catch issues. This adds a build mode for no-asserts, just to catch compile errors like #7610
1 parent a2d01d3 commit f11598b

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,3 +455,23 @@ jobs:
455455
run: |
456456
python check.py --binaryen-bin=out/bin lit
457457
python check.py --binaryen-bin=out/bin gtest
458+
459+
# Ensures we can build in no-asserts mode (just building).
460+
build-noasserts:
461+
name: noasserts
462+
runs-on: ubuntu-latest
463+
steps:
464+
- uses: actions/setup-python@v5
465+
with:
466+
python-version: '3.x'
467+
- uses: actions/checkout@v4
468+
with:
469+
submodules: true
470+
- name: install ninja
471+
run: sudo apt-get install ninja-build
472+
- name: cmake
473+
run: |
474+
mkdir -p out
475+
cmake -S . -B out -G Ninja -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DBYN_ENABLE_ASSERTIONS=OFF
476+
- name: build
477+
run: cmake --build out -v

src/tools/wasm-reduce.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ struct Reducer
974974
return maxSkip > 2;
975975
}
976976

977-
void visitModule(Module* curr) {
977+
void visitModule([[maybe_unused]] Module* curr) {
978978
// The initial module given to us is our global object. As we continue to
979979
// process things here, we may replace the module, so we should never again
980980
// refer to curr.

src/wasm/wasm-binary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ void WasmBinaryWriter::writeNames() {
947947
auto substart =
948948
startSubsection(BinaryConsts::CustomSections::Subsection::NameLocal);
949949
o << U32LEB(functionsWithLocalNames.size());
950-
Index emitted = 0;
950+
[[maybe_unused]] Index emitted = 0;
951951
for (auto& [index, func] : functionsWithLocalNames) {
952952
// Pairs of (local index in IR, name).
953953
std::vector<std::pair<Index, Name>> localsWithNames;

0 commit comments

Comments
 (0)