diff --git a/modules/zstd/1.5.5.bcr.1/MODULE.bazel b/modules/zstd/1.5.5.bcr.1/MODULE.bazel new file mode 100644 index 00000000000..4fc95665f2b --- /dev/null +++ b/modules/zstd/1.5.5.bcr.1/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") \ No newline at end of file diff --git a/modules/zstd/1.5.5.bcr.1/patches/add_build_file.patch b/modules/zstd/1.5.5.bcr.1/patches/add_build_file.patch new file mode 100644 index 00000000000..d014d3401a3 --- /dev/null +++ b/modules/zstd/1.5.5.bcr.1/patches/add_build_file.patch @@ -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", ++ ], ++) diff --git a/modules/zstd/1.5.5.bcr.1/patches/module_dot_bazel.patch b/modules/zstd/1.5.5.bcr.1/patches/module_dot_bazel.patch new file mode 100644 index 00000000000..2220a455e2f --- /dev/null +++ b/modules/zstd/1.5.5.bcr.1/patches/module_dot_bazel.patch @@ -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") diff --git a/modules/zstd/1.5.5.bcr.1/presubmit.yml b/modules/zstd/1.5.5.bcr.1/presubmit.yml new file mode 100644 index 00000000000..2c897bdeafe --- /dev/null +++ b/modules/zstd/1.5.5.bcr.1/presubmit.yml @@ -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" diff --git a/modules/zstd/1.5.5.bcr.1/source.json b/modules/zstd/1.5.5.bcr.1/source.json new file mode 100644 index 00000000000..88a3f18ce46 --- /dev/null +++ b/modules/zstd/1.5.5.bcr.1/source.json @@ -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 +} diff --git a/modules/zstd/metadata.json b/modules/zstd/metadata.json index 7b0c114f46d..101078df4b3 100644 --- a/modules/zstd/metadata.json +++ b/modules/zstd/metadata.json @@ -10,7 +10,8 @@ "github:facebook/zstd" ], "versions": [ - "1.5.5" + "1.5.5", + "1.5.5.bcr.1" ], "yanked_versions": {} }