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

Merge deps of related crates in Rust Analyzer support #781

Merged
merged 8 commits into from
Jun 24, 2021

Conversation

hlopko
Copy link
Member

@hlopko hlopko commented Jun 22, 2021

It can happen a single source file is present in multiple crates - there can
be a rust_library with a lib.rs file, and a rust_test for the test
module in that file. Tests can declare more dependencies than what library
had. Therefore we had to collect all RustAnalyzerInfos for a given crate
and take deps from all of them.

There's one exception - if the dependency is the same crate name as the
the crate being processed, we don't add it as a dependency to itself. This is
common and expected - rust_test.crate pointing to the rust_library.

@google-cla google-cla bot added the cla: yes label Jun 22, 2021
@hlopko hlopko changed the title Rust analyzer merging Merge deps of related crates in Rust Analyzer support Jun 22, 2021
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! A couple of small things but otherwise looks good 😄

rust/private/rust_analyzer.bzl Outdated Show resolved Hide resolved
rust/private/rust_analyzer.bzl Show resolved Hide resolved
@hlopko
Copy link
Member Author

hlopko commented Jun 23, 2021

Related: #704

@hlopko hlopko requested review from UebelAndre and removed request for UebelAndre June 24, 2021 08:27
@hlopko hlopko dismissed UebelAndre’s stale review June 24, 2021 08:30

Github is confused. Requested changes were addressed.

@hlopko hlopko merged commit 9443bbd into bazelbuild:main Jun 24, 2021
@hlopko hlopko deleted the rust_analyzer_merging branch June 24, 2021 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants