BLAKE3-team / BLAKE3

the official Rust and C implementations of the BLAKE3 cryptographic hash function
Apache License 2.0
5.23k stars 353 forks source link

Build script failing #416

Closed cjpatton closed 3 months ago

cjpatton commented 3 months ago
    Blocking waiting for file lock on package cache
    Updating crates.io index
    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
   Compiling blake3 v1.5.2
   Compiling criterion v0.5.1
   Compiling num-bigint v0.4.6
   Compiling modinverse v0.1.1
   Compiling assert_matches v1.5.0
   Compiling hex-literal v0.4.1
   Compiling iai v0.1.1
   Compiling base64 v0.22.1
error[E0599]: no method named `emit_rerun_if_env_changed` found for struct `Build` in the current scope
   --> /Users/christopherpatton/.cargo/registry/src/index.crates.io-6f17d22bba15001f/blake3-1.5.2/build.rs:104:11
    |
104 |     build.emit_rerun_if_env_changed(false);
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `Build`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `blake3` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

This fails on master, 1.5.3, and 1.5.2. I'm able to build 1.5.1.

I'm new to this code and don't know yet what the build script is doing. In case it helps, I'm on macOS with an M2 processor and have rust 1.80.1.

oconnor663 commented 3 months ago

My guess is that you have a Cargo.lock file that's pinning an old version of the cc crate. Look for a section like this:

[[package]]
name = "cc"
version = ...
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = ...

cc added the emit_rerun_if_env_changed method in their v1.0.74. Are you pinning a version older than that? (We started using that method in our v1.5.2, which is why you don't see the build break before that.)

There are a couple of sketchy contributing factors here: We depend on features that are newer than the version of cc we declare in our Cargo.toml. I'll fix that now. Also cc is bumping their patch version when they add new features, when arguably they should be bumping their minor version.

cjpatton commented 3 months ago

Thanks, I'll take a look.

oconnor663 commented 3 months ago

Our just-released v1.5.4 updates the cc dependency to v1.1.12, which should force Cargo to update old lockfiles.