CodSpeedHQ / codspeed-rust

Rust crates to create CodSpeed benchmarks
https://codspeed.io
Apache License 2.0
23 stars 9 forks source link

`cargo codspeed build` doesn't build virtual manifest #37

Closed tversteeg closed 7 months ago

tversteeg commented 7 months ago

I'm trying to integrate CodSpeed into this repo which contains a virtual manifest. So the Cargo.toml contains a [workspace] section but the main package is not included in it.

When I run cargo codspeed build I get the following output:

   Collected 1 benchmark suite(s) to build
    Building benchmarks
       Error There are multiple `blit` packages in your project, and the specification `blit` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
  file:///.../blit#0.8.5
  https://github.com/rust-lang/crates.io-index#blit@0.8.5

There's no way to select the main package, which should be selected by default anyway.

adriencaccia commented 7 months ago

Hey @tversteeg, thanks for the issue!

I managed to reproduce the error investigating with your repository.

The root cause is not due to the virtual manifest, but rather tied to the fact that blit is dependent on itself, because of its dependency pixel-game-lib which has blit as a dependency.

I submitted a PR with a fix.

tversteeg commented 7 months ago

Thanks for finding and resolving that @adriencaccia, that must not have been straightforward!

adriencaccia commented 6 months ago

@tversteeg The fix is available in https://github.com/CodSpeedHQ/codspeed-rust/releases/tag/v2.4.1, let me know if that works for you 😉 Thanks again for the issue