Repository navigation
Make new_git_repository fail if used - #29226
Closed
willstranton wants to merge 1 commit into
Closed
willstranton wants to merge 1 commit into
willstranton wants to merge 1 commit into
Conversation
willstranton
marked this pull request as ready for review
April 4, 2026 02:05
Member
|
please move the |
Member
|
nit: Can you leave a thin macro |
The note in git.bzl says that 'new_git_repository' should be removed by Bazel 7. This replaces the rule implementation with one that fails immediately if used and informs the user on how to replace it with the drop-in replacement 'git_repository' RELNOTES[INC]: Prevent use of the repository rule `new_git_repository`. Users should use git_repository instead (it's a drop-in replacement)
Contributor
Author
Done
Done. Added a TODO that it should eventually be removed. |
new_git_repository fail if used
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The note in git.bzl says that 'new_git_repository' should be removed by Bazel
7. This
removes it since it's just an alias ofreplaces it with a failure message and fix instructions. Users should usegit_repositorygit_repositoryinstead ofnew_git repository.Description
Replaces the implementation of the repository rule
new_git_repositorywith an implementation that fails immediately when used.Example error message:
Motivation
The note in
git.bzlsays this should have been removed before Bazel 7. We are now at Bazel 9.Build API Changes
I have no knowledge of a discussion taking place on this. The note in
git.bzlsaying this should be removed implies that there was such a discussion or intent.No, anyone who is using
new_git_repositorywill fail after getting this change.Users should use
git_repositoryinstead.Checklist
Release Notes
RELNOTES[INC]: Removes the deprecated repository rule
new_git_repository. Users should usegit_repositoryinstead (they are the same)