[9.0.0] Fix crash when mixing use_repo_rule and --inject_repository
#27983
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bazel crashes at HEAD when
use_repo_ruleis used withlocal_repositorywhile 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