Skip to content

Commit

Permalink
chore: 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 14, 2023
1 parent fe96892 commit cb41f44
Show file tree
Hide file tree
Showing 13 changed files with 2,102 additions and 719 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
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 @@ -2,9 +2,9 @@ module(
name = "hermetic_cc_toolchain",
)

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 @@ -13,7 +13,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 @@ -24,4 +24,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 cb41f44

Please sign in to comment.