Skip to content
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

Try to get the linux arm64 cgo build working again #783

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@gazelle//:def.bzl", "gazelle")
load("@rules_go//go:def.bzl", "go_binary", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push", "oci_tarball")
load("@rules_pkg//:pkg.bzl", "pkg_tar")

Expand Down
18 changes: 16 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://registry.bazel.build/
bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_go", version = "0.50.1", repo_name = "io_bazel_rules_go")
bazel_dep(name = "gazelle", version = "0.38.0")
bazel_dep(name = "rules_proto", version = "6.0.2")
bazel_dep(name = "rules_pkg", version = "1.0.1")
Expand All @@ -26,7 +26,7 @@ oci.pull(
use_repo(oci, "cgo_arm64_base")

# Download an SDK for the host OS & architecture as well as common remote execution platforms.
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
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")
Expand Down Expand Up @@ -81,6 +81,20 @@ go_deps.module(
sum = "h1:R2ZVGCZzU95oXFJxncosHS9LsX8N4/MYUdGGWOb2cFk=",
version = "v0.4.1-0.20220112235402-e1cee1c72f2f",
)
go_deps.module_override(
patch_strip = 1,
patches = [
"//patches:gozstd.patch",
],
path = "github.com/valyala/gozstd",
)
go_deps.gazelle_override(
directives = [
# The patch applied in go_deps.module_override provides a better/working build config.
"gazelle:ignore on",
],
path = "github.com/valyala/gozstd",
)
use_repo(
go_deps,
"com_github_abbot_go_http_auth",
Expand Down
2 changes: 1 addition & 1 deletion cache/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cache/azblobproxy/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cache/disk/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cache/disk/casblob/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
Expand Down
6 changes: 3 additions & 3 deletions cache/disk/zstdimpl/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load("@rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = [
"gozstd.go",
"zstdimpl.go",
] + select({
"@rules_go//go/toolchain:cgo_on": [
"@io_bazel_rules_go//go/toolchain:cgo_on": [
"cgozstd.go",
],
"//conditions:default": [],
Expand All @@ -18,7 +18,7 @@ go_library(
"@com_github_klauspost_compress//zstd:go_default_library",
"@com_github_mostynb_zstdpool_syncpool//:go_default_library",
] + select({
"@rules_go//go/toolchain:cgo_on": [
"@io_bazel_rules_go//go/toolchain:cgo_on": [
"@com_github_valyala_gozstd//:go_default_library",
],
"//conditions:default": [],
Expand Down
2 changes: 1 addition & 1 deletion cache/gcsproxy/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cache/grpcproxy/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cache/httpproxy/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cache/s3proxy/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion config/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
Expand Down
142 changes: 0 additions & 142 deletions external/gozstd.patch

This file was deleted.

2 changes: 1 addition & 1 deletion genproto/build/bazel/remote/asset/v1/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion genproto/build/bazel/remote/execution/v2/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion genproto/build/bazel/semver/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion ldap/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand Down
Empty file added patches/BUILD.bazel
Empty file.
Loading
Loading