-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* duplicate v1.5.5 to v1.5.5.bcr.1 * change BUILD.bazel patch * update MODULE.bazel version * Add Bazel test matrix * change patch back to -p0 format * Update patch hash * rm lib from includes of fullbench * update hash again * add version to metadata.json * fix other hash * fix version in MODULE.bazel * review --------- Co-authored-by: Xùdōng Yáng <wyverald@gmail.com>
- Loading branch information
Showing
6 changed files
with
177 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module( | ||
name = "zstd", | ||
version = "1.5.5.bcr.1", | ||
compatibility_level = 1, | ||
) | ||
bazel_dep(name = "rules_cc", version = "0.0.9") | ||
bazel_dep(name = "platforms", version = "0.0.8") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
diff --git BUILD.bazel BUILD.bazel | ||
new file mode 100644 | ||
index 00000000..7fca1671 | ||
--- /dev/null | ||
+++ BUILD.bazel | ||
@@ -0,0 +1,127 @@ | ||
+""" Builds zstd. | ||
+""" | ||
+ | ||
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") | ||
+ | ||
+package(default_visibility = ["//visibility:public"]) | ||
+ | ||
+filegroup( | ||
+ name = "common_sources", | ||
+ srcs = glob([ | ||
+ "lib/common/*.c", | ||
+ "lib/common/*.h", | ||
+ ]), | ||
+) | ||
+ | ||
+filegroup( | ||
+ name = "compress_sources", | ||
+ srcs = glob([ | ||
+ "lib/compress/*.c", | ||
+ "lib/compress/*.h", | ||
+ ]), | ||
+) | ||
+ | ||
+filegroup( | ||
+ name = "decompress_sources", | ||
+ srcs = glob([ | ||
+ "lib/decompress/*.c", | ||
+ "lib/decompress/*.h", | ||
+ ]) + select({ | ||
+ "@platforms//os:windows": [], | ||
+ "//conditions:default": glob(["lib/decompress/*.S"]), | ||
+ }), | ||
+) | ||
+ | ||
+filegroup( | ||
+ name = "dictbuilder_sources", | ||
+ srcs = glob([ | ||
+ "lib/dictBuilder/*.c", | ||
+ "lib/dictBuilder/*.h", | ||
+ ]), | ||
+) | ||
+ | ||
+cc_library( | ||
+ name = "zstd", | ||
+ srcs = [ | ||
+ ":common_sources", | ||
+ ":compress_sources", | ||
+ ":decompress_sources", | ||
+ ":dictbuilder_sources", | ||
+ ], | ||
+ hdrs = [ | ||
+ "lib/zdict.h", | ||
+ "lib/zstd.h", | ||
+ "lib/zstd_errors.h", | ||
+ ], | ||
+ includes = ["lib"], | ||
+ linkopts = ["-pthread"], | ||
+ linkstatic = True, | ||
+ local_defines = [ | ||
+ "XXH_NAMESPACE=ZSTD_", | ||
+ "ZSTD_MULTITHREAD", | ||
+ "ZSTD_BUILD_SHARED=OFF", | ||
+ "ZSTD_BUILD_STATIC=ON", | ||
+ ] + select({ | ||
+ "@platforms//os:windows": ["ZSTD_DISABLE_ASM"], | ||
+ "//conditions:default": [], | ||
+ }), | ||
+) | ||
+ | ||
+cc_library( | ||
+ name = "util", | ||
+ srcs = [ | ||
+ "programs/platform.h", | ||
+ "programs/util.c", | ||
+ ], | ||
+ hdrs = [ | ||
+ "lib/common/compiler.h", | ||
+ "lib/common/debug.h", | ||
+ "lib/common/mem.h", | ||
+ "lib/common/portability_macros.h", | ||
+ "lib/common/zstd_deps.h", | ||
+ "programs/util.h", | ||
+ ], | ||
+) | ||
+ | ||
+cc_library( | ||
+ name = "datagen", | ||
+ srcs = [ | ||
+ "programs/datagen.c", | ||
+ "programs/platform.h", | ||
+ ], | ||
+ hdrs = ["programs/datagen.h"], | ||
+ deps = [":util"], | ||
+) | ||
+ | ||
+cc_binary( | ||
+ name = "datagen_cli", | ||
+ srcs = ["tests/datagencli.c"], | ||
+ includes = ["programs"], | ||
+ deps = [":datagen"], | ||
+) | ||
+ | ||
+cc_test( | ||
+ name = "fullbench", | ||
+ srcs = [ | ||
+ "lib/decompress/zstd_decompress_internal.h", | ||
+ "programs/benchfn.c", | ||
+ "programs/benchfn.h", | ||
+ "programs/benchzstd.c", | ||
+ "programs/benchzstd.h", | ||
+ "programs/timefn.c", | ||
+ "programs/timefn.h", | ||
+ "tests/fullbench.c", | ||
+ ], | ||
+ copts = select({ | ||
+ "@platforms//os:windows": [], | ||
+ "//conditions:default": ["-Wno-deprecated-declarations"], | ||
+ }), | ||
+ includes = [ | ||
+ "lib/common", | ||
+ "programs", | ||
+ ], | ||
+ deps = [ | ||
+ ":datagen", | ||
+ ":zstd", | ||
+ ], | ||
+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- MODULE.bazel | ||
+++ MODULE.bazel | ||
@@ -0,0 +1,7 @@ | ||
+module( | ||
+ name = "zstd", | ||
+ version = "1.5.5.bcr.1", | ||
+ compatibility_level = 1, | ||
+) | ||
+bazel_dep(name = "rules_cc", version = "0.0.9") | ||
+bazel_dep(name = "platforms", version = "0.0.8") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
matrix: | ||
platform: | ||
- debian10 | ||
- ubuntu2004 | ||
- macos | ||
- macos_arm64 | ||
- windows | ||
bazel: [6.x, 7.x] | ||
tasks: | ||
run_tests: | ||
name: Run tests | ||
platform: ${{ platform }} | ||
bazel: ${{ bazel }} | ||
test_targets: | ||
- "@zstd//:fullbench" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"url": "https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz", | ||
"integrity": "sha256-nEOWzIKc+uMZpuJhUgLoKq1BNyBzSC/OKG+seGRtPuQ=", | ||
"strip_prefix": "zstd-1.5.5", | ||
"patches": { | ||
"add_build_file.patch": "sha256-Zm8MvkcOsOdnhFmH7jl1iFKx0RX6LouL5SEP5ddmliU=", | ||
"module_dot_bazel.patch": "sha256-+cgXnYCj1fFgNLlMN4v6g6iJ+AYFabXcuL+nIpmtYHs=" | ||
}, | ||
"patch_strip": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,8 @@ | |
"github:facebook/zstd" | ||
], | ||
"versions": [ | ||
"1.5.5" | ||
"1.5.5", | ||
"1.5.5.bcr.1" | ||
], | ||
"yanked_versions": {} | ||
} |