From 5f078bf281012f67f82c701a9f5db161a2307d63 Mon Sep 17 00:00:00 2001 From: Morten Mjelva Date: Mon, 7 Oct 2024 07:59:52 +0200 Subject: [PATCH] Enable cgo --- .github/workflows/master.yaml | 32 +++++++++---------- .github/workflows/pull-requests.yaml | 14 ++++---- MODULE.bazel | 5 ++- .../workflows_template.diff | 19 +++++++++++ 4 files changed, 46 insertions(+), 24 deletions(-) create mode 100644 patches/com_buildbarn_bb_storage/workflows_template.diff diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml index b320ace..5ff1ff3 100644 --- a/.github/workflows/master.yaml +++ b/.github/workflows/master.yaml @@ -53,11 +53,11 @@ }, { "name": "linux_amd64: build and test", - "run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_amd64 //..." + "run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_amd64_cgo //..." }, { "name": "linux_amd64: copy bb_portal", - "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_amd64 //cmd/bb_portal $(pwd)/bb_portal" + "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_amd64_cgo //cmd/bb_portal $(pwd)/bb_portal" }, { "name": "linux_amd64: upload bb_portal", @@ -69,11 +69,11 @@ }, { "name": "linux_386: build and test", - "run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_386 //..." + "run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_386_cgo //..." }, { "name": "linux_386: copy bb_portal", - "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_386 //cmd/bb_portal $(pwd)/bb_portal" + "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_386_cgo //cmd/bb_portal $(pwd)/bb_portal" }, { "name": "linux_386: upload bb_portal", @@ -85,11 +85,11 @@ }, { "name": "linux_arm: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm //..." + "run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm_cgo //..." }, { "name": "linux_arm: copy bb_portal", - "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm //cmd/bb_portal $(pwd)/bb_portal" + "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm_cgo //cmd/bb_portal $(pwd)/bb_portal" }, { "name": "linux_arm: upload bb_portal", @@ -101,11 +101,11 @@ }, { "name": "linux_arm64: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64 //..." + "run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64_cgo //..." }, { "name": "linux_arm64: copy bb_portal", - "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm64 //cmd/bb_portal $(pwd)/bb_portal" + "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm64_cgo //cmd/bb_portal $(pwd)/bb_portal" }, { "name": "linux_arm64: upload bb_portal", @@ -117,11 +117,11 @@ }, { "name": "darwin_amd64: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64 //..." + "run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64_cgo //..." }, { "name": "darwin_amd64: copy bb_portal", - "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_amd64 //cmd/bb_portal $(pwd)/bb_portal" + "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_amd64_cgo //cmd/bb_portal $(pwd)/bb_portal" }, { "name": "darwin_amd64: upload bb_portal", @@ -133,11 +133,11 @@ }, { "name": "darwin_arm64: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64 //..." + "run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64_cgo //..." }, { "name": "darwin_arm64: copy bb_portal", - "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_arm64 //cmd/bb_portal $(pwd)/bb_portal" + "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_arm64_cgo //cmd/bb_portal $(pwd)/bb_portal" }, { "name": "darwin_arm64: upload bb_portal", @@ -149,11 +149,11 @@ }, { "name": "freebsd_amd64: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_portal" + "run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64_cgo //cmd/bb_portal" }, { "name": "freebsd_amd64: copy bb_portal", - "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_portal $(pwd)/bb_portal" + "run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:freebsd_amd64_cgo //cmd/bb_portal $(pwd)/bb_portal" }, { "name": "freebsd_amd64: upload bb_portal", @@ -165,11 +165,11 @@ }, { "name": "windows_amd64: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //..." + "run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64_cgo //..." }, { "name": "windows_amd64: copy bb_portal", - "run": "rm -f bb_portal.exe && bazel run --run_under cp --platforms=@rules_go//go/toolchain:windows_amd64 //cmd/bb_portal $(pwd)/bb_portal.exe" + "run": "rm -f bb_portal.exe && bazel run --run_under cp --platforms=@rules_go//go/toolchain:windows_amd64_cgo //cmd/bb_portal $(pwd)/bb_portal.exe" }, { "name": "windows_amd64: upload bb_portal", diff --git a/.github/workflows/pull-requests.yaml b/.github/workflows/pull-requests.yaml index 701d5b9..2069faa 100644 --- a/.github/workflows/pull-requests.yaml +++ b/.github/workflows/pull-requests.yaml @@ -57,31 +57,31 @@ }, { "name": "linux_386: build and test", - "run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_386 //..." + "run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_386_cgo //..." }, { "name": "linux_arm: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm //..." + "run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm_cgo //..." }, { "name": "linux_arm64: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64 //..." + "run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64_cgo //..." }, { "name": "darwin_amd64: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64 //..." + "run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64_cgo //..." }, { "name": "darwin_arm64: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64 //..." + "run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64_cgo //..." }, { "name": "freebsd_amd64: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_portal" + "run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64_cgo //cmd/bb_portal" }, { "name": "windows_amd64: build and test", - "run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //..." + "run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64_cgo //..." } ] } diff --git a/MODULE.bazel b/MODULE.bazel index 8f65e5b..c08c07d 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -18,7 +18,10 @@ git_override( git_override( module_name = "com_github_buildbarn_bb_storage", - commit = "8abbcfab01bcde294b20c2070baba9fd242bab7f", + commit = "0941111f29e31905e4081e6262bccf0c123940ed", + patches = [ + "//:patches/com_buildbarn_bb_storage/workflows_template.diff", + ], remote = "https://github.com/buildbarn/bb-storage.git", ) diff --git a/patches/com_buildbarn_bb_storage/workflows_template.diff b/patches/com_buildbarn_bb_storage/workflows_template.diff new file mode 100644 index 0000000..e30f255 --- /dev/null +++ b/patches/com_buildbarn_bb_storage/workflows_template.diff @@ -0,0 +1,19 @@ +diff --git tools/github_workflows/workflows_template.libsonnet tools/github_workflows/workflows_template.libsonnet +index 1016937..16e2de8 100644 +--- tools/github_workflows/workflows_template.libsonnet ++++ tools/github_workflows/workflows_template.libsonnet +@@ -192,12 +192,12 @@ + 'master.yaml': { + name: 'master', + on: { push: { branches: ['main', 'master'] } }, +- jobs: getJobs(binaries, containers, true, false), ++ jobs: getJobs(binaries, containers, true, true), + }, + 'pull-requests.yaml': { + name: 'pull-requests', + on: { pull_request: { branches: ['main', 'master'] } }, +- jobs: getJobs(binaries, containers, false, false), ++ jobs: getJobs(binaries, containers, false, true), + }, + }, + }