bazelbuild / rules_rust

Rust rules for Bazel
https://bazelbuild.github.io/rules_rust/
Apache License 2.0
656 stars 419 forks source link

Allow overriding crate universe packages to local packages #2674

Closed ograff closed 3 months ago

ograff commented 3 months ago

Allow external crates to be aliased to local targets

In some cases it may be desirable to alias a public crate to a locally define rust_library target, even for dependencies of crates that are not being overriden. Support this use case by swapping out alias for rust_library when a user overrides the target using an annotation.

illicitonion commented 3 months ago

LGTM! I made a PR with one suggested modification in https://github.com/ograff/rules_rust/pull/1 - PTAL and merge into this branch or discuss, and I'm happy to merge this :) Thanks!

ograff commented 3 months ago

@illicitonion that change looks great, I went ahead and merged it in.

Is your preference for me to squash all these commits to one pre-merge or leave the history as is?

illicitonion commented 3 months ago

We auto-squash on merge, so don't worry about it, GitHub will deal with it for us! Thanks!