Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

criterion library required even for production build #2

Closed
mlampert opened this issue Sep 8, 2023 · 6 comments
Closed

criterion library required even for production build #2

mlampert opened this issue Sep 8, 2023 · 6 comments

Comments

@mlampert
Copy link

mlampert commented Sep 8, 2023

Trying to integrate cavalier_contours in FreeCAD it is currently required to install criterion with all its dependencies for the build. Unfortunately the CI system FreeCAD uses has no online access and the criterion packages are not available for Ubuntu 22.04 and 20.04 - both are build targets for FreeCAD.

It would be really great if static_aabb2d_index could be built without requiring criterion which would never be used in this use case.

@jbuckmccready
Copy link
Owner

criterion is listed under the [dev-dependencies] in the Cargo.toml and shouldn't be built or required when this crate (static_aabb2d_index) is used as a dependency (as it is for cavalier_contours). How are you building cavalier_contours and what error message are you getting indicating it's needing the criterion package? I was never aware of [dev-dependencies] causing this issue so I would like to learn more.

@mlampert
Copy link
Author

mlampert commented Sep 9, 2023

cmd and error:

markus@camille:/tmp/static_aabb2d_index$ cargo build --lib --release
error: no matching package named `criterion` found
location searched: registry `crates-io`
required by package `static_aabb2d_index v2.0.0 (/tmp/static_aabb2d_index)`

I'm working on debian and forced cargo to use the local registry (see https://wiki.debian.org/Rust) I have the crates autocfg and num-traits installed.

when I looked into it I found this thread. I don't fully understand the argument but it seems to be on purpose:
rust-lang/cargo#4988

I did some more testing and found out that if I remove the reference to criterion and bench from the Cargo.toml the library builds just fine - with above command.

@jbuckmccready
Copy link
Owner

Ah, yeah if you build cavalier_contours it wont require criterion (even though it depends on static_aabb2d_index), this is what I thought you were doing, but building this library (static_aabb2d_index) directly will require it by default (as mentioned in that cargo issue you linked).

Hmm, I think I will move the benchmarks into its own git repo to avoid this awkwardness and simplify the library repo, that should also fix the issue you're having. I'll make that change now - should be simple.

@mlampert
Copy link
Author

mlampert commented Sep 9, 2023

I see - so much to learn. I can also patch the Cargo.toml file for the FreeCAD build. I hadn't figured out how to get around the dependency when I filed the issue.

@jbuckmccready
Copy link
Owner

Alright I made the change, commit: f2e5659

Dedicated repo for benchmarks is now here: https://github.com/jbuckmccready/static_aabb2d_index_bench

This should resolve your issue.

@mlampert
Copy link
Author

mlampert commented Sep 9, 2023

perfect - it sure does, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants