Skip to content

Commit

Permalink
add hermetic_cc_toolchain to cross-compile cloudflare/circl
Browse files Browse the repository at this point in the history
  • Loading branch information
albertocavalcante committed Aug 13, 2024
1 parent 6ec750a commit 69286b6
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
17 changes: 17 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ bazel_dep(name = "gazelle", version = "0.37.0")
# Version must be kept in sync with the one in go.mod
bazel_dep(name = "circl", version = "1.3.7")

# circl has cc_library targets which needs a C++ toolchain
bazel_dep(name = "hermetic_cc_toolchain", version = "3.1.0")

toolchains = use_extension("@hermetic_cc_toolchain//toolchain:ext.bzl", "toolchains")
use_repo(toolchains, "zig_sdk")

register_toolchains(
# Linux
# Use musl as per:
# https://honnef.co/articles/statically-compiled-go-programs-always-even-with-cgo-using-musl/
"@zig_sdk//toolchain:linux_amd64_musl",
"@zig_sdk//toolchain:linux_arm64_musl",
# Windows
"@zig_sdk//toolchain:windows_amd64",
"@zig_sdk//toolchain:windows_arm64",
)

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.22.6")
go_sdk.nogo(nogo = "//:garf_nogo")
Expand Down
52 changes: 52 additions & 0 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 69286b6

Please sign in to comment.