-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wanted: marcboeker/go-duckdb #2517
Comments
patchesThis directory contains patch files for selected bazel external workspaces. patches/com_github_apache_arrow_go_v14_arrow_cdata.patchThis patch is needed because patches/com_github_marcboeker_go_duckdb.libduckdb.patchThis patch is needed because gazelle looks for lines like Also, gazelle does not automatically generate Regenerating PatchesTo recreate the patch file, use your preferred technique to do so. One way is
com_github_apache_arrow_go_v14_arrow_cdata.patch--- a/arrow/cdata/BUILD.bazel
+++ b/arrow/cdata/BUILD.bazel
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_source")
go_library(
name = "cdata",
@@ -8,6 +8,7 @@ go_library(
"exports.go",
"interface.go",
"trampoline.c",
+ ":headers",
],
cgo = True,
importpath = "github.com/apache/arrow/go/v14/arrow/cdata",
@@ -31,3 +32,11 @@ alias(
actual = ":cdata",
visibility = ["//visibility:public"],
)
+
+go_source(
+ name = "headers",
+ srcs = [
+ "arrow/c/abi.h",
+ "arrow/c/helpers.h",
+ ],
+) com_github_marcboeker_go_duckdb.libduckdb.patchdiff --git a/BUILD.bazel b/BUILD.bazel
index 8285865..37e192e 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -18,49 +18,83 @@ go_library(
"transaction.go",
"types.go",
],
+ cdeps = select({
+ "@io_bazel_rules_go//go/platform:android_amd64": [
+ "//deps/linux_amd64:libduckdb",
+ ],
+ "@io_bazel_rules_go//go/platform:android_arm64": [
+ "//deps/linux_arm64:libduckdb",
+ ],
+ "@io_bazel_rules_go//go/platform:darwin_386": [
+ ],
+ "@io_bazel_rules_go//go/platform:darwin_amd64": [
+ "//deps/darwin_amd64:libduckdb",
+ ],
+ "@io_bazel_rules_go//go/platform:darwin_arm": [
+ ],
+ "@io_bazel_rules_go//go/platform:darwin_arm64": [
+ "//deps/darwin_arm64:libduckdb",
+ ],
+ "@io_bazel_rules_go//go/platform:freebsd_amd64": [
+ "//deps/freebsd_amd64:libduckdb",
+ ],
+ "@io_bazel_rules_go//go/platform:ios_amd64": [
+ "//deps/darwin_amd64:libduckdb",
+ ],
+ "@io_bazel_rules_go//go/platform:ios_arm64": [
+ "//deps/darwin_arm64:libduckdb",
+ ],
+ "@io_bazel_rules_go//go/platform:linux_amd64": [
+ "//deps/linux_amd64:libduckdb",
+ ],
+ "@io_bazel_rules_go//go/platform:linux_arm64": [
+ "//deps/linux_arm64:libduckdb",
+ ],
+ "//conditions:default": [],
+ }),
cgo = True,
clinkopts = select({
"@io_bazel_rules_go//go/platform:android_amd64": [
"-lduckdb",
- "-lstdc++ -lm -ldl -Ldeps/linux_amd64",
+ "-lstdc++ -lm -ldl -Lexternal/com_github_marcboeker_go_duckdb/deps/linux_amd64",
],
"@io_bazel_rules_go//go/platform:android_arm64": [
"-lduckdb",
- "-lstdc++ -lm -ldl -Ldeps/linux_arm64",
+ "-lstdc++ -lm -ldl -Lexternal/com_github_marcboeker_go_duckdb/deps/linux_arm64",
],
"@io_bazel_rules_go//go/platform:darwin_386": [
"-lduckdb",
],
"@io_bazel_rules_go//go/platform:darwin_amd64": [
- "-lc++ -Ldeps/darwin_amd64",
+ "-lc++ -Lexternal/com_github_marcboeker_go_duckdb/deps/darwin_amd64",
"-lduckdb",
],
"@io_bazel_rules_go//go/platform:darwin_arm": [
"-lduckdb",
],
"@io_bazel_rules_go//go/platform:darwin_arm64": [
- "-lc++ -Ldeps/darwin_arm64",
+ "-lc++ -Lexternal/com_github_marcboeker_go_duckdb/deps/darwin_arm64",
"-lduckdb",
],
"@io_bazel_rules_go//go/platform:freebsd_amd64": [
"-lduckdb",
- "-lstdc++ -lm -ldl -Ldeps/freebsd_amd64",
+ "-lstdc++ -lm -ldl -Lexternal/com_github_marcboeker_go_duckdb/deps/freebsd_amd64",
],
"@io_bazel_rules_go//go/platform:ios_amd64": [
"-lc++ -Ldeps/darwin_amd64",
"-lduckdb",
],
"@io_bazel_rules_go//go/platform:ios_arm64": [
- "-lc++ -Ldeps/darwin_arm64",
+ "-lc++ -Lexternal/com_github_marcboeker_go_duckdb/deps/darwin_arm64",
"-lduckdb",
],
"@io_bazel_rules_go//go/platform:linux_amd64": [
"-lduckdb",
- "-lstdc++ -lm -ldl -Ldeps/linux_amd64",
+ "-lstdc++ -lm -ldl -Lexternal/com_github_marcboeker_go_duckdb/deps/linux_amd64",
],
"@io_bazel_rules_go//go/platform:linux_arm64": [
"-lduckdb",
- "-lstdc++ -lm -ldl -Ldeps/linux_arm64",
+ "-lstdc++ -lm -ldl -Lexternal/com_github_marcboeker_go_duckdb/deps/linux_arm64",
],
"//conditions:default": [],
}),
diff --git a/deps/darwin_amd64/BUILD.bazel b/deps/darwin_amd64/BUILD.bazel
index 471671e..4f508b6 100644
--- a/deps/darwin_amd64/BUILD.bazel
+++ b/deps/darwin_amd64/BUILD.bazel
@@ -12,3 +12,9 @@ alias(
actual = ":darwin_amd64",
visibility = ["//visibility:public"],
)
+
+cc_library(
+ name = "libduckdb",
+ srcs = ["libduckdb.a"],
+ visibility = ["//visibility:public"],
+)
diff --git a/deps/darwin_arm64/BUILD.bazel b/deps/darwin_arm64/BUILD.bazel
index edc81b3..848fe8b 100644
--- a/deps/darwin_arm64/BUILD.bazel
+++ b/deps/darwin_arm64/BUILD.bazel
@@ -12,3 +12,9 @@ alias(
actual = ":darwin_arm64",
visibility = ["//visibility:public"],
)
+
+cc_library(
+ name = "libduckdb",
+ srcs = ["libduckdb.a"],
+ visibility = ["//visibility:public"],
+)
diff --git a/deps/freebsd_amd64/BUILD.bazel b/deps/freebsd_amd64/BUILD.bazel
index 849a7e3..f347669 100644
--- a/deps/freebsd_amd64/BUILD.bazel
+++ b/deps/freebsd_amd64/BUILD.bazel
@@ -12,3 +12,9 @@ alias(
actual = ":freebsd_amd64",
visibility = ["//visibility:public"],
)
+
+cc_library(
+ name = "libduckdb",
+ srcs = ["libduckdb.a"],
+ visibility = ["//visibility:public"],
+)
diff --git a/deps/linux_amd64/BUILD.bazel b/deps/linux_amd64/BUILD.bazel
index 0acbb38..23be608 100644
--- a/deps/linux_amd64/BUILD.bazel
+++ b/deps/linux_amd64/BUILD.bazel
@@ -12,3 +12,9 @@ alias(
actual = ":linux_amd64",
visibility = ["//visibility:public"],
)
+
+cc_library(
+ name = "libduckdb",
+ srcs = ["libduckdb.a"],
+ visibility = ["//visibility:public"],
+)
diff --git a/deps/linux_arm64/BUILD.bazel b/deps/linux_arm64/BUILD.bazel
index 64200d5..5c7fba0 100644
--- a/deps/linux_arm64/BUILD.bazel
+++ b/deps/linux_arm64/BUILD.bazel
@@ -12,3 +12,9 @@ alias(
actual = ":linux_arm64",
visibility = ["//visibility:public"],
)
+
+cc_library(
+ name = "libduckdb",
+ srcs = ["libduckdb.a"],
+ visibility = ["//visibility:public"],
+) |
Thanks for working on this! Feel free to submit a patched module just like That said, I am planning to adapt the |
Submitted. We don't use bzlmod yet, and I don't have much bazel experience. I just wanted to share this for anyone else interested. |
Module location
https://github.com/marcboeker/go-duckdb
Link to bzlmod issue in the module's repository
No response
Any other context to provide?
We just worked with @pcj to get go-duckdb building, and I wanted to make it publicly available in case anyone else is interested. This appears to be similar to https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/circl
com_github_apache_arrow_go_v14_arrow_cdata.patch
com_github_marcboeker_go_duckdb.libduckdb.patch
README.md
Fund our work
The text was updated successfully, but these errors were encountered: