Skip to content

Commit 7842ec0

Browse files
committed
Don't define Rust-related .bc Makefile rules on CI
This avoids the potential for spurious rebuilding in certain situations where the `.bc` files have different created and modified timestamps. Fixes #1801.
1 parent bbdbd5c commit 7842ec0

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

heapster-saw/examples/Makefile

+14-7
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,29 @@ ifeq ($(SAW),)
1616
endif
1717
endif
1818

19+
# If running in GitHub Actions, the $CI environment variable will be defined
20+
# (see https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables)
21+
# and these Makefile rules will not be defined. As a consequence, Make will
22+
# /never/ rebuild .bc files. This ensures that the CI will always test the .bc
23+
# files that were checked into version control. (See #1801 for an example of
24+
# what can go wrong if CI rebuilds .bc files with different compilers from what
25+
# were used to originally produce them.)
1926
ifeq ($(CI),)
2027
%.bc: %.c
2128
clang -emit-llvm -g -c $<
22-
endif
23-
24-
%_gen.v: %.saw %.bc
25-
$(SAW) $<
2629

27-
xor_swap_rust.bc: xor_swap_rust.rs
30+
xor_swap_rust.bc: xor_swap_rust.rs
2831
rustc --crate-type=lib --emit=llvm-bc xor_swap_rust.rs
2932

30-
rust_data.bc: rust_data.rs
33+
rust_data.bc: rust_data.rs
3134
rustc --crate-type=lib --emit=llvm-bc rust_data.rs
3235

33-
rust_lifetimes.bc: rust_lifetimes.rs
36+
rust_lifetimes.bc: rust_lifetimes.rs
3437
rustc --crate-type=lib --emit=llvm-bc rust_lifetimes.rs
38+
endif
39+
40+
%_gen.v: %.saw %.bc
41+
$(SAW) $<
3542

3643
# Lists all the Mr Solver tests, without their ".saw" suffix
3744
MR_SOLVER_TESTS = # arrays_mr_solver linked_list_mr_solver sha512_mr_solver

0 commit comments

Comments
 (0)