Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • bazel/rules_zstd
1 result
Show changes
Commits on Source (8)
......@@ -24,11 +24,11 @@ test:
parallel:
matrix:
- ROOT:
- .
- e2e
- .
- e2e
CONFIG:
- local
- remote
- local
- remote
script:
- cd "${ROOT}"; bazelisk test --config="${CONFIG}" //...
......
# [1.0.0-beta.2](https://git.gitlab.arm.com/bazel/rules_zstd/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2024-08-12)
### Bug Fixes
- **ape:** switch to `@ape//ape/toolchain/info:zstd` ([ac3c028](https://git.gitlab.arm.com/bazel/rules_zstd/commit/ac3c028b1bbed4cce1a52a91a0692dbe91ac43c0))
- increased `22` to `23` in the accepted values list ([b49fbe2](https://git.gitlab.arm.com/bazel/rules_zstd/commit/b49fbe270a17fb6d5b874da762807112668feeea))
### Features
- added compression level support ([3051779](https://git.gitlab.arm.com/bazel/rules_zstd/commit/30517791ad2a9be8434357c0ae386c76f3f0de1b))
# 1.0.0-beta.1 (2024-05-13)
### Features
......
module(
name = "rules_zstd",
version = "1.0.0-beta.1",
version = "1.0.0-beta.2",
bazel_compatibility = [
">=7.0.0",
],
......@@ -9,8 +9,8 @@ module(
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.7.0")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.9")
bazel_dep(name = "ape", version = "1.0.0-beta.6")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.12")
bazel_dep(name = "ape", version = "1.0.0-beta.12")
export = use_extension("@toolchain_utils//toolchain/export:defs.bzl", "toolchain_export")
use_repo(export, "ape-zstd")
......
This diff is collapsed.
......@@ -5,9 +5,9 @@ module(
],
)
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.9")
bazel_dep(name = "rules_diff", version = "1.0.0-beta.3")
bazel_dep(name = "rules_zstd", version = "0.0.0")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.12")
bazel_dep(name = "rules_diff", version = "1.0.0-beta.4")
bazel_dep(name = "rules_zstd")
local_path_override(
module_name = "rules_zstd",
path = "..",
......
This diff is collapsed.
load("@rules_diff//diff/file/test:defs.bzl", "diff_file_test")
load("@rules_zstd//zstd/compress:defs.bzl", "zstd_compress")
load("@rules_zstd//zstd/decompress:defs.bzl", "zstd_decompress")
zstd_compress(
name = "compress",
src = "//fixture:hello-world.txt",
level = 3,
)
zstd_decompress(
name = "decompress",
src = ":compress",
)
diff_file_test(
name = "zstd",
size = "small",
a = "//fixture:hello-world.txt",
b = ":decompress",
)
......@@ -8,6 +8,7 @@ DOC = """Compresses a file with the Zstandard algorithm, optionally it can take
zstd_compress(
name = "compress",
src = "some/file.txt",
level = 1-22,
dictionary = "optional/path/to/dictionary",
)
```
......@@ -19,6 +20,12 @@ ATTRS = {
mandatory = True,
allow_single_file = True,
),
"level": attr.int(
doc = "The compression level.",
mandatory = False,
default = 3,
values = [l for l in range(1, 23)],
),
"dictionary": attr.label(
doc = "A dictionary that has been pre-trained with a relevant dataset for the `src` to be compressed.",
mandatory = False,
......@@ -45,7 +52,12 @@ def implementation(ctx):
args.add("-D").add(ctx.file.dictionary)
inputs.append(ctx.file.dictionary)
if ctx.attr.level >= 19:
args.add("--ultra")
args.add("-zfk").add(ctx.file.src)
args.add("-{}".format(ctx.attr.level))
args.add("-o").add(output)
ctx.actions.run(
......
......@@ -8,7 +8,7 @@ toolchain_type(
ape_toolchain(
name = "ape",
toolchain = "@ape//:zstd",
toolchain = "@ape//ape/toolchain/info:zstd",
toolchain_type = ":type",
)
......