1

change @com_github_ziglang_zig to @zig_sdk

This commit is contained in:
Motiejus Jakštys 2021-06-10 09:34:59 +03:00 committed by Motiejus Jakštys
parent 23f26dfa7e
commit 4bd7b30f65
4 changed files with 9 additions and 9 deletions

View File

@ -15,13 +15,13 @@ tasks:
//test:gognu //test:gognu
- test_linux-gnu: | - test_linux-gnu: |
cd bazel-zig-cc; ../bazel run \ cd bazel-zig-cc; ../bazel run \
--platforms @com_github_ziglang_zig//:platform_x86_64-linux-gnu \ --platforms @zig_sdk//:platform_x86_64-linux-gnu \
//test:gognu //test:gognu
- test_linux-musl: | - test_linux-musl: |
cd bazel-zig-cc; ../bazel run \ cd bazel-zig-cc; ../bazel run \
--platforms @com_github_ziglang_zig//:platform_x86_64-linux-musl \ --platforms @zig_sdk//:platform_x86_64-linux-musl \
//test:gomusl //test:gomusl
#- test_macos-gnu: | #- test_macos-gnu: |
# cd bazel-zig-cc; ../bazel build --toolchain_resolution_debug=true \ # cd bazel-zig-cc; ../bazel build --toolchain_resolution_debug=true \
# --platforms @com_github_ziglang_zig//:platform_x86_64-macos-gnu \ # --platforms @zig_sdk//:platform_x86_64-macos-gnu \
# //test:gognu # //test:gognu

View File

@ -35,13 +35,13 @@ $ file ../bazel-bin/test/gognu_/gognu
Explicitly the toolchain explicitly `-gnu`: Explicitly the toolchain explicitly `-gnu`:
``` ```
$ bazel run --platforms @com_github_ziglang_zig//:platform_x86_64-linux-gnu //test:gognu $ bazel run --platforms @zig_sdk//:platform_x86_64-linux-gnu //test:gognu
``` ```
## linux cgo + musl ## linux cgo + musl
``` ```
$ bazel build --platforms @com_github_ziglang_zig//:platform_x86_64-linux-musl //test:gomusl $ bazel build --platforms @zig_sdk//:platform_x86_64-linux-musl //test:gomusl
... ...
$ file ../bazel-out/k8-fastbuild-ST-d17813c235ce/bin/test/gomusl_/gomusl $ file ../bazel-out/k8-fastbuild-ST-d17813c235ce/bin/test/gomusl_/gomusl
../bazel-out/k8-fastbuild-ST-d17813c235ce/bin/test/gomusl_/gomusl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=redacted, with debug_info, not stripped ../bazel-out/k8-fastbuild-ST-d17813c235ce/bin/test/gomusl_/gomusl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=redacted, with debug_info, not stripped
@ -54,7 +54,7 @@ hello, world
Does not work? Does not work?
``` ```
$ bazel build --platforms @com_github_ziglang_zig//:platform_x86_64-macos-musl //test:gognu $ bazel build --platforms @zig_sdk//:platform_x86_64-macos-musl //test:gognu
... ...
``` ```

View File

@ -19,7 +19,7 @@ go_binary(
embed = [":go_lib"], embed = [":go_lib"],
static = "on", static = "on",
target_compatible_with = select({ target_compatible_with = select({
"@platforms//os:linux": ["@com_github_ziglang_zig//:musl"], "@platforms//os:linux": ["@zig_sdk//:musl"],
"//conditions:default": [], "//conditions:default": [],
}), }),
visibility = ["//visibility:public"], visibility = ["//visibility:public"],

View File

@ -78,7 +78,7 @@ TARGET_CONFIGS = [
def toolchain_repositories(): def toolchain_repositories():
zig_repository( zig_repository(
name = "com_github_ziglang_zig", name = "zig_sdk",
version = "0.8.0", version = "0.8.0",
url_format = "https://ziglang.org/download/{version}/zig-{host_platform}-{version}.tar.xz", url_format = "https://ziglang.org/download/{version}/zig-{host_platform}-{version}.tar.xz",
@ -96,7 +96,7 @@ def toolchain_repositories():
def register_all_toolchains(): def register_all_toolchains():
for target_config in TARGET_CONFIGS: for target_config in TARGET_CONFIGS:
native.register_toolchains( native.register_toolchains(
"@com_github_ziglang_zig//:%s_toolchain" % target_config.target, "@zig_sdk//:%s_toolchain" % target_config.target,
) )
ZIG_TOOL_PATH = "tools/{zig_tool}" ZIG_TOOL_PATH = "tools/{zig_tool}"