SERVER-104987 fix shfmt os name on macos (#36007)

GitOrigin-RevId: 883173aef3eed69a9f3e61d32984e06f23c6eea7
This commit is contained in:
Daniel Moody 2025-05-09 09:33:18 -05:00 committed by MongoDB Bot
parent e21fa1be90
commit da405b0248
2 changed files with 10 additions and 7 deletions

View File

@ -176,10 +176,6 @@ setup_pigz(
name = "pigz",
)
load("//bazel/format:shfmt.bzl", "shfmt")
shfmt()
# This repository is normally created by db-contrib-tool or manually extracting the binaries at the proper location
new_local_repository(
name = "mongot_localdev",
@ -212,3 +208,7 @@ poetry(
lockfile = "@bazel_rules_mongo//:poetry.lock",
pyproject = "@bazel_rules_mongo//:pyproject.toml",
)
load("//bazel/format:shfmt.bzl", "shfmt")
shfmt()

View File

@ -1,7 +1,7 @@
"""Repository rules for shfmt binary download"""
load("//bazel:utils.bzl", "retry_download")
load("//bazel/platforms:normalize.bzl", "ARCH_TO_PLATFORM_MAP", "OS_TO_PLATFORM_MAP")
load("@bazel_rules_mongo//utils:platforms_normalize.bzl", "ARCH_NORMALIZE_MAP", "OS_NORMALIZE_MAP")
URLS_MAP = {
"linux_aarch64": {
@ -33,8 +33,11 @@ def _shfmt_download(ctx):
Args:
ctx: Repository context.
"""
platform_info = URLS_MAP["{os}_{arch}".format(os = ctx.os.name, arch = ctx.os.arch)]
print(platform_info)
os = ctx.os.name
arch = ctx.os.arch
os_constraint = OS_NORMALIZE_MAP[os]
arch_constraint = ARCH_NORMALIZE_MAP[arch]
platform_info = URLS_MAP["{os}_{arch}".format(os = os_constraint, arch = arch_constraint)]
ctx.report_progress("downloading shfmt")
retry_download(
ctx = ctx,