Can't figure out the right way to build it!
Hi! I don't generally run the nightly compiler, and I feel like the readme is missing something important to get a build of lockbud to complete successfully. I followed these steps from the readme:
$ git clone https://github.com/BurtonQin/lockbud.git
$ cd lockbud
$ rustup component add rust-src
$ rustup component add rustc-dev
$ rustup component add llvm-tools-preview
$ cargo install --path .
these steps don't work because my default is the stable toolchain.
If I run with some explicit versions, it doesn't compile successfully:
$ rustup +nightly-2024-12-01 component add rust-src rustc-dev llvm-tools-preview
$ cargo +nightly-2024-12-01 install --path .
...
Compiling lockbud v0.1.0 (/home/wez/wez-personal/lockbud)
error[E0432]: unresolved import `rustc_index::bit_set::MixedBitSet`
--> src/detector/memory/invalid_free.rs:17:5
|
17 | use rustc_index::bit_set::MixedBitSet as BitSet;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `MixedBitSet` in `bit_set`
error[E0425]: cannot find function `run_compiler` in crate `rustc_driver`
--> src/main.rs:89:23
|
89 | rustc_driver::run_compiler(&rustc_command_line_arguments, &mut callbacks);
| ^^^^^^^^^^^^ not found in `rustc_driver`
|
help: consider importing this function
|
17 + use rustc_interface::run_compiler;
|
help: if you import `run_compiler`, refer to it directly
|
89 - rustc_driver::run_compiler(&rustc_command_line_arguments, &mut callbacks);
89 + run_compiler(&rustc_command_line_arguments, &mut callbacks);
|
error[E0609]: no field `codegen_units` on type `(&UnordSet<detector::lock::rustc_span::def_id::DefId>, &[CodegenUnit<'_>])`
--> src/callbacks.rs:103:61
|
103 | let cgus = tcx.collect_and_partition_mono_items(()).codegen_units;
| ^^^^^^^^^^^^^ unknown field
error[E0614]: type `Instance<'_>` cannot be dereferenced
--> src/callbacks.rs:109:30
|
109 | Some(*instance)
| ^^^^^^^^^
Some errors have detailed explanations: E0425, E0432, E0609, E0614.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `lockbud` (bin "lockbud") due to 4 previous errors
error: failed to compile `lockbud v0.1.0 (/home/wez/wez-personal/lockbud)`, intermediate artifacts can be found at `/home/wez/wez-personal/lockbud/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
I feel like there is some version pinning missing somewhere?
I also tried the docker image, but it doesn't like version 4 Cargo.lock files, and if I delete the lock file and let it rebuild it, I start running into issues with the dep: syntax and it fails to resolve some dependencies.
Does the docker image have the same rustc version as is currently stated in the readme?
Thanks for reading this!
And just after submitting this, I saw that the actual version supported is different. I've submitted a PR to update the block of commands, but there are probably also references to the wrong version elsewhere in the repo that I didn't make an attempt to find