Skip to content

Commit 7381dec

Browse files
[bazel] Update example workspace files with dependencies
Currently, the example workspace files do not work properly. The llvm_disable_optional_support_deps option was removed in 7b5d6cd and zlib and zstd have been needed-by-default dependencies for a while, so it would make sense to show definitions in the example bazel workspace files, especially given the version sensitivity of the zlib-ng build. This patch removes the use of dated build config flags and adds dependency definitions to both of the example workspaces. Reviewed By: aaronmondal Differential Revision: https://reviews.llvm.org/D156654
1 parent 82bc183 commit 7381dec

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

utils/bazel/examples/http_archive/WORKSPACE

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ http_archive(
2020
)
2121

2222
# Replace with the LLVM commit you want to use.
23-
LLVM_COMMIT = "81d5412439efd0860c0a8dd51b831204f118d485"
23+
LLVM_COMMIT = "926f85db98aae66ab8f57b9981f47ddddb868c51"
2424

2525
# The easiest way to calculate this for a new commit is to set it to empty and
2626
# then run a bazel build and it will report the digest necessary to cache the
2727
# archive and make the build reproducible.
28-
LLVM_SHA256 = "50b3ef31b228ea0c96ae074005bfac087c56e6a4b1c147592dd33f41cad0706b"
28+
LLVM_SHA256 = "c78c94b2a03b2cf6ef1ba035c31a6f1b0bb7913da8af5aa8d5c2061f6499d589"
2929

3030
http_archive(
3131
name = "llvm-raw",
@@ -35,6 +35,28 @@ http_archive(
3535
urls = ["https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT)],
3636
)
3737

38-
load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps")
38+
load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure")
3939

4040
llvm_configure(name = "llvm-project")
41+
42+
maybe(
43+
http_archive,
44+
name = "llvm_zlib",
45+
build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD",
46+
sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731",
47+
strip_prefix = "zlib-ng-2.0.7",
48+
urls = [
49+
"https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip",
50+
],
51+
)
52+
53+
maybe(
54+
http_archive,
55+
name = "llvm_zstd",
56+
build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
57+
sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
58+
strip_prefix = "zstd-1.5.2",
59+
urls = [
60+
"https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz"
61+
],
62+
)

utils/bazel/examples/submodule/WORKSPACE

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@ new_local_repository(
2424
path = "third_party/llvm-project",
2525
)
2626

27-
load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps")
27+
load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure")
2828

2929
llvm_configure(name = "llvm-project")
30+
31+
maybe(
32+
http_archive,
33+
name = "llvm_zlib",
34+
build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD",
35+
sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731",
36+
strip_prefix = "zlib-ng-2.0.7",
37+
urls = [
38+
"https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip",
39+
],
40+
)
41+
42+
maybe(
43+
http_archive,
44+
name = "llvm_zstd",
45+
build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
46+
sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
47+
strip_prefix = "zstd-1.5.2",
48+
urls = [
49+
"https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz"
50+
],
51+
)

0 commit comments

Comments
 (0)