From 86ae317685cd50aff26240a23da68d9d3bde912b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 2 Jun 2022 06:16:39 +0300 Subject: [PATCH] zig sdk: rename {ext} to {_ext} Also update README and release scripts --- README.md | 11 +++++------ relnotes.awk | 2 +- toolchain/defs.bzl | 8 ++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 31dd425..a709204 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ http_archive( name = "bazel-zig-cc", sha256 = "cd2629843fe4ba20cf29e1d73cc02559afba640f884e519b6a194a35627cbbf3", strip_prefix = "bazel-zig-cc-{}".format(BAZEL_ZIG_CC_VERSION), - urls = ["https://git.sr.ht/~motiejus/bazel-zig-cc/archive/{}.tar.gz".format(BAZEL_ZIG_CC_VERSION)], + urls = ["https://git.sr.ht/~motiejus/bazel-zig-cc/archive/{}.{_ext}".format(BAZEL_ZIG_CC_VERSION)], ) load("@bazel-zig-cc//toolchain:defs.bzl", zig_toolchains = "toolchains") @@ -40,7 +40,7 @@ load("@bazel-zig-cc//toolchain:defs.bzl", zig_toolchains = "toolchains") zig_toolchains( version = "<...>", url_formats = [ - "https://example.org/zig/zig-{host_platform}-{version}.tar.xz", + "https://example.org/zig/zig-{host_platform}-{version}.{_ext}", ], host_platform_sha256 = { ... }, ) @@ -320,11 +320,10 @@ is currently not implemented. target macos.10 (Catalina), macos.11 (Big Sur) or macos.12 (Monterey). It currently targets the lowest version, without ability to change it. -## Windows: output file extensions +## Windows only: output file extensions -Bazel won't use common Windows file extensions for built output binaries. -Instead, it will generate binaries with common Unix extensions that you might -have to manually rename before deploying them to an actual Windows system: +For Windows targets Bazel uses Unix extensions for output binaries. Those may +need to be renamed before deploying to the Windows system. Here is a primer: | Binary type | Bazel extension | Windows extension | |----------------|-----------------|-------------------| diff --git a/relnotes.awk b/relnotes.awk index 3ac8a2f..a24720a 100755 --- a/relnotes.awk +++ b/relnotes.awk @@ -14,7 +14,7 @@ BEGIN {stage=0}; print " name = \"bazel-zig-cc\"," print " sha256 = \""sha256sum"\"," print " strip_prefix = \"bazel-zig-cc-{}\".format(BAZEL_ZIG_CC_VERSION)," - print " urls = [\"https://git.sr.ht/~motiejus/bazel-zig-cc/archive/{}.tar.gz\".format(BAZEL_ZIG_CC_VERSION)]," + print " urls = [\"https://git.sr.ht/~motiejus/bazel-zig-cc/archive/{}.{_ext}\".format(BAZEL_ZIG_CC_VERSION)]," print ")" stage=1 next diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl index df2441d..e165a86 100644 --- a/toolchain/defs.bzl +++ b/toolchain/defs.bzl @@ -16,21 +16,21 @@ __asm__(".symver fcntl64, fcntl@GLIBC_2.2.5"); """ # Official recommended version. Should use this when we have a usable release. -URL_FORMAT_RELEASE = "https://ziglang.org/download/{version}/zig-{host_platform}-{version}.{ext}" +URL_FORMAT_RELEASE = "https://ziglang.org/download/{version}/zig-{host_platform}-{version}.{_ext}" # Caution: nightly releases are purged from ziglang.org after ~90 days. A real # solution would be to allow the downstream project specify their own mirrors. # This is explained in # https://sr.ht/~motiejus/bazel-zig-cc/#alternative-download-urls and is # awaiting my attention or your contribution. -URL_FORMAT_NIGHTLY = "https://ziglang.org/builds/zig-{host_platform}-{version}.{ext}" +URL_FORMAT_NIGHTLY = "https://ziglang.org/builds/zig-{host_platform}-{version}.{_ext}" # Author's mirror that doesn't purge the nightlies so aggressively. I will be # cleaning those up manually only after the artifacts are not in use for many # months in bazel-zig-cc. dl.jakstys.lt is a small x86_64 server with an NVMe # drive sitting in my home closet on a 1GB/s symmetric residential connection, # which, as of writing, has been quite reliable. -URL_FORMAT_JAKSTYS = "https://dl.jakstys.lt/zig/zig-{host_platform}-{version}.{ext}" +URL_FORMAT_JAKSTYS = "https://dl.jakstys.lt/zig/zig-{host_platform}-{version}.{_ext}" _VERSION = "0.10.0-dev.2252+a4369918b" @@ -128,7 +128,7 @@ def _zig_repository_impl(repository_ctx): zig_sha256 = repository_ctx.attr.host_platform_sha256[host_platform] zig_ext = repository_ctx.attr.host_platform_ext[host_platform] format_vars = { - "ext": zig_ext, + "_ext": zig_ext, "version": repository_ctx.attr.version, "host_platform": host_platform, }