-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch BLAKE3 BUILD file to properly support windows_arm64 (#892)
* Patch BLAKE3 BUILD file to properly support windows_arm64 * Update source.json --------- Co-authored-by: Xùdōng Yáng <[email protected]>
- Loading branch information
1 parent
8f1e10a
commit a1ad78c
Showing
6 changed files
with
105 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,6 @@ | ||
module( | ||
name = "blake3", | ||
version = "1.3.3.bcr.1", | ||
compatibility_level = 1, | ||
) | ||
bazel_dep(name = "rules_cc", version = "0.0.6") |
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,65 @@ | ||
--- /dev/null | ||
+++ BUILD.bazel | ||
@@ -0,0 +1,62 @@ | ||
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") | ||
+ | ||
+cc_library( | ||
+ name = "blake3", | ||
+ srcs = [ | ||
+ "c/blake3.c", | ||
+ "c/blake3_dispatch.c", | ||
+ "c/blake3_portable.c", | ||
+ ] + select({ | ||
+ "@bazel_tools//src/conditions:linux_x86_64": [ | ||
+ "c/blake3_avx2_x86-64_unix.S", | ||
+ # Disable to appease bazel-ci which uses ubuntu-18 (EOL) and GCC 7 | ||
+ # lacking the headers to compile AVX512. | ||
+ # "c/blake3_avx512_x86-64_unix.S", | ||
+ "c/blake3_sse2_x86-64_unix.S", | ||
+ "c/blake3_sse41_x86-64_unix.S", | ||
+ ], | ||
+ "@bazel_tools//src/conditions:linux_aarch64": [ | ||
+ "c/blake3_neon.c", | ||
+ ], | ||
+ "@bazel_tools//src/conditions:windows_x64": [ | ||
+ "c/blake3_avx2_x86-64_windows_msvc.asm", | ||
+ "c/blake3_avx512_x86-64_windows_msvc.asm", | ||
+ "c/blake3_sse2_x86-64_windows_msvc.asm", | ||
+ "c/blake3_sse41_x86-64_windows_msvc.asm", | ||
+ ], | ||
+ "@bazel_tools//src/conditions:windows_arm64": [ | ||
+ "c/blake3_neon.c", | ||
+ ], | ||
+ "@bazel_tools//src/conditions:darwin_arm64": [ | ||
+ "c/blake3_neon.c", | ||
+ ], | ||
+ "//conditions:default": [], | ||
+ }), | ||
+ hdrs = [ | ||
+ "c/blake3.h", | ||
+ "c/blake3_impl.h", | ||
+ ], | ||
+ copts = select({ | ||
+ "@bazel_tools//src/conditions:linux_x86_64": [ | ||
+ "-DBLAKE3_NO_AVX512", | ||
+ ], | ||
+ "@bazel_tools//src/conditions:linux_aarch64": [ | ||
+ "-DBLAKE3_USE_NEON=1", | ||
+ ], | ||
+ "@bazel_tools//src/conditions:windows_x64": [], | ||
+ "@bazel_tools//src/conditions:windows_arm64": [ | ||
+ "-DBLAKE3_USE_NEON=1", | ||
+ ], | ||
+ "@bazel_tools//src/conditions:darwin_arm64": [ | ||
+ "-DBLAKE3_USE_NEON=1", | ||
+ ], | ||
+ "//conditions:default": [ | ||
+ "-DBLAKE3_NO_SSE2", | ||
+ "-DBLAKE3_NO_SSE41", | ||
+ "-DBLAKE3_NO_AVX2", | ||
+ "-DBLAKE3_NO_AVX512", | ||
+ ], | ||
+ }), | ||
+ includes = ["."], | ||
+ visibility = ["//visibility:public"], | ||
+) |
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,9 @@ | ||
--- MODULE.bazel | ||
+++ MODULE.bazel | ||
@@ -0,0 +1,6 @@ | ||
+module( | ||
+ name = "blake3", | ||
+ version = "1.3.3.bcr.1", | ||
+ compatibility_level = 1, | ||
+) | ||
+bazel_dep(name = "rules_cc", version = "0.0.6") |
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,13 @@ | ||
matrix: | ||
platform: | ||
- debian10 | ||
- ubuntu2004 | ||
- macos | ||
- macos_arm64 | ||
- windows | ||
tasks: | ||
verify_targets: | ||
name: Verify build targets | ||
platform: ${{ platform }} | ||
build_targets: | ||
- '@blake3//:blake3' |
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/BLAKE3-team/BLAKE3/archive/refs/tags/1.3.3.tar.gz", | ||
"integrity": "sha256-J9K8TuWUW6dUNIWVIQQslJRj7nUU/xeq7zKOI++D/sA=", | ||
"strip_prefix": "BLAKE3-1.3.3", | ||
"patches": { | ||
"add_build_file.patch": "sha256-lKVoznUHSqWywOo27+g4J0csjL8lH3FEXjAFRJN5+Kw=", | ||
"module_dot_bazel.patch": "sha256-4M/MRHdDFjS8iyVaKqy6QIc5Qea9pblUz7oj6I5aHfg=" | ||
}, | ||
"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 |
---|---|---|
|
@@ -5,7 +5,8 @@ | |
"github:BLAKE3-team/BLAKE3" | ||
], | ||
"versions": [ | ||
"1.3.3" | ||
"1.3.3", | ||
"1.3.3.bcr.1" | ||
], | ||
"yanked_versions": {} | ||
} |