Skip to content

Fixes behavior of rust_generated_srcs within the rust-analyzer aspect - #3836

Merged
UebelAndre merged 1 commit into
bazelbuild:mainfrom
csmulhern:main
May 4, 2026
Merged

Fixes behavior of rust_generated_srcs within the rust-analyzer aspect#3836
UebelAndre merged 1 commit into
bazelbuild:mainfrom
csmulhern:main

Conversation

@csmulhern

Copy link
Copy Markdown
Contributor

The existing rust analyzer aspect does not handle generated files completely.

  1. The aspect does not propagate through the srcs attribute, so on a top level target that uses a generated dependency, the aspect will not run.
  2. For targets with transitive dependencies that contain generated rust sources, the aspect will visit those dependencies, but because rust_generated_srcs is not aggregated onto the top-level target, the files themselves will not be generated. This breaks things like e.g. jump-to-definition if you try to jump to a file that has not yet been generated by bazel.

This PR addresses both these issues.

@csmulhern csmulhern changed the title Fixes paths generated for rust-analyzer discovery Fixes behavior of rust_generated_srcs within the rust-analyzer aspect Feb 3, 2026
@csmulhern
csmulhern force-pushed the main branch 4 times, most recently from 7e7a8bb to d38664b Compare February 3, 2026 23:17
@csmulhern

Copy link
Copy Markdown
Contributor Author

@UebelAndre is there someone that can take a look at this?

@csmulhern

Copy link
Copy Markdown
Contributor Author

@UebelAndre this is up to date again if there's someone who can take a look.

@UebelAndre UebelAndre left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the ping! This looks great!

@UebelAndre
UebelAndre added this pull request to the merge queue May 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 4, 2026
@UebelAndre
UebelAndre added this pull request to the merge queue May 4, 2026
Merged via the queue into bazelbuild:main with commit 8e9f73f May 4, 2026
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants