Skip to content

Commit 5d1be37

Browse files
authored
Replace new_git_repository with git_repository (bazelbuild#3965)
The repository rule `new_git_repository` has been an alias of `git_repository` since Bazel 6.0.0: https://github.com/bazelbuild/bazel/blob/6.0.0/tools/build_defs/repo/git.bzl#L190 Recently, a change was made to make use of `new_git_repository` fail - bazelbuild/bazel@71160cb Users should use `git_repository` instead, which this change does. The change should be a no-op for Bazel >= 6.0.0
1 parent 19beae8 commit 5d1be37

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

crate_universe/extensions.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ There are some more examples of using crate_universe with bzlmod in the [example
373373

374374
load("@bazel_features//:features.bzl", "bazel_features")
375375
load("@bazel_skylib//lib:structs.bzl", "structs")
376-
load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
376+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
377377
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
378378
load(
379379
"//crate_universe/private:common_utils.bzl",
@@ -758,7 +758,7 @@ def _generate_hub_and_spokes(
758758
kwargs["commit"] = v
759759
else:
760760
kwargs[k.lower()] = v
761-
new_git_repository(
761+
git_repository(
762762
name = crate_repo_name,
763763
init_submodules = True,
764764
patch_args = repo.get("patch_args", None),

crate_universe/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ pub(crate) struct CrateAnnotations {
345345
pub(crate) additive_build_file_content: Option<String>,
346346

347347
/// For git sourced crates, this is a the
348-
/// [git_repository::shallow_since](https://docs.bazel.build/versions/main/repo/git.html#new_git_repository-shallow_since) attribute.
348+
/// [git_repository::shallow_since](https://docs.bazel.build/versions/main/repo/git.html#git_repository-shallow_since) attribute.
349349
pub(crate) shallow_since: Option<String>,
350350

351351
/// The `patch_args` attribute of a Bazel repository rule. See

crate_universe/src/rendering/templates/module_bzl.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Expected length = 6 lines
1414

1515
"""
1616

17-
load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
17+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
1818
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1919
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
2020
load("@bazel_skylib//lib:selects.bzl", "selects")

crate_universe/src/rendering/templates/partials/module/repo_git.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
maybe(
2-
new_git_repository,
2+
git_repository,
33
name = "{{ crate_repository(name = crate.name, version = crate.version) }}",
44
{%- for type, commitish in attrs.commitish %}
55
{%- if type in ["Rev"] %}

0 commit comments

Comments
 (0)