Skip to content

Commit e1d0913

Browse files
authored
[bazel] Replace git_repository with http_archive. (#99422)
The current git_repository usage points to tags, which leads to warnings that the build may not be reproducable due to not using a git sha. The docs for [git_repository](https://bazel.build/rules/lib/repo/git#git_repository) recommend using `http_archive`, so switch to that instead. Also bump to newer versions for these two repos.
1 parent 962d018 commit e1d0913

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

utils/bazel/WORKSPACE

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# See https://llvm.org/LICENSE.txt for license information.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
65
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
76
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
87

@@ -84,10 +83,11 @@ apple_support_dependencies()
8483
# Note: that building from source requires `m4` to be installed on the host machine.
8584
# This is a known issue: https://github.com/bazelbuild/rules_foreign_cc/issues/755.
8685

87-
git_repository(
86+
http_archive(
8887
name = "rules_foreign_cc",
89-
remote = "https://github.com/bazelbuild/rules_foreign_cc.git",
90-
tag = "0.9.0",
88+
sha256 = "4b33d62cf109bcccf286b30ed7121129cc34cf4f4ed9d8a11f38d9108f40ba74",
89+
strip_prefix = "rules_foreign_cc-0.11.1",
90+
url = "https://github.com/bazelbuild/rules_foreign_cc/releases/download/0.11.1/rules_foreign_cc-0.11.1.tar.gz",
9191
)
9292

9393
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
@@ -120,11 +120,12 @@ maybe(
120120
)
121121

122122
maybe(
123-
new_git_repository,
123+
http_archive,
124124
name = "pfm",
125125
build_file = "@llvm-raw//utils/bazel/third_party_build:pfm.BUILD",
126-
remote = "https://git.code.sf.net/p/perfmon2/libpfm4",
127-
tag = "v4.12.1",
126+
sha256 = "d18b97764c755528c1051d376e33545d0eb60c6ebf85680436813fa5b04cc3d1",
127+
strip_prefix = "libpfm-4.13.0",
128+
urls = ["https://versaweb.dl.sourceforge.net/project/perfmon2/libpfm4/libpfm-4.13.0.tar.gz"],
128129
)
129130

130131
maybe(

0 commit comments

Comments
 (0)