Skip to content

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented Dec 12, 2025

Bazel crashes at HEAD when use_repo_rule is used with local_repository while also using --inject_repository.

Make bugs like this less likely by extracting out a safe "get or create" helper for extension usages.

Fixes #27953

Bazel crashes at HEAD when `use_repo_rule` is used with `local_repository` while also using `--inject_repository`.

Make bugs like this less likely by extracting out a safe "get or create" helper for extension usages.
@github-actions github-actions bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Dec 12, 2025
@fmeum
Copy link
Collaborator Author

fmeum commented Dec 12, 2025

@bazel-io fork 9.0.0

@fmeum
Copy link
Collaborator Author

fmeum commented Dec 12, 2025

@meteorcloudy This probably has to go out in an 8.5.1 release :-(

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a crash that occurs when use_repo_rule and --inject_repository are used together for local_repository. The fix involves refactoring the creation of ModuleExtensionUsageBuilder into a centralized getOrCreateExtensionUsageBuilder helper method. This ensures that a single builder is used for the same non-isolated extension, preventing the duplication that caused the crash. The changes are logical, well-contained, and include a regression test to prevent this issue in the future. The code quality is improved by this refactoring.

@bharadwaj08-one
Copy link

@fmeum Could you please take a look at the failing checks?

@bharadwaj08-one bharadwaj08-one added awaiting-user-response Awaiting a response from the author and removed awaiting-review PR is awaiting review from an assigned reviewer labels Dec 15, 2025
@fmeum
Copy link
Collaborator Author

fmeum commented Dec 15, 2025

@bharadwaj08-one That's an unrelated preexisting failure. @Wyverald

@Wyverald
Copy link
Member

I'm already importing this.

bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Dec 15, 2025
Bazel crashes at HEAD when `use_repo_rule` is used with `local_repository` while also using `--inject_repository`.

Make bugs like this less likely by extracting out a safe "get or create" helper for extension usages.

Fixes bazelbuild#27953

Closes bazelbuild#27967.

PiperOrigin-RevId: 844683022
Change-Id: I1edcf1e7c72ef8d46c67e51b4f9ffd6a6ce82ec8
@meteorcloudy
Copy link
Member

@iancha1992 Let's do a 8.5.1

github-merge-queue bot pushed a commit that referenced this pull request Dec 15, 2025
…y` (#27983)

Bazel crashes at HEAD when `use_repo_rule` is used with
`local_repository` while also using `--inject_repository`.

Make bugs like this less likely by extracting out a safe "get or create"
helper for extension usages.

Fixes #27953

Closes #27967.

PiperOrigin-RevId: 844683022
Change-Id: I1edcf1e7c72ef8d46c67e51b4f9ffd6a6ce82ec8

Commit
21d7fec

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
@iancha1992
Copy link
Member

@bazel-io fork 8.5.1

bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Dec 15, 2025
Bazel crashes at HEAD when `use_repo_rule` is used with `local_repository` while also using `--inject_repository`.

Make bugs like this less likely by extracting out a safe "get or create" helper for extension usages.

Fixes bazelbuild#27953

Closes bazelbuild#27967.

PiperOrigin-RevId: 844683022
Change-Id: I1edcf1e7c72ef8d46c67e51b4f9ffd6a6ce82ec8
@iancha1992
Copy link
Member

@bazel-io fork 8.6.0

bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Dec 15, 2025
Bazel crashes at HEAD when `use_repo_rule` is used with `local_repository` while also using `--inject_repository`.

Make bugs like this less likely by extracting out a safe "get or create" helper for extension usages.

Fixes bazelbuild#27953

Closes bazelbuild#27967.

PiperOrigin-RevId: 844683022
Change-Id: I1edcf1e7c72ef8d46c67e51b4f9ffd6a6ce82ec8
github-merge-queue bot pushed a commit that referenced this pull request Dec 15, 2025
…y` (#27995)

Bazel crashes at HEAD when `use_repo_rule` is used with
`local_repository` while also using `--inject_repository`.

Make bugs like this less likely by extracting out a safe "get or create"
helper for extension usages.

Fixes #27953

Closes #27967.

PiperOrigin-RevId: 844683022
Change-Id: I1edcf1e7c72ef8d46c67e51b4f9ffd6a6ce82ec8

Commit
21d7fec

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
github-merge-queue bot pushed a commit that referenced this pull request Dec 15, 2025
…y` (#27999)

Bazel crashes at HEAD when `use_repo_rule` is used with
`local_repository` while also using `--inject_repository`.

Make bugs like this less likely by extracting out a safe "get or create"
helper for extension usages.

Fixes #27953

Closes #27967.

PiperOrigin-RevId: 844683022
Change-Id: I1edcf1e7c72ef8d46c67e51b4f9ffd6a6ce82ec8

Commit
21d7fec

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-user-response Awaiting a response from the author team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bazel crash when using --inject_repository in 8.5.0

5 participants