Skip to content

Commit

Permalink
clean up changes to ease review
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisirhc committed Nov 13, 2024
1 parent 24dce21 commit 7af1503
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions toolchain/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,6 @@ def _zig_repository_impl(repository_ctx):
# https://bazel.build/extending/repo#when_is_the_implementation_function_executed
# and a related rules_go PR:
# https://github.com/bazelbuild/bazel-gazelle/pull/1206
macos_sdk_versions_str = _macos_versions(repository_ctx.attr.macos_sdk_versions)
repository_ctx.symlink(Label("//toolchain/platform:BUILD"), "platform/BUILD")
repository_ctx.template(
"BUILD",
Label("//toolchain:BUILD.sdk.bazel"),
executable = False,
substitutions = {
"{zig_sdk_path}": _quote("external/zig_sdk"),
"{os}": _quote(os),
"{macos_sdk_versions}": macos_sdk_versions_str,
},
)

for dest, src in {
"toolchain/BUILD": "//toolchain/toolchain:BUILD.sdk.bazel",
"libc/BUILD": "//toolchain/libc:BUILD.sdk.bazel",
Expand All @@ -193,6 +180,19 @@ def _zig_repository_impl(repository_ctx):
},
)

macos_sdk_versions_str = _macos_versions(repository_ctx.attr.macos_sdk_versions)
repository_ctx.symlink(Label("//toolchain/platform:BUILD"), "platform/BUILD")
repository_ctx.template(
"BUILD",
Label("//toolchain:BUILD.sdk.bazel"),
executable = False,
substitutions = {
"{zig_sdk_path}": _quote("external/zig_sdk"),
"{os}": _quote(os),
"{macos_sdk_versions}": macos_sdk_versions_str,
},
)

urls = [uf.format(**format_vars) for uf in repository_ctx.attr.url_formats]
repository_ctx.download_and_extract(
auth = use_netrc(read_user_netrc(repository_ctx), urls, {}),
Expand Down

0 comments on commit 7af1503

Please sign in to comment.