c2rust
c2rust copied to clipboard
Added an `analysis/test` snapshot test for `--release`
- It appears
cargo addhas race conditions:
running 2 tests
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Blocking waiting for file lock on build directory
Finished release [optimized] target(s) in 0.15s
Running `target/release/c2rust-instrument --metadata /__w/1/s/analysis/test/instrument.target/debug/metadata.bc --set-runtime --runtime-path /__w/1/s/analysis/runtime -- run --manifest-path /__w/1/s/analysis/test/Cargo.toml --profile dev`
Finished release [optimized] target(s) in 0.16s
Running `target/release/c2rust-instrument --metadata /__w/1/s/analysis/test/instrument.target/release/metadata.bc --set-runtime --runtime-path /__w/1/s/analysis/runtime -- run --manifest-path /__w/1/s/analysis/test/Cargo.toml --profile release`
Adding Adding c2rust-analysis-rt (local) to optional dependencies.
c2rust-analysis-rt (local) to optional dependencies.
error: failed to parse manifest at `/__w/1/s/analysis/test/Cargo.toml`
Caused by:
virtual manifests must be configured with [workspace]
error running: "/home/docker/.rustup/toolchains/nightly-2022-08-08-x86_64-unknown-linux-gnu/bin/cargo" "add" "--optional" "c2rust-analysis-rt" "--offline" "--path" "/__w/1/s/analysis/runtime" "--manifest-path" "/__w/1/s/analysis/test/Cargo.toml"
Error: "cargo" "run" "--bin" "c2rust-instrument" "--profile" "release" "--" "--metadata" "/__w/1/s/analysis/test/instrument.target/release/metadata.bc" "--set-runtime" "--runtime-path" "/__w/1/s/analysis/runtime" "--" "run" "--manifest-path" "/__w/1/s/analysis/test/Cargo.toml" "--profile" "release" failed: exit status: 101
Using strace, cargo add reads the Cargo.toml manifest many, many times, causing race conditions even if the file is never written to.
- It appears that with the addition of the
--releasesnapshot, CI almost always fails (except for Darwin). More specifically, all but Darwin CI has failed for 3 runs. 1 failure was thecargo addrace condition.
It has now been rebased to master after merging #683 and #691 to fix #613. It works locally without race conditions after running it 100s of times. Let's see if CI works, too, or if the cargo add race condition needs fixing/working around/disabling.
CI seems to work fine, so I'll merge this now.