Nondeterministic CI failures due to Makefile recompliation checking in heapster-tests
#1801
Description
The CI is nondeterministically failing on the heapster-tests
job, as seen in this example:
/home/runner/work/saw-script/saw-script/dist/bin/saw rust_data.saw
[11:05:11.859] Loading file "/home/runner/work/saw-script/saw-script/heapster-saw/examples/rust_data.saw"
[11:05:12.146] Stack trace:
"heapster_init_env_from_file" (/home/runner/work/saw-script/saw-script/heapster-saw/examples/rust_data.saw:2:8-2:35)
Unknown type code 25
Are you sure you're using a supported compiler?
Check here: https://github.com/GaloisInc/llvm-pretty-bc-parser
from:
TYPE_BLOCK
type symbol table
MODULE_BLOCK
Bitstream
At first glance, this seems off, since we have already checked in a rust_data.bc
file that is known to work with llvm-pretty-bc-parser
. But the output above is only half of the story. Earlier in the CI log, we see this:
rustc --crate-type=lib --emit=llvm-bc rust_data.rs
This is rebuilding the rust_data.bc
file, but with a more recent version of rustc
than what was used to originally compile it! This is terrible, because (1) this produces different bitcode than what we want to test, and (2) the bitcode that newer rustc
s emit will not support llvm-pretty-bc-parser
(at least, not in its current state).
@kquick notes that make
will rebuild a .bc
file if its creation timestamp is different than its modified timestamp. Normally, these timestamps are set to the same time due to the way git clone
works, but there can occasionally be ever-so-slight delays during the checkout process that cause the modified time to be later than the created time. That is most likely why rust_data.bc
(and only rust_data.bc
) is being rebuilt in the CI log above, as it was the one .bc
file in the Heapster examples directory that happened to suffer from an ever-so-slight delay during the checkout process.
We should figure out a way to avoid this. One possible solution is to run touch *.bc
before running make
to ensure that the created and modified timestamps are the same.