From b4261c43cab011019fb04f217d1728ffb16e02c6 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 4 Dec 2023 11:15:55 -0700 Subject: [PATCH 1/7] chore: upgrade to Bazel 7.0.0rc5 --- .bazeliskrc | 2 +- MODULE.bazel | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.bazeliskrc b/.bazeliskrc index 72fbf2d..7c75a11 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1 +1 @@ -USE_BAZEL_VERSION=5.3.0 +USE_BAZEL_VERSION=7.0.0rc5 diff --git a/MODULE.bazel b/MODULE.bazel index d36ec60..0e1baee 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -3,12 +3,13 @@ module( version = "0.3.0", compatibility_level = 0, ) + bazel_dep(name = "bazel_skylib", version = "1.2.1") bazel_dep(name = "platforms", version = "0.0.5") -bazel_dep(name = "stardoc", version = "0.5.1", repo_name = "io_bazel_stardoc", dev_dependency = True) -sh_configure = use_extension("//bzlmod:extensions.bzl", "sh_configure") +bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc") +sh_configure = use_extension("//bzlmod:extensions.bzl", "sh_configure") use_repo(sh_configure, "local_posix_config", "rules_sh_shim_exe") register_toolchains("@local_posix_config//...") From ef5b894137ba7455d6c289555290971967736e3b Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 4 Dec 2023 11:19:15 -0700 Subject: [PATCH 2/7] Add 7.0.0rc5 --- .github/workflows/workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 760ff17..e4bb819 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -20,7 +20,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-2019] bazel_mode: [workspace, module] - version: ["5.3.0", "6.0.0"] + version: ["5.3.0", "6.0.0", "7.0.0rc5"] exclude: - version: 5.3.0 bazel_mode: module From 46d68b008d06f2fe499fa92605f638845a08fcb2 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 4 Dec 2023 11:48:36 -0700 Subject: [PATCH 3/7] Add debug flag --- .bazelrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bazelrc b/.bazelrc index b78b836..8fdd449 100644 --- a/.bazelrc +++ b/.bazelrc @@ -19,3 +19,7 @@ try-import %workspace%/.bazelrc.auth # Try to load any configuration that is specific for this host try-import %workspace%/.bazelrc.local + +# DEBUG BEGIN +build --toolchain_resolution_debug='@@rules_sh~override//sh/posix:toolchain_type' +# DEBUG END From 2205738f62561f005bf4599091e1b90684dab499 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 4 Dec 2023 12:16:18 -0700 Subject: [PATCH 4/7] Upgrade platforms to latest. Try to address toolchain resolution issue. --- MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index 0e1baee..6b944b9 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -5,7 +5,7 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.2.1") -bazel_dep(name = "platforms", version = "0.0.5") +bazel_dep(name = "platforms", version = "0.0.8") bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc") From 2be95f92fec1a5f49c70f109650232dc0a33f0e1 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 4 Dec 2023 12:32:46 -0700 Subject: [PATCH 5/7] Add debug code. --- sh/posix.bzl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sh/posix.bzl b/sh/posix.bzl index 2e52784..0829c66 100644 --- a/sh/posix.bzl +++ b/sh/posix.bzl @@ -136,6 +136,10 @@ def _sh_posix_config_impl(repository_ctx): cpu = get_cpu_value(repository_ctx) env = repository_ctx.os.environ + # DEBUG BEGIN + print("*** CHUCK _sh_posix_config_impl cpu: ", cpu) + # DEBUG END + windows_sh_dir = None if cpu == "x64_windows": windows_sh_dir = _windows_detect_sh_dir(repository_ctx) @@ -179,15 +183,15 @@ toolchain( if cmd_path ]), arch = { - "darwin_arm64": "arm64", - "arm64_windows": "arm64", "aarch64": "arm64", + "arm64_windows": "arm64", + "darwin_arm64": "arm64", }.get(cpu, "x86_64"), os = { + "arm64_windows": "windows", "darwin": "osx", "darwin_arm64": "osx", "x64_windows": "windows", - "arm64_windows": "windows", }.get(cpu, "linux"), toolchain_type = TOOLCHAIN_TYPE, )) From 134651288c3628aee2e791a6995dd5158dfdd9eb Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 4 Dec 2023 12:37:12 -0700 Subject: [PATCH 6/7] Add darwin_x86_64 as a CPU value that can be returned in Bazel 7.0.0. --- sh/posix.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/sh/posix.bzl b/sh/posix.bzl index 0829c66..81395d2 100644 --- a/sh/posix.bzl +++ b/sh/posix.bzl @@ -191,6 +191,7 @@ toolchain( "arm64_windows": "windows", "darwin": "osx", "darwin_arm64": "osx", + "darwin_x86_64": "osx", "x64_windows": "windows", }.get(cpu, "linux"), toolchain_type = TOOLCHAIN_TYPE, From f7928c21f80df9189449661a1c93fe42c6b7df50 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 4 Dec 2023 12:42:48 -0700 Subject: [PATCH 7/7] Remove debug code --- .bazelrc | 4 ---- sh/posix.bzl | 4 ---- 2 files changed, 8 deletions(-) diff --git a/.bazelrc b/.bazelrc index 8fdd449..b78b836 100644 --- a/.bazelrc +++ b/.bazelrc @@ -19,7 +19,3 @@ try-import %workspace%/.bazelrc.auth # Try to load any configuration that is specific for this host try-import %workspace%/.bazelrc.local - -# DEBUG BEGIN -build --toolchain_resolution_debug='@@rules_sh~override//sh/posix:toolchain_type' -# DEBUG END diff --git a/sh/posix.bzl b/sh/posix.bzl index 81395d2..e41543f 100644 --- a/sh/posix.bzl +++ b/sh/posix.bzl @@ -136,10 +136,6 @@ def _sh_posix_config_impl(repository_ctx): cpu = get_cpu_value(repository_ctx) env = repository_ctx.os.environ - # DEBUG BEGIN - print("*** CHUCK _sh_posix_config_impl cpu: ", cpu) - # DEBUG END - windows_sh_dir = None if cpu == "x64_windows": windows_sh_dir = _windows_detect_sh_dir(repository_ctx)