Linker error when depending on CGO shared library

90 views
Skip to first unread message

jayaprabhakar k

unread,
Aug 25, 2025, 6:08:36 AM (11 days ago) Aug 25
to bazel-...@googlegroups.com
I have a bazel project (gazelle, go). I want to depend on a third party library that uses cgo. I am facing issues getting it to work.

Without bazel, on a sample code, importing the library with go get works without any issues.
```
go get github.com/kuzudb/go-kuzu
```
So I believe it is not an issue with the library.

On the bazel project,
I did `go get`, and `bazel mod tidy`. This added the following line to go.mod

```
github.com/kuzudb/go-kuzu v0.11.2 
```
and
```
use_repo(
    go_deps,
    # ...
    "com_github_kuzudb_go_kuzu",
    # ...
)
```
Finally, when adding `"@com_github_kuzudb_go_kuzu//:go_default_library",` this dependency, and building it, it fails with this error.

```
bazel build //internal/fizzmo/...
INFO: Analyzed target //internal/fizzmo:fizzmo (0 packages loaded, 0 targets configured).
ERROR: /private/var/tmp/_bazel_jp/a7c8f2887abd7b400d77836efd0fb61e/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/BUILD.bazel:3:11: GoCompilePkg external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a failed: (Exit 1): builder failed: error executing GoCompilePkg command (from target @@gazelle++go_deps+com_github_kuzudb_go_kuzu//:go-kuzu) bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/builder_reset/builder compilepkg -sdk external/rules_go++go_sdk+main___download_0 -goroot ... (remaining 61 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
ld: warning: search path 'external/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin' not found
ld: library 'kuzu' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
compilepkg: error running subcommand external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh: exit status 1
Target //internal/fizzmo:fizzmo failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.991s, Critical Path: 1.89s
INFO: 3 processes: 10 action cache hit, 2 internal, 1 darwin-sandbox.
ERROR: Build did NOT complete successfully
```

Following another comment from a different thread. I tried adding this flags `--@io_bazel_rules_go//go/config:pure`? and  `--host_platform=@io_bazel_rules_go//go/toolchain:darwin_arm64`
With either of these, it still failed this error.
```
bazel build //internal/fizzmo/... --host_platform=@rules_go//go/toolchain:darwin_arm64
WARNING: Build option --host_platform has changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
INFO: Analyzed target //internal/fizzmo:fizzmo (138 packages loaded, 13161 targets configured).
INFO: From Linking external/protobuf+/src/google/protobuf/io/libio_win32.a [for tool]:
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin_arm64-opt-exec-ST-3ce2bc80fb23/bin/external/protobuf+/src/google/protobuf/io/libio_win32.a the table of contents is empty (no object file members in the library define global symbols)
ERROR: /private/var/tmp/_bazel_jp/a7c8f2887abd7b400d77836efd0fb61e/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/BUILD.bazel:3:11: GoCompilePkg external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a failed: (Exit 1): builder failed: error executing GoCompilePkg command (from target @@gazelle++go_deps+com_github_kuzudb_go_kuzu//:go-kuzu) bazel-out/darwin_arm64-opt-exec-ST-3ce2bc80fb23/bin/external/rules_go++go_sdk+main___download_0/builder_reset/builder compilepkg -sdk external/rules_go++go_sdk+main___download_0 -goroot ... (remaining 47 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go:61:18: undefined: DefaultSystemConfig
external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go:87:13: undefined: OpenDatabase
external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go:122:7: undefined: Database
external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go:135:15: undefined: OpenConnection
external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go:146:8: undefined: Connection
external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go:205:9: undefined: PreparedStatement
external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go:206:9: undefined: Connection
external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go:297:6: undefined: QueryResult
compilepkg: error running subcommand external/rules_go++go_sdk+main___download_0/pkg/tool/darwin_arm64/compile: exit status 2
Target //internal/fizzmo:fizzmo failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 43.264s, Critical Path: 25.39s
INFO: 959 processes: 435 internal, 524 darwin-sandbox.
ERROR: Build did NOT complete successfully

```
Same error for `--@rules_go//go/config:pure` as well

----

How do I fix this? Can someone please help with how to get this work? 

jayaprabhakar k

unread,
Sep 2, 2025, 3:59:31 PM (2 days ago) Sep 2
to bazel-discuss
Hi, can someone help with this? Does bazel really work with Go projects that depends on the CGO libraries? 

Filip Filmar

unread,
Sep 2, 2025, 4:20:58 PM (2 days ago) Sep 2
to jayaprabhakar k, bazel-discuss
It should work in general, I have a few projects that use
`mattn/go-sqlite3` which is also CGO I think, and they work fine.

Have you tried to run with `--subcommands` and `--sandbox_debug` to
check how much truth there is in the error messages? Do you have a
minimal repro repository?

Looks like your first listed attempt is having issues finding the
dynamic library at the path it prints out, and I suspect that attempts
at custom flag builds might have made things worse. Specifically the
"pure" build config is supposed to disable CGO, which will make it
hard to get the cgo functionality going in that library. Mac builds
seem to also require some additional setup, see README.md.

F
> --
> You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/bazel-discuss/15c81076-f2ce-4d59-a38d-25dbf73d4b3an%40googlegroups.com.

Filip Filmar

unread,
Sep 2, 2025, 6:00:21 PM (2 days ago) Sep 2
to jayaprabhakar k, bazel-discuss
The problem seems to be that the `BUILD.bazel` created for go-kuzu is not including the dynamic libraries anywhere. 

So when your code attempts to compile your library, the compilation does not have these files in the sandbox at the expected location and linking fails.

It is not clear to me whether rules_go are expected to understand this or not. The BUILD.bazel file they generate is obviously wrong.

F


On Tue, Sep 2, 2025 at 2:18 PM jayaprabhakar k <jayapr...@gmail.com> wrote:
Thanks Filip. 

Here is the minimal example repo: https://github.com/jayaprabhakar/bazel-kuzu-cgo-example

And, I've pasted the log from with the --subcommands and sandbox_debug flags ` --subcommands --sandbox_debug`

In the Kuzu repo, the shared libraries are checked in within the repo. I am not sure it makes a difference, for example: https://github.com/kuzudb/go-kuzu/tree/master/lib/dynamic/darwin.


bazel build //:kuzu-go-example  --subcommands --sandbox_debug

```

INFO: Analyzed target //:kuzu-go-example (0 packages loaded, 0 targets configured).

SUBCOMMAND: # @@gazelle++go_deps+com_github_kuzudb_go_kuzu//:go-kuzu [action 'GoCompilePkg external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a', configuration: 0de042f7f216bd39770efda4fe9ac141f679167720307fb3637d83903e80fc71, execution platform: @@platforms//host:host, mnemonic: GoCompilePkg]

(cd /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/execroot/_main && \

  exec env - \

    CC=external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh \

    CGO_ENABLED=1 \

    GOARCH=arm64 \

    GODEBUG='winsymlink=0' \

    GOEXPERIMENT='' \

    GOOS=darwin \

    GOPATH='' \

    GOROOT=bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ \

    GOROOT_FINAL=GOROOT \

    GOTOOLCHAIN=local \

    PATH=external/rules_cc++cc_configure_extension+local_config_cc:/usr/bin:/bin \

    ZERO_AR_DATE=1 \

  bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/builder_reset/builder compilepkg -sdk external/rules_go++go_sdk+main___download_0 -goroot bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ -installsuffix darwin_arm64 -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/cgo_shared.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/connection.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/database.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/flat_tuple.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/kuzu.h -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/prepared_statement.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/query_result.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/time_helper.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/value_helper.go -arc 'github.com/google/uuid=github.com/google/uuid=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_google_uuid/uuid.x' -arc 'github.com/shopspring/decimal=github.com/shopspring/decimal=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_shopspring_decimal/decimal.x' -importpath github.com/kuzudb/go-kuzu -p github.com/kuzudb/go-kuzu -package_list bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/packages.txt -pack bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/pack_reset/pack.exe -embedroot '' -embedroot bazel-out/darwin_arm64-fastbuild/bin -embedlookupdir external/gazelle++go_deps+com_github_kuzudb_go_kuzu -lo bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a -o bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.x -gcflags '' -cgo_go_srcs bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu_/go-kuzu.a.cgo -cppflags '-I external/gazelle++go_deps+com_github_kuzudb_go_kuzu -iquote .' -cflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -cxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -ldflags '-mmacosx-version-min=10.11 -no-canonical-prefixes -fobjc-link-runtime -headerpad_max_install_names -lc++ -lm -lc++ -Lexternal/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin -lkuzu -Wl,-rpath,external/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin')

# Configuration: 0de042f7f216bd39770efda4fe9ac141f679167720307fb3637d83903e80fc71

# Execution platform: @@platforms//host:host

# Runner: sandbox-fallback

ERROR: /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/BUILD.bazel:3:11: GoCompilePkg external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a failed: (Exit 1): sandbox-exec failed: error executing GoCompilePkg command 

  (cd /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/sandbox/darwin-sandbox/54/execroot/_main && \

  exec env - \

    CC=external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh \

    CGO_ENABLED=1 \

    GOARCH=arm64 \

    GODEBUG='winsymlink=0' \

    GOEXPERIMENT='' \

    GOOS=darwin \

    GOPATH='' \

    GOROOT=bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ \

    GOROOT_FINAL=GOROOT \

    GOTOOLCHAIN=local \

    PATH=external/rules_cc++cc_configure_extension+local_config_cc:/usr/bin:/bin \

    TMPDIR=/var/folders/vv/zf7_jpcj25sb6x2cm3_qnc800000gn/T/ \

    ZERO_AR_DATE=1 \

  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/sandbox/darwin-sandbox/54/sandbox.sb /var/tmp/_bazel_jp/install/238d60da91a7fad3983c54b8c9e828b0/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/sandbox/darwin-sandbox/54/stats.out' bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/builder_reset/builder compilepkg -sdk external/rules_go++go_sdk+main___download_0 -goroot bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ -installsuffix darwin_arm64 -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/cgo_shared.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/connection.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/database.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/flat_tuple.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/kuzu.h -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/prepared_statement.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/query_result.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/time_helper.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/value_helper.go -arc 'github.com/google/uuid=github.com/google/uuid=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_google_uuid/uuid.x' -arc 'github.com/shopspring/decimal=github.com/shopspring/decimal=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_shopspring_decimal/decimal.x' -importpath github.com/kuzudb/go-kuzu -p github.com/kuzudb/go-kuzu -package_list bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/packages.txt -pack bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/pack_reset/pack.exe -embedroot '' -embedroot bazel-out/darwin_arm64-fastbuild/bin -embedlookupdir external/gazelle++go_deps+com_github_kuzudb_go_kuzu -lo bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a -o bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.x -gcflags '' -cgo_go_srcs bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu_/go-kuzu.a.cgo -cppflags '-I external/gazelle++go_deps+com_github_kuzudb_go_kuzu -iquote .' -cflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -cxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -ldflags '-mmacosx-version-min=10.11 -no-canonical-prefixes -fobjc-link-runtime -headerpad_max_install_names -lc++ -lm -lc++ -Lexternal/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin -lkuzu -Wl,-rpath,external/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin')

ld: warning: search path 'external/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin' not found

ld: library 'kuzu' not found

clang: error: linker command failed with exit code 1 (use -v to see invocation)

compilepkg: error running subcommand external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh: exit status 1

Target //:kuzu-go-example failed to build

Use --verbose_failures to see the command lines of failed build steps.

INFO: Elapsed time: 2.231s, Critical Path: 2.13s

INFO: 2 processes: 2 internal.

ERROR: Build did NOT complete successfully

```

Filip Filmar

unread,
Sep 2, 2025, 6:05:42 PM (2 days ago) Sep 2
to jayaprabhakar k, bazel-discuss
Yes, adding the following into the go-kuzu build file makes the compilation work. I didn't work out the platform-specific library selection, but this should be enough to demo what the correct incantation should be. I think you can use `go_deps.patches` to fix the BUILD file up so that it compiles.

```
cc_library(
  name = "so"
  srcs = ["lib/dynamic/linux-amd64/libkuzu.so"],
)

go_library(
  name = "go-kuzu", 
  # ADDED HERE:
  cdeps = [":so"],
)
```

Filip Filmar

unread,
Sep 2, 2025, 6:11:40 PM (2 days ago) Sep 2
to jayaprabhakar k, bazel-discuss
On Tue, Sep 2, 2025 at 3:05 PM Filip Filmar <fil...@gmail.com> wrote:
I think you can use `go_deps.patches`

Correction, it's the `patches` param of `go_deps.archive_override`.

And to close this off, my `mattn/go-sqlite3` works because it includes the "amalgamation" sqlite3 source file in the build, which cgo knows how to use.

F

jayaprabhakar k

unread,
Sep 2, 2025, 7:53:59 PM (2 days ago) Sep 2
to bazel-discuss
Thanks Filipe.
Here is the minimum repository to reproduce this issue. 
https://github.com/jayaprabhakar/bazel-kuzu-cgo-example

(Naive `go run .` would run - and fail with datafile not found, unrelated to this issue)

When I ran with this 
`bazel build //:kuzu-go-example  --subcommands --sandbox_debug`



```
INFO: Analyzed target //:kuzu-go-example (0 packages loaded, 0 targets configured).
SUBCOMMAND: # @@gazelle++go_deps+com_github_kuzudb_go_kuzu//:go-kuzu [action 'GoCompilePkg external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a', configuration: 0de042f7f216bd39770efda4fe9ac141f679167720307fb3637d83903e80fc71, execution platform: @@platforms//host:host, mnemonic: GoCompilePkg]
(cd /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/execroot/_main && \
  exec env - \
    CC=external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh \
    CGO_ENABLED=1 \
    GOARCH=arm64 \
    GODEBUG='winsymlink=0' \
    GOEXPERIMENT='' \
    GOOS=darwin \
    GOPATH='' \
    GOROOT=bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ \
    GOROOT_FINAL=GOROOT \
    GOTOOLCHAIN=local \
    PATH=external/rules_cc++cc_configure_extension+local_config_cc:/usr/bin:/bin \
    ZERO_AR_DATE=1 \
  bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/builder_reset/builder compilepkg -sdk external/rules_go++go_sdk+main___download_0 -goroot bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ -installsuffix darwin_arm64 -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/cgo_shared.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/connection.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/database.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/flat_tuple.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/kuzu.h -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/prepared_statement.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/query_result.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/time_helper.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/value_helper.go -arc 'github.com/google/uuid=github.com/google/uuid=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_google_uuid/uuid.x' -arc 'github.com/shopspring/decimal=github.com/shopspring/decimal=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_shopspring_decimal/decimal.x' -importpath github.com/kuzudb/go-kuzu -p github.com/kuzudb/go-kuzu -package_list bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/packages.txt -pack bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/pack_reset/pack.exe -embedroot '' -embedroot bazel-out/darwin_arm64-fastbuild/bin -embedlookupdir external/gazelle++go_deps+com_github_kuzudb_go_kuzu -lo bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a -o bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.x -gcflags '' -cgo_go_srcs bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu_/go-kuzu.a.cgo -cppflags '-I external/gazelle++go_deps+com_github_kuzudb_go_kuzu -iquote .' -cflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -cxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -ldflags '-mmacosx-version-min=10.11 -no-canonical-prefixes -fobjc-link-runtime -headerpad_max_install_names -lc++ -lm -lc++ -Lexternal/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin -lkuzu -Wl,-rpath,external/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin')
# Configuration: 0de042f7f216bd39770efda4fe9ac141f679167720307fb3637d83903e80fc71
# Execution platform: @@platforms//host:host
# Runner: sandbox-fallback
ERROR: /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/BUILD.bazel:3:11: GoCompilePkg external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a failed: (Exit 1): sandbox-exec failed: error executing GoCompilePkg command
  (cd /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/sandbox/darwin-sandbox/54/execroot/_main && \
  exec env - \
    CC=external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh \
    CGO_ENABLED=1 \
    GOARCH=arm64 \
    GODEBUG='winsymlink=0' \
    GOEXPERIMENT='' \
    GOOS=darwin \
    GOPATH='' \
    GOROOT=bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ \
    GOROOT_FINAL=GOROOT \
    GOTOOLCHAIN=local \
    PATH=external/rules_cc++cc_configure_extension+local_config_cc:/usr/bin:/bin \
    TMPDIR=/var/folders/vv/zf7_jpcj25sb6x2cm3_qnc800000gn/T/ \
    ZERO_AR_DATE=1 \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/sandbox/darwin-sandbox/54/sandbox.sb /var/tmp/_bazel_jp/install/238d60da91a7fad3983c54b8c9e828b0/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/sandbox/darwin-sandbox/54/stats.out' bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/builder_reset/builder compilepkg -sdk external/rules_go++go_sdk+main___download_0 -goroot bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ -installsuffix darwin_arm64 -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/cgo_shared.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/connection.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/database.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/flat_tuple.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/kuzu.h -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/prepared_statement.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/query_result.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/time_helper.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/value_helper.go -arc 'github.com/google/uuid=github.com/google/uuid=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_google_uuid/uuid.x' -arc 'github.com/shopspring/decimal=github.com/shopspring/decimal=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_shopspring_decimal/decimal.x' -importpath github.com/kuzudb/go-kuzu -p github.com/kuzudb/go-kuzu -package_list bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/packages.txt -pack bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/pack_reset/pack.exe -embedroot '' -embedroot bazel-out/darwin_arm64-fastbuild/bin -embedlookupdir external/gazelle++go_deps+com_github_kuzudb_go_kuzu -lo bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a -o bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.x -gcflags '' -cgo_go_srcs bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu_/go-kuzu.a.cgo -cppflags '-I external/gazelle++go_deps+com_github_kuzudb_go_kuzu -iquote .' -cflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -cxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -ldflags '-mmacosx-version-min=10.11 -no-canonical-prefixes -fobjc-link-runtime -headerpad_max_install_names -lc++ -lm -lc++ -Lexternal/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin -lkuzu -Wl,-rpath,external/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin')

ld: warning: search path 'external/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin' not found
ld: library 'kuzu' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
compilepkg: error running subcommand external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh: exit status 1
Target //:kuzu-go-example failed to build

Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.231s, Critical Path: 2.13s
INFO: 2 processes: 2 internal.
ERROR: Build did NOT complete successfully
```

jayaprabhakar k

unread,
Sep 2, 2025, 7:53:59 PM (2 days ago) Sep 2
to Filip Filmar, bazel-discuss
Thanks Filip. 

Here is the minimal example repo: https://github.com/jayaprabhakar/bazel-kuzu-cgo-example

And, I've pasted the log from with the --subcommands and sandbox_debug flags ` --subcommands --sandbox_debug`

In the Kuzu repo, the shared libraries are checked in within the repo. I am not sure it makes a difference, for example: https://github.com/kuzudb/go-kuzu/tree/master/lib/dynamic/darwin.


bazel build //:kuzu-go-example  --subcommands --sandbox_debug

```

INFO: Analyzed target //:kuzu-go-example (0 packages loaded, 0 targets configured).

SUBCOMMAND: # @@gazelle++go_deps+com_github_kuzudb_go_kuzu//:go-kuzu [action 'GoCompilePkg external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a', configuration: 0de042f7f216bd39770efda4fe9ac141f679167720307fb3637d83903e80fc71, execution platform: @@platforms//host:host, mnemonic: GoCompilePkg]

(cd /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/execroot/_main && \

  exec env - \

    CC=external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh \

    CGO_ENABLED=1 \

    GOARCH=arm64 \

    GODEBUG='winsymlink=0' \

    GOEXPERIMENT='' \

    GOOS=darwin \

    GOPATH='' \

    GOROOT=bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ \

    GOROOT_FINAL=GOROOT \

    GOTOOLCHAIN=local \

    PATH=external/rules_cc++cc_configure_extension+local_config_cc:/usr/bin:/bin \

    ZERO_AR_DATE=1 \

  bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/builder_reset/builder compilepkg -sdk external/rules_go++go_sdk+main___download_0 -goroot bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ -installsuffix darwin_arm64 -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/cgo_shared.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/connection.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/database.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/flat_tuple.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/kuzu.h -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/prepared_statement.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/query_result.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/time_helper.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/value_helper.go -arc 'github.com/google/uuid=github.com/google/uuid=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_google_uuid/uuid.x' -arc 'github.com/shopspring/decimal=github.com/shopspring/decimal=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_shopspring_decimal/decimal.x' -importpath github.com/kuzudb/go-kuzu -p github.com/kuzudb/go-kuzu -package_list bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/packages.txt -pack bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/pack_reset/pack.exe -embedroot '' -embedroot bazel-out/darwin_arm64-fastbuild/bin -embedlookupdir external/gazelle++go_deps+com_github_kuzudb_go_kuzu -lo bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a -o bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.x -gcflags '' -cgo_go_srcs bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu_/go-kuzu.a.cgo -cppflags '-I external/gazelle++go_deps+com_github_kuzudb_go_kuzu -iquote .' -cflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -cxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -ldflags '-mmacosx-version-min=10.11 -no-canonical-prefixes -fobjc-link-runtime -headerpad_max_install_names -lc++ -lm -lc++ -Lexternal/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin -lkuzu -Wl,-rpath,external/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin')

# Configuration: 0de042f7f216bd39770efda4fe9ac141f679167720307fb3637d83903e80fc71

# Execution platform: @@platforms//host:host

# Runner: sandbox-fallback

ERROR: /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/BUILD.bazel:3:11: GoCompilePkg external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a failed: (Exit 1): sandbox-exec failed: error executing GoCompilePkg command 

  (cd /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/sandbox/darwin-sandbox/54/execroot/_main && \

  exec env - \

    CC=external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh \

    CGO_ENABLED=1 \

    GOARCH=arm64 \

    GODEBUG='winsymlink=0' \

    GOEXPERIMENT='' \

    GOOS=darwin \

    GOPATH='' \

    GOROOT=bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ \

    GOROOT_FINAL=GOROOT \

    GOTOOLCHAIN=local \

    PATH=external/rules_cc++cc_configure_extension+local_config_cc:/usr/bin:/bin \

    TMPDIR=/var/folders/vv/zf7_jpcj25sb6x2cm3_qnc800000gn/T/ \

    ZERO_AR_DATE=1 \

  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/sandbox/darwin-sandbox/54/sandbox.sb /var/tmp/_bazel_jp/install/238d60da91a7fad3983c54b8c9e828b0/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_jp/28ffd577cce0e38c47a5df6e21b01b01/sandbox/darwin-sandbox/54/stats.out' bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/builder_reset/builder compilepkg -sdk external/rules_go++go_sdk+main___download_0 -goroot bazel-out/darwin_arm64-fastbuild/bin/external/rules_go+/stdlib_ -installsuffix darwin_arm64 -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/cgo_shared.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/connection.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/database.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/driver.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/flat_tuple.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/kuzu.h -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/prepared_statement.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/query_result.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/time_helper.go -src external/gazelle++go_deps+com_github_kuzudb_go_kuzu/value_helper.go -arc 'github.com/google/uuid=github.com/google/uuid=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_google_uuid/uuid.x' -arc 'github.com/shopspring/decimal=github.com/shopspring/decimal=bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_shopspring_decimal/decimal.x' -importpath github.com/kuzudb/go-kuzu -p github.com/kuzudb/go-kuzu -package_list bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/packages.txt -pack bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_go++go_sdk+main___download_0/pack_reset/pack.exe -embedroot '' -embedroot bazel-out/darwin_arm64-fastbuild/bin -embedlookupdir external/gazelle++go_deps+com_github_kuzudb_go_kuzu -lo bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.a -o bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu.x -gcflags '' -cgo_go_srcs bazel-out/darwin_arm64-fastbuild/bin/external/gazelle++go_deps+com_github_kuzudb_go_kuzu/go-kuzu_/go-kuzu.a.cgo -cppflags '-I external/gazelle++go_deps+com_github_kuzudb_go_kuzu -iquote .' -cflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -cxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -std=c++17 -mmacosx-version-min=10.11 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -ldflags '-mmacosx-version-min=10.11 -no-canonical-prefixes -fobjc-link-runtime -headerpad_max_install_names -lc++ -lm -lc++ -Lexternal/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin -lkuzu -Wl,-rpath,external/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin')

ld: warning: search path 'external/gazelle++go_deps+com_github_kuzudb_go_kuzu/lib/dynamic/darwin' not found

ld: library 'kuzu' not found

clang: error: linker command failed with exit code 1 (use -v to see invocation)

compilepkg: error running subcommand external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh: exit status 1

Target //:kuzu-go-example failed to build

Use --verbose_failures to see the command lines of failed build steps.

INFO: Elapsed time: 2.231s, Critical Path: 2.13s

INFO: 2 processes: 2 internal.

ERROR: Build did NOT complete successfully

```

On Tue, 2 Sept 2025 at 13:20, Filip Filmar <fil...@gmail.com> wrote:

jayaprabhakar k

unread,
Sep 2, 2025, 7:53:59 PM (2 days ago) Sep 2
to Filip Filmar, bazel-discuss
Thanks. Adding the cdeps worked. I'll check how to use the `go_deps.archive_override`.

BTW, what is ` "amalgamation" sqlite3 source file`? I couldn't find any information about it. Is it typically recommended for the go projects, I can ask the owner of the Kuzu project to add it to their repo.
Reply all
Reply to author
Forward
0 new messages