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

Broken build dependency #1966

Open
fmorency opened this issue May 9, 2023 · 4 comments
Open

Broken build dependency #1966

fmorency opened this issue May 9, 2023 · 4 comments

Comments

@fmorency
Copy link
Contributor

fmorency commented May 9, 2023

Probably related to #1850 and #1884

MRE: https://github.com/fmorency/bazel-broken-dep

Works on rules_rust 0.17.

The serde* build-dependencies are not propagated correctly causing the Bazel build to fail.

Works with cargo.

Tested with Bazel 6.0.0 and 6.1.2.

@UebelAndre
Copy link
Collaborator

Hi, what aren't they correctly propagated to? Can you make this issue a bit more descriptive?

And it broke after 0.17? or within the range of 0.17 to latest?

@UebelAndre
Copy link
Collaborator

The issue appears to come from gherkin where the serde dependency is optional in dependencies but not build-dependencies (see Cargo.toml).

@fmorency
Copy link
Contributor Author

You are correct, the serde dependency is not propagated to gherkin resulting in a build failure. As you already noticed, serde is optional in dependencies but not in build-dependencies.

I was wrong, the project builds fine with rules_rust <= 0.20.0. It starts breaking with rules_rust == 0.21.0.

I updated the MRE to reflect this.

@UebelAndre
Copy link
Collaborator

I think this issue lies somewhere in https://github.com/bazelbuild/rules_rust/blob/0.21.1/crate_universe/src/metadata/dependency.rs#L149-L180

If the same dependency exists in dependencies and build-dependencies, it seems only one is considered. If you're willing to work on a pull-request to fix this I'm happy to review and help how I can 😄

@UebelAndre UebelAndre added the bug label May 10, 2023
dmitrii-ubskii added a commit to dmitrii-ubskii/vaticle-dependencies that referenced this issue Sep 11, 2023
dmitrii-ubskii added a commit to dmitrii-ubskii/vaticle-dependencies that referenced this issue Sep 13, 2023
dmitrii-ubskii added a commit to dmitrii-ubskii/vaticle-dependencies that referenced this issue Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants