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

Incorrect dependency from all_crate_deps serde_yaml with version v0.9.34+deprecated #3195

Open
bradzacher opened this issue Jan 22, 2025 · 1 comment

Comments

@bradzacher
Copy link

bradzacher commented Jan 22, 2025

Our repo depends on serde_yaml whose current version is v0.9.34+deprecated.

Under rules_rust 0.57.0 this generates two aliases in the crate_index (via crates_repository):

alias(
    name = "serde_yaml-0.9.34+deprecated",
    actual = "@crate_index__serde_yaml-0.9.34-deprecated//:serde_yaml",
    tags = ["manual"],
)

alias(
    name = "serde_yaml",
    actual = "@crate_index__serde_yaml-0.9.34-deprecated//:serde_yaml",
    tags = ["manual"],
)

When using all_crate_deps() it generates a dependency on @@crate_index//:serde_yaml-0.9.34-deprecated -- which is incorrect -- it should be +deprectated, not -deprecated -- this ofc causes a build failure:

ERROR: /private/var/tmp/_bazel_bjz/ab6676c7943b575710f215479703ac0a/external/crate_index/BUILD.bazel: no such target '@@crate_index//:serde_yaml-0.9.34-deprecated': target 'serde_yaml-0.9.34-deprecated' not declared in package '' defined by /private/var/tmp/_bazel_bjz/ab6676c7943b575710f215479703ac0a/external/crate_index/BUILD.bazel (did you mean serde_yaml-0.9.34+deprecated?)

If I manually add an alias to our repo like

alias(
    name = "serde_yaml-0.9.34-deprecated",
    actual = "@crate_index__serde_yaml-0.9.34-deprecated//:serde_yaml",
    tags = ["manual"],
)

Then this causes the build to pass correctly.

We have worked-around this by pinning the version to 0.9.33, given that 0.9.34+deprecated was a patch bump purely to update the docs and mark it as deprecated.

@bradzacher
Copy link
Author

bradzacher commented Jan 23, 2025

Also worth noting that as I was trying older versions of rules_rust - I didn't see this issue. As mentioned in other issues I tried all versions from 0.49-0.54 and 0.57 (I can't try 0.55 or 0.56 due to #3166 that was fixed in 0.57)

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

1 participant