Skip to content

Commit

Permalink
Finish migration to bzlmod
Browse files Browse the repository at this point in the history
- bump bazel to 6.4.0
- bump rules_go, gazelle, platforms
- enable bzlmod
- clear WORKSPACE (cannot remove yet due to examples)
- remove `gofmt`, #136
- remove Go MacOS x86_64 tests, #10
  • Loading branch information
Motiejus Jakštys committed Dec 19, 2023
1 parent f3c605e commit fddba58
Show file tree
Hide file tree
Showing 16 changed files with 3,129 additions and 1,404 deletions.
4 changes: 3 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
common --enable_bzlmod

test --sandbox_default_allow_network=false
test --test_output=errors

Expand All @@ -7,4 +9,4 @@ build --worker_sandboxing
build --experimental_reuse_sandbox_directories
build --incompatible_enable_cc_toolchain_resolution
build --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build --experimental_output_directory_naming_scheme=diff_against_baseline
build --experimental_output_directory_naming_scheme=diff_against_dynamic_baseline
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.0
6.4.0
2 changes: 0 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ steps:
command: ci/prepare_git && ci/test_example rules_cc override_repository
- label: "Test bzlmod example"
command: ci/prepare_git && ci/test_example bzlmod override_module
- label: "mod-tidy and update-repos"
command: tools/mod-tidy && git diff --exit-code
agents:
- "queue=init"
- "docker=*"
5 changes: 0 additions & 5 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ alias(
name = "gazelle",
actual = "//tools/gazelle:gazelle",
)

alias(
name = "gazelle-update-repos",
actual = "//tools/gazelle:gazelle-update-repos",
)
29 changes: 26 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module(
version = "2.1.3",
)

bazel_dep(name = "platforms", version = "0.0.6")
bazel_dep(name = "platforms", version = "0.0.8")

bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True)
bazel_dep(name = "rules_go", version = "0.43.0", dev_dependency = True)

go_sdk = use_extension(
"@rules_go//go:extensions.bzl",
Expand All @@ -14,7 +14,7 @@ go_sdk = use_extension(
)
use_repo(go_sdk, "go_default_sdk")

bazel_dep(name = "gazelle", version = "0.32.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.34.0", dev_dependency = True)

go_deps = use_extension(
"@gazelle//:extensions.bzl",
Expand All @@ -25,4 +25,27 @@ go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_bazelbuild_buildtools",
"com_github_stretchr_testify",
)

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

register_toolchains(
# if no `--platform` is specified, these toolchains will be used for
# (linux,darwin,windows)x(amd64,arm64)
"@zig_sdk//toolchain:linux_amd64_gnu.2.28",
"@zig_sdk//toolchain:linux_arm64_gnu.2.28",
"@zig_sdk//toolchain:darwin_amd64",
"@zig_sdk//toolchain:darwin_arm64",
"@zig_sdk//toolchain:windows_amd64",
"@zig_sdk//toolchain:windows_arm64",

# amd64 toolchains for libc-aware platforms:
"@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.28",
"@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.31",
"@zig_sdk//libc_aware/toolchain:linux_amd64_musl",
# arm64 toolchains for libc-aware platforms:
"@zig_sdk//libc_aware/toolchain:linux_arm64_gnu.2.28",
"@zig_sdk//libc_aware/toolchain:linux_arm64_musl",
)
Loading

0 comments on commit fddba58

Please sign in to comment.