Closed
Description
Problem
cargo publish
fails
Steps
Using the latest rand commit:
$ cargo publish --dry-run
Updating crates.io index
Packaging rand v0.9.0-alpha.0 (/home/dhardy/projects/rand/rand)
Updating crates.io index
Verifying rand v0.9.0-alpha.0 (/home/dhardy/projects/rand/rand)
error: failed to verify package tarball
Caused by:
failed to parse manifest at `/home/dhardy/projects/rand/rand/target/package/rand-0.9.0-alpha.0/Cargo.toml`
Caused by:
can't find `uniform` bench at `benches/uniform.rs` or `benches/uniform/main.rs`. Please specify bench.path if you want to use a non-default path.
Possible Solution(s)
No response
Notes
The relevant part of the Cargo.toml
:
[[bench]]
name = "uniform"
harness = false
This could have a path
specified... but as far as I can tell, cargo publish
is the only thing not happy to discover the default path (benches/uniform.rs
).
Despite this, the benchmark works fine:
$ ls -l benches/uniform.rs
-rw-r--r--. 1 dhardy dhardy 2696 Feb 13 11:39 benches/uniform.rs
$ cargo bench --bench uniform --features small_rng
Compiling rand v0.9.0-alpha.0 (/home/dhardy/projects/rand/rand)
Finished `bench` profile [optimized] target(s) in 2.28s
Running benches/uniform.rs (target/release/deps/uniform-38f8da4b7c78a479)
samplei8/SmallRng/single
time: [1.5141 ns 1.5143 ns 1.5145 ns]
[snip]
Steps
- refactor(package): Simplify getting of published Manifest #13666
- refactor(toml): Flatten manifest parsing #13589
- fix(toml): Warn on unused workspace.dependencies keys on virtual workspaces #13664
- refactor(toml): Split out an explicit step to resolve
Cargo.toml
#13693 - refactor(toml): Decouple target discovery from Target creation #13701
- fix(toml): Warn, rather than fail publish, if a target is excluded #13713
Version
cargo 1.78.0-nightly (fc1d58fd0 2024-02-09)
release: 1.78.0-nightly
commit-hash: fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3
commit-date: 2024-02-09
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.6.0-DEV (sys:0.4.71+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w 11 Sep 2023
os: Fedora 39 [64-bit]