From b462128f3d39d065e0871b98d076ab9fb186e724 Mon Sep 17 00:00:00 2001
From: kchodorow Warning: this rule has several limitations. We recommend using
+ Many git repository hosts serve tarballs of the repository, so depend on those if possible.
+For GitHub, this takes the form:
+
+http_archive
instead for more robust and secure
+performance.git_repository
has several issues:
+
+
+
+
+http_archive
allows a sha256 to be specified, which ensures that the
+downloaded code is exactly what was expected.
+http_archive
allows the user to specify multiple URLs to attempt
+downloads from. Most services have downtime occasionally, so specifying multiple remotes decreases
+the chances of being unable to download a dependency.
+http_archive
multiplexes downloads to get the fastest possible rate.
+You can also generally download a tarball that is a "shallow clone" of the repository, which
+decreases the size of the download.
+
+http_archive(
+ name = "
+
+If you are using a private repository, prefer the
+Skylark git
+repository rules, which will use your system's git install (instead of jGit). These rules
+are built into Bazel and have the same API as the native rules.
Clones a Git repository, checks out the specified tag, or commit, and makes its targets available for binding.
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewGitRepositoryRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewGitRepositoryRule.java index 4cda4d71caad62..8659f5d5a90cd9 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewGitRepositoryRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewGitRepositoryRule.java @@ -106,6 +106,42 @@ public Metadata getMetadata() { /* +Warning: this rule has several limitations. We recommend using
+new_http_archive
instead for more robust and
+secure performance.
new_git_repository
has several issues:
+
+
new_http_archive
allows a sha256 to be specified, which ensures that
+the downloaded code is exactly what was expected.
+new_http_archive
allows the user to specify multiple URLs to attempt
+downloads from. Most services have downtime occasionally, so specifying multiple remotes decreases
+the chances of being unable to download a dependency.
+new_http_archive
multiplexes downloads to get the fastest possible rate.
+You can also generally download a tarball that is a "shallow clone" of the repository, which
+decreases the size of the download.
+Many git repository hosts serve tarballs of the repository, so depend on those if possible. +For GitHub, this takes the form: + +
+new_http_archive( + name = "+ +If you are using a private repository, prefer the +Skylark git +repository rules, which will use your system's git install (instead of jGit). These rules +are built into Bazel and have the same API as the native rules. +", + urls = ["https://github.com/ / /archive/ .tar.gz"], + build_file = " ", +) +
Clones a Git repository, checks out the specified tag, or commit, and makes its targets available for binding.