Skip to content

Commit

Permalink
chore(IDX): Use pigz from Bazel Central Registry (#2945)
Browse files Browse the repository at this point in the history
The `pigz` (parallel gzip) tool is already packaged in the Bazel Central
Registry: https://registry.bazel.build/modules/pigz

This module includes all necessary dependencies, allowing us to switch
to another CC toolchain without worrying about e.g. providing `zlib`.
  • Loading branch information
nmattia authored Dec 3, 2024
1 parent b12bef3 commit 3466a32
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ archive_override(
urls = ["https://github.com/bazelbuild/rules_foreign_cc/archive/77d4483fadbb1b7bcace18ed8e8e87e8791050f6.tar.gz"],
)

# Misc tools

bazel_dep(name = "pigz", version = "2.8") # (parallel) gzip

# Python dependencies

bazel_dep(name = "rules_python", version = "0.35.0")
Expand Down Expand Up @@ -429,38 +433,6 @@ http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_

http_jar = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")

# Gzip tool
http_archive(
name = "pigz",
build_file_content = """
cc_library(
name = "zopfli",
hdrs = glob(["zopfli/src/zopfli/*.h"]),
srcs = glob(["zopfli/src/zopfli/*.c"]),
)
cc_binary(
name = "pigz",
srcs = [
"pigz.c",
"try.c",
"try.h",
"yarn.c",
"yarn.h",
],
linkopts = [
"-lm",
"-lpthread",
"-lz",
],
deps = [":zopfli"],
visibility = ["//visibility:public"],
)""",
sha256 = "688fe1d805b33a4ae8cbf86ba56aa1a5d647e959219c7d3aeb7d041c228af1ef",
strip_prefix = "pigz-2.8",
url = "https://github.com/madler/pigz/archive/refs/tags/v2.8.zip",
)

# TLA+ tools
http_jar(
name = "tlaplus_community_modules",
Expand Down

0 comments on commit 3466a32

Please sign in to comment.