-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: local zig_sdk repo that symlinks to exec based on host
- Loading branch information
1 parent
19d4aca
commit b8ad790
Showing
4 changed files
with
45 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
load("@hermetic_cc_toolchain//toolchain:defs.bzl", zig_toolchains = "toolchains") | ||
load("@hermetic_cc_toolchain//toolchain:defs.bzl", "host_zig_repository", zig_toolchains = "toolchains") | ||
|
||
_COMMON_EXEC_PLATFORMS = [ | ||
("linux", "amd64"), | ||
("linux", "arm64"), | ||
("windows", "amd64"), | ||
("macos", "arm64"), | ||
("macos", "amd64"), | ||
] | ||
|
||
def _toolchains_impl(ctx): | ||
for os, arch in _COMMON_EXEC_PLATFORMS: | ||
zig_toolchains(exec = "{}-{}".format(os, arch)) | ||
|
||
zig_toolchains(exec_os = os, exec_arch = arch) | ||
|
||
host_zig_repository(name = "zig_sdk") | ||
return ctx.extension_metadata( | ||
root_module_direct_deps= ["zig_sdk-{}-{}".format(os, arch) for os, arch in _COMMON_EXEC_PLATFORMS], | ||
root_module_direct_dev_deps=[], | ||
) | ||
|
||
root_module_direct_deps = ["zig_sdk"] + ["zig_sdk-{}-{}".format(os, arch) for os, arch in _COMMON_EXEC_PLATFORMS], | ||
root_module_direct_dev_deps = [], | ||
) | ||
|
||
toolchains = module_extension(implementation = _toolchains_impl) |