0xPolygonMiden / miden-vm

STARK-based virtual machine
MIT License
632 stars 161 forks source link

incompatible version of rustc during cargo build on Mac #1590

Closed mrthankyou closed 1 day ago

mrthankyou commented 1 day ago

Packages versions

0.11.0

Bug description

When running cargo build --release --features executable I receive several installation errors.

Running against Mac OS 14.5.

Running rustc version I get:

rustc 1.82.0 (f6e511eec 2024-10-15)

How can this be reproduced?

Utilize a 14.5 Sonoma Mac machine with rustc 1.82.0 installed.

Relevant log output

error[E0514]: found crate `lazy_static` compiled by an incompatible version of rustc
  --> /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/sync.rs:66:20
   |
66 |     pub(crate) use lazy_static::lazy_static;
   |                    ^^^^^^^^^^^
   |
   = note: the following crate versions were found:
           crate `lazy_static` compiled by rustc 1.82.0 (f6e511eec 2024-10-15): /Users/user/hacking/solidity/targets/polygon/miden-vm/target/release/deps/liblazy_static-052d47c1cb7f557b.rmeta
   = help: please recompile that crate using this compiler (rustc 1.83.0 (90b35a623 2024-11-26)) (consider running `cargo clean` first)

error[E0432]: unresolved import `crate::sync::lazy_static`
 --> /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:6:9
  |
6 |         lazy_static, thread_local, Mutex,
  |         ^^^^^^^^^^^

error[E0425]: cannot find value `REGISTRY` in this scope
   --> /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:149:18
    |
149 |         let id = REGISTRY
    |                  ^^^^^^^^ not found in this scope

error[E0425]: cannot find value `REGISTRY` in this scope
   --> /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:161:26
    |
161 |                 let id = REGISTRY.next.fetch_add(1, Ordering::AcqRel);
    |                          ^^^^^^^^ not found in this scope

error[E0425]: cannot find value `REGISTRY` in this scope
   --> /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:191:33
    |
191 |             let mut free_list = REGISTRY.free.lock().unwrap_or_else(PoisonError::into_inner);
    |                                 ^^^^^^^^ not found in this scope

   Compiling thread_local v1.1.8
   Compiling test-case-core v3.3.1
Some errors have detailed explanations: E0425, E0432, E0514.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `sharded-slab` (lib) due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
bobbinth commented 1 day ago

Interesting! Thank you for reporting!

I just tried this on Mac Sequoia 15.1.1 / Rust 1.82 and it compiled fine.

It is possible that something got corrupted on your end? Could you try doing something like cargo clean and then make exec?

mrthankyou commented 1 day ago

All works now! cargo clean and make exec resolved this. Thanks for the help!

Happy to close this ticket if you are.