Hive
Registry crates with a build script are never extracted: build-script-rustc fails hashing source/build.rs
GitHub issue · Open
What happened
Building any target that depends on a registry crate with a build script fails: Once declares <crate>/source/build.rs as an input to the build-script-rustc action, but never extracts the crate source, so the file does not exist when the action hashes its inputs.
The output directory for the crate is created and left completely empty.
Reproduction
Cargo.toml:
[package]
name = "icu-demo"
version = "0.1.0"
edition = "2021"
[dependencies]
url = "2.5.8"
src/main.rs:
fn main() {
let _ = url::Url::parse("https://example.com");
}
Then:
cargo generate-lockfile
once build cargo_icu_demo_bin_icu_demo
Actual
ERROR once: session failed error=building action 1 for icu_normalizer_data-2.2.0 (icu_normalizer_data-2.2.0:build-script-rustc)
once: building action 1 for icu_normalizer_data-2.2.0 (icu_normalizer_data-2.2.0:build-script-rustc): hashing declared input `.once/out/icu_normalizer_data-2.2.0/source/build.rs`: No such file or directory (os error 2)
The output directory exists but is empty — no source/ subdirectory was ever created:
$ ls -A .once/out/icu_normalizer_data-2.2.0/ | wc -l
0
By contrast, a dependency without a build script is extracted correctly:
$ ls .once/out/percent-encoding-2.3.2/source
Cargo.lock Cargo.toml Cargo.toml.orig LICENSE-APACHE LICENSE-MIT src
The upstream .crate archive does contain the file, and its manifest declares it, so the declared input itself is correct:
$ tar tzf ~/.cargo/registry/cache/*/icu_normalizer_data-2.2.0.crate | grep build.rs
icu_normalizer_data-2.2.0/build.rs
$ grep '^build' ~/.cargo/registry/src/*/icu_normalizer_data-2.2.0/Cargo.toml
build = "build.rs"
In this reproduction none of the extracted crates has a build.rs — every crate that has one fails at this step.
Expected
The crate source is extracted before its build-script-rustc action hashes inputs, so source/build.rs is present.
Notes
url is only the smallest trigger I found; it reaches build.rs-bearing crates through idna → idna_adapter → icu_properties → icu_properties_data. The same failure occurs via other paths — e.g. sqlx-core depends on url, so any sqlx user hits it as well, reported as icu_properties_data-2.2.0 there.
Environment
- once 0.42.0 (x86_64-unknown-linux-gnu release build)
- Linux 6.8, x86_64
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.
No GitHub comments yet.