Upgrade coreutils and add darwin arm64 binary (#649)

This commit is contained in:
David Zbarsky 2023-11-14 11:47:21 -05:00 committed by GitHub
parent 498c5c851d
commit b74a45456d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 13 deletions

2
docs/repositories.md generated
View File

@ -83,7 +83,7 @@ Registers coreutils toolchain and repositories
| Name | Description | Default Value | | Name | Description | Default Value |
| :------------- | :------------- | :------------- | | :------------- | :------------- | :------------- |
| <a id="register_coreutils_toolchains-name"></a>name | override the prefix for the generated toolchain repositories | <code>"coreutils"</code> | | <a id="register_coreutils_toolchains-name"></a>name | override the prefix for the generated toolchain repositories | <code>"coreutils"</code> |
| <a id="register_coreutils_toolchains-version"></a>version | the version of coreutils to execute (see https://github.com/uutils/coreutils/releases) | <code>"0.0.16"</code> | | <a id="register_coreutils_toolchains-version"></a>version | the version of coreutils to execute (see https://github.com/uutils/coreutils/releases) | <code>"0.0.23"</code> |
| <a id="register_coreutils_toolchains-register"></a>register | whether to call through to native.register_toolchains. Should be True for WORKSPACE users, but false when used under bzlmod extension | <code>True</code> | | <a id="register_coreutils_toolchains-register"></a>register | whether to call through to native.register_toolchains. Should be True for WORKSPACE users, but false when used under bzlmod extension | <code>True</code> |

View File

@ -34,29 +34,33 @@ COREUTILS_PLATFORMS = {
), ),
} }
DEFAULT_COREUTILS_VERSION = "0.0.16" DEFAULT_COREUTILS_VERSION = "0.0.23"
# https://github.com/uutils/coreutils/releases # https://github.com/uutils/coreutils/releases
# #
# The integrity hashes can be automatically fetched for the coreutils releases by running # The integrity hashes can be automatically fetched for the coreutils releases by running
# `tools/coreutils_mirror_release.sh`. # `tools/coreutils_mirror_release.sh`.
COREUTILS_VERSIONS = { COREUTILS_VERSIONS = {
"0.0.16": { "0.0.23": {
"darwin_arm64": {
"filename": "coreutils-0.0.23-aarch64-apple-darwin.tar.gz",
"sha256": "sha256-KP90sjKxtXDbLC+o5f4+gQnvP3Tr7O0RopME4g9QF5E=",
},
"linux_arm64": { "linux_arm64": {
"filename": "coreutils-0.0.16-aarch64-unknown-linux-gnu.tar.gz", "filename": "coreutils-0.0.23-aarch64-unknown-linux-gnu.tar.gz",
"sha256": "sha256-6tExkcMMHe7+59M9Mp9UKeq+g0y+juO7oakZfVOtOqw=", "sha256": "sha256-8wMVMgAgf8JQ2+2LdoewkyDo416VEsf9RlMJl4jiBjk=",
}, },
"darwin_amd64": { "darwin_amd64": {
"filename": "coreutils-0.0.16-x86_64-apple-darwin.tar.gz", "filename": "coreutils-0.0.23-x86_64-apple-darwin.tar.gz",
"sha256": "sha256-lQYWAuPOKS6XxwArZdiKIyczwppTVwjF4ml0iKBaB9s=", "sha256": "sha256-SswetVAuK/hMK1r9uBvNnKj5JpSgD0bzkbsHTxOabCo=",
}, },
"windows_amd64": { "windows_amd64": {
"filename": "coreutils-0.0.16-x86_64-pc-windows-msvc.zip", "filename": "coreutils-0.0.23-x86_64-pc-windows-msvc.zip",
"sha256": "sha256-z5E1onYAKZoaUt2U1cv1t8UHPsJinYktEd6SpE2u07o=", "sha256": "sha256-aglIj5JvFGLm2ABwRzWAsZRTTD3X444V3GxHM9pGJS4=",
}, },
"linux_amd64": { "linux_amd64": {
"filename": "coreutils-0.0.16-x86_64-unknown-linux-gnu.tar.gz", "filename": "coreutils-0.0.23-x86_64-unknown-linux-gnu.tar.gz",
"sha256": "sha256-Slf4qKf19sAWoK2pUVluAitmL3N2uz4eWpV4eibIEW0=", "sha256": "sha256-u7OMW43Y46aXRRIKULfKdfUW51WJn6G70s5Xxwb6/1g=",
}, },
}, },
} }
@ -171,8 +175,6 @@ coreutils_toolchains_repo = repository_rule(
def _coreutils_platform_repo_impl(rctx): def _coreutils_platform_repo_impl(rctx):
is_windows = rctx.attr.platform.startswith("windows_") is_windows = rctx.attr.platform.startswith("windows_")
platform = rctx.attr.platform platform = rctx.attr.platform
if platform == "darwin_arm64":
platform = "darwin_amd64"
filename = COREUTILS_VERSIONS[rctx.attr.version][platform]["filename"] filename = COREUTILS_VERSIONS[rctx.attr.version][platform]["filename"]
url = "https://github.com/uutils/coreutils/releases/download/{}/{}".format( url = "https://github.com/uutils/coreutils/releases/download/{}/{}".format(
rctx.attr.version, rctx.attr.version,