-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to get the linux arm64 cgo build working again
- Loading branch information
Showing
4 changed files
with
124 additions
and
142 deletions.
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
This file was deleted.
Oops, something went wrong.
Empty file.
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,110 @@ | ||
diff --git a/BUILD.bazel b/BUILD.bazel | ||
new file mode 100644 | ||
index 0000000..2dd6245 | ||
--- /dev/null | ||
+++ b/BUILD.bazel | ||
@@ -0,0 +1,75 @@ | ||
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
+ | ||
+cc_library( | ||
+ name = "libzstd", | ||
+ srcs = select({ | ||
+ "@io_bazel_rules_go//go/platform:android_amd64": ["libzstd_linux_amd64.a"], | ||
+ "@io_bazel_rules_go//go/platform:android_arm": ["libzstd_linux_arm.a"], | ||
+ "@io_bazel_rules_go//go/platform:android_arm64": ["libzstd_linux_arm64.a"], | ||
+ "@io_bazel_rules_go//go/platform:darwin_amd64": ["libzstd_darwin_amd64.a"], | ||
+ "@io_bazel_rules_go//go/platform:darwin_arm64": ["libzstd_darwin_arm64.a"], | ||
+ "@io_bazel_rules_go//go/platform:freebsd_amd64": ["libzstd_freebsd_amd64.a"], | ||
+ "@io_bazel_rules_go//go/platform:ios_amd64": ["libzstd_darwin_amd64.a"], | ||
+ "@io_bazel_rules_go//go/platform:ios_arm64": ["libzstd_darwin_arm64.a"], | ||
+ "@io_bazel_rules_go//go/platform:linux_amd64": ["libzstd_linux_amd64.a"], | ||
+ "@io_bazel_rules_go//go/platform:linux_arm": ["libzstd_linux_arm.a"], | ||
+ "@io_bazel_rules_go//go/platform:linux_arm64": ["libzstd_linux_arm64.a"], | ||
+ "@io_bazel_rules_go//go/platform:windows_amd64": ["libzstd_windows_amd64.a"], | ||
+ "//conditions:default": ["UNSUPPORTED_PLATFORM"], | ||
+ }), | ||
+ hdrs = [ | ||
+ "zdict.h", | ||
+ "zstd.h", | ||
+ "zstd_errors.h", | ||
+ ], | ||
+) | ||
+ | ||
+go_library( | ||
+ name = "gozstd", | ||
+ srcs = [ | ||
+ "dict.go", | ||
+ "doc.go", | ||
+ "gozstd.go", | ||
+ "libzstd_darwin_amd64.go", | ||
+ "libzstd_darwin_arm64.go", | ||
+ "libzstd_freebsd_amd64.go", | ||
+ "libzstd_linux_amd64.go", | ||
+ "libzstd_linux_arm.go", | ||
+ "libzstd_linux_arm64.go", | ||
+ "libzstd_windows_amd64.go", | ||
+ "reader.go", | ||
+ "stream.go", | ||
+ "writer.go", | ||
+ ], | ||
+ cdeps = [":libzstd"], | ||
+ cgo = True, | ||
+ copts = ["-O3"], | ||
+ importpath = "github.com/valyala/gozstd", | ||
+ visibility = ["//visibility:public"], | ||
+) | ||
+ | ||
+alias( | ||
+ name = "go_default_library", | ||
+ actual = ":gozstd", | ||
+ visibility = ["//visibility:public"], | ||
+) | ||
+ | ||
+go_test( | ||
+ name = "gozstd_test", | ||
+ srcs = [ | ||
+ "dict_example_test.go", | ||
+ "dict_test.go", | ||
+ "gozstd_example_test.go", | ||
+ "gozstd_test.go", | ||
+ "gozstd_timing_test.go", | ||
+ "reader_example_test.go", | ||
+ "reader_test.go", | ||
+ "reader_timing_test.go", | ||
+ "stream_test.go", | ||
+ "stream_timing_test.go", | ||
+ "writer_example_test.go", | ||
+ "writer_test.go", | ||
+ "writer_timing_test.go", | ||
+ ], | ||
+ embed = [":gozstd"], | ||
+) | ||
diff --git a/MODULE.bazel b/MODULE.bazel | ||
new file mode 100644 | ||
index 0000000..150b214 | ||
--- /dev/null | ||
+++ b/MODULE.bazel | ||
@@ -0,0 +1,14 @@ | ||
+module( | ||
+ name = "gozstd", | ||
+ version = "0.1", | ||
+) | ||
+ | ||
+bazel_dep(name = "io_bazel_rules_go", version = "0.50.1") | ||
+bazel_dep(name = "gazelle", version = "0.38.0") | ||
+ | ||
+# Download an SDK for the host OS & architecture as well as common remote execution platforms. | ||
+go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk") | ||
+go_sdk.download(version = "1.23.0") | ||
+ | ||
+go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") | ||
+go_deps.from_file(go_mod = "//:go.mod") | ||
diff --git a/go.mod b/go.mod | ||
index f422410..0df723d 100644 | ||
--- a/go.mod | ||
+++ b/go.mod | ||
@@ -1,3 +1,3 @@ | ||
module github.com/valyala/gozstd | ||
|
||
-go 1.12 | ||
+go 1.17 |