Skip to content

Commit 4c6d4fb

Browse files
committed
Revert "[bazel] Use zstd from the BCR (llvm#169146)"
This reverts commit ac4cf40.
1 parent c863fe8 commit 4c6d4fb

File tree

8 files changed

+40
-121
lines changed

8 files changed

+40
-121
lines changed

utils/bazel/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ bazel_dep(name = "rules_cc", version = "0.2.11")
1515
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
1616
bazel_dep(name = "rules_python", version = "1.6.3")
1717
bazel_dep(name = "rules_shell", version = "0.6.1")
18-
bazel_dep(name = "zstd", version = "1.5.7", repo_name = "llvm_zstd")
1918

2019
llvm_repos_extension = use_extension(":extensions.bzl", "llvm_repos_extension")
2120
use_repo(
2221
llvm_repos_extension,
2322
"gmp",
2423
"llvm-raw",
2524
"llvm_zlib",
25+
"llvm_zstd",
2626
"mpc",
2727
"mpfr",
2828
"nanobind",

utils/bazel/MODULE.bazel.lock

Lines changed: 13 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/bazel/extensions.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ def _llvm_repos_extension_impl(module_ctx):
7979
build_file = "@llvm-raw//utils/bazel/third_party_build:pfm.BUILD",
8080
)
8181

82+
http_archive(
83+
name = "llvm_zstd",
84+
build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
85+
sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
86+
strip_prefix = "zstd-1.5.2",
87+
urls = [
88+
"https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz",
89+
],
90+
)
91+
8292
http_archive(
8393
name = "pybind11",
8494
url = "https://github.com/pybind/pybind11/archive/v2.10.3.zip",

utils/bazel/llvm-project-overlay/lld/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ cc_library(
105105
"//llvm:TargetParser",
106106
"//llvm:TransformUtils",
107107
"//llvm:config",
108-
"//third-party:zstd",
109108
"@llvm_zlib//:zlib",
109+
"@llvm_zstd//:zstd",
110110
],
111111
)
112112

utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ cc_library(
331331
# We unconditionally depend on the custom LLVM zstd wrapper. This will
332332
# be an empty library unless zstd is enabled, in which case it will
333333
# both provide the necessary dependencies and configuration defines.
334-
"//third-party:zstd",
334+
"@llvm_zstd//:zstd",
335335
],
336336
)
337337

utils/bazel/llvm-project-overlay/third-party/BUILD.bazel

Lines changed: 0 additions & 60 deletions
This file was deleted.

utils/bazel/llvm-project-overlay/third-party/cc_library_wrapper.bzl

Lines changed: 0 additions & 50 deletions
This file was deleted.

utils/bazel/third_party_build/zstd.BUILD

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
22
# See https://llvm.org/LICENSE.txt for license information.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4-
load("@rules_cc//cc:cc_library.bzl", "cc_library")
4+
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
55

66
package(
77
default_visibility = ["//visibility:public"],
88
# BSD/MIT-like license (for zstd)
99
licenses = ["notice"],
1010
)
1111

12+
bool_flag(
13+
name = "llvm_enable_zstd",
14+
build_setting_default = True,
15+
)
16+
17+
config_setting(
18+
name = "llvm_zstd_enabled",
19+
flag_values = {":llvm_enable_zstd": "true"},
20+
)
21+
1222
cc_library(
1323
name = "zstd",
1424
srcs = select({
15-
"@llvm-project//third-party:llvm_zstd_enabled": glob([
25+
":llvm_zstd_enabled": glob([
1626
"lib/common/*.c",
1727
"lib/common/*.h",
1828
"lib/compress/*.c",
@@ -26,15 +36,15 @@ cc_library(
2636
"//conditions:default": [],
2737
}),
2838
hdrs = select({
29-
"@llvm-project//third-party:llvm_zstd_enabled": [
39+
":llvm_zstd_enabled": [
3040
"lib/zdict.h",
3141
"lib/zstd.h",
3242
"lib/zstd_errors.h",
3343
],
3444
"//conditions:default": [],
3545
}),
3646
defines = select({
37-
"@llvm-project//third-party:llvm_zstd_enabled": [
47+
":llvm_zstd_enabled": [
3848
"LLVM_ENABLE_ZSTD=1",
3949
"ZSTD_MULTITHREAD",
4050
],

0 commit comments

Comments
 (0)