-
Notifications
You must be signed in to change notification settings - Fork 471
Crates Universe: The optional-only dependency is not fetched even if needed #1939
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
Comments
Hi, does this occur on |
Yes. It still occurs on 0.21.1. I've update the example workspace with new release https://github.com/golovasteek/bazel_playground/tree/main |
If add a dummy cargo crate, that depends on "astc-decode" unconditionally, then I can use it in the initial package as well. Here is the example change https://github.com/golovasteek/bazel_playground/pull/1/files |
I think it works as designed. Without any changes, your See golovasteek/bazel_playground#2 for a working example. @UebelAndre maybe we could try to explain this in the documentation somewhere? I don't exactly know what would be the best place for that. EDIT: I suppose we could rethink the whole think to mimick what |
I think I could agree that optional dependencies for workspace members should be rendered. But maybe not added to the dependencies api? Or maybe that's expanded to support an |
I've spent some learning the code. I've found where the dependencies are lost initially. |
I’m trying to build a rust binary, that has some optional dependencies in the Cargo.toml, for my configuration I want to use these optional dependencies.
But it looks like the optional dependencies are not even fetched, and not added to the “@crate_index” repository.
That means that even if I specify them explicitly in the rust_binar binary:
they can not be used:
Here is the repo, that reproduces the problem
https://github.com/golovasteek/bazel_playground/blob/6f2ade625c80a73a0fcdfc8f936cd46963674454/rust/gui/BUILD.bazel
The text was updated successfully, but these errors were encountered: