-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switches to the statically linked UUtils `musl` variant.
- Loading branch information
1 parent
1344458
commit 725ed7b
Showing
4 changed files
with
239 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
module( | ||
name = "rules_coreutils", | ||
version = "1.0.0-beta.3", | ||
bazel_compatibility = [ | ||
">=7.0.0", | ||
], | ||
compatibility_level = 1, | ||
) | ||
|
||
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.9") | ||
bazel_dep(name = "download_utils", version = "1.0.0-beta.2") | ||
bazel_dep(name = "ape", version = "1.0.0-beta.6") | ||
|
||
archive = use_repo_rule("@download_utils//download/archive:defs.bzl", "download_archive") | ||
|
||
[ | ||
archive( | ||
name = "coreutils-{}".format(triplet), | ||
srcs = ["entrypoint"], | ||
integrity = integrity, | ||
links = { | ||
"coreutils.exe" if "windows" in basename else "coreutils": "entrypoint", | ||
}, | ||
strip_prefix = "coreutils-0.0.26-{}".format(basename.partition(".")[0]), | ||
urls = ["https://github.com/uutils/coreutils/releases/download/0.0.26/coreutils-0.0.26-{}".format(basename)], | ||
) | ||
for triplet, basename, integrity in ( | ||
("arm64-linux-gnu", "aarch64-unknown-linux-gnu.tar.gz", "sha256-hYfQ6ZLx9pwP4GMBYAH42kvJnETjIAV7X/zdpCk2QUI="), | ||
("amd64-linux-gnu", "x86_64-unknown-linux-gnu.tar.gz", "sha256-ZKgqe7xNZcCjrvVsEnyW+GJ5zf0k+hVsTq9pXLAKvz4="), | ||
("arm64-linux-musl", "aarch64-unknown-linux-musl.tar.gz", "sha256-9zGLFOMDjUDbraDY/hrE5zFJ0O+QYrvx2wHk3Gw3q/A="), | ||
("amd64-linux-musl", "x86_64-unknown-linux-musl.tar.gz", "sha256-QpGVp3wmHqpt5Brd/bdj7pyMQNftcihOtaRI8z2uhp0="), | ||
("amd64-windows-msvc", "x86_64-pc-windows-msvc.zip", "sha256-6qPkqxQZM4XBBBJ80t1uvzfZiz0gBeT/zoCdfqOO3uk="), | ||
("arm64-macos-darwin", "aarch64-apple-darwin.tar.gz", "sha256-/A6CNYWmvOwPW443pH+wO+VtzDFgussN1hRGuANnFOU="), | ||
) | ||
] | ||
|
||
archive( | ||
name = "coreutils-amd64-macos-darwin", | ||
srcs = ["entrypoint"], | ||
integrity = "sha256-SswetVAuK/hMK1r9uBvNnKj5JpSgD0bzkbsHTxOabCo=", | ||
links = {"coreutils": "entrypoint"}, | ||
strip_prefix = "coreutils-0.0.23-x86_64-apple-darwin", | ||
urls = ["https://github.com/uutils/coreutils/releases/download/0.0.23/coreutils-0.0.23-x86_64-apple-darwin.tar.gz"], | ||
) | ||
|
||
select = use_repo_rule("@toolchain_utils//toolchain/local/select:defs.bzl", "toolchain_local_select") | ||
|
||
select( | ||
name = "coreutils", | ||
map = { | ||
"amd64-linux": "@coreutils-amd64-linux-musl", | ||
"arm64-linux": "@coreutils-arm64-linux-musl", | ||
"amd64-windows": "@coreutils-amd64-windows-msvc", | ||
"arm64-macos-darwin": "@coreutils-arm64-macos-darwin", | ||
"amd64-macos-darwin": "@coreutils-amd64-macos-darwin", | ||
}, | ||
) | ||
|
||
export = use_extension("@toolchain_utils//toolchain/export:defs.bzl", "toolchain_export") | ||
export.symlink( | ||
name = "coreutils", | ||
target = "@coreutils", | ||
) | ||
|
||
deb = use_repo_rule("@download_utils//download/deb:defs.bzl", "download_deb") | ||
|
||
deb( | ||
name = "busybox-arm64-linux", | ||
srcs = ["busybox"], | ||
integrity = "sha256-C0+0zi0/0Woc11BTX5d1ugxC2GOeE9ZjUka6g6DUvc8=", | ||
strip_prefix = "bin", | ||
urls = ["http://ftp.uk.debian.org/debian/pool/main/b/busybox/busybox-static_1.35.0-4+b3_arm64.deb"], | ||
) | ||
|
||
deb( | ||
name = "busybox-amd64-linux", | ||
srcs = ["busybox"], | ||
integrity = "sha256-rMRMIHKVuGEU2kiV71Ouvxhr8839wmmloaCer6xqYNs=", | ||
strip_prefix = "bin", | ||
urls = ["http://ftp.uk.debian.org/debian/pool/main/b/busybox/busybox-static_1.35.0-4+b3_amd64.deb"], | ||
) | ||
|
||
resolved = use_repo_rule("@toolchain_utils//toolchain/resolved:defs.bzl", "toolchain_resolved") | ||
|
||
which = use_repo_rule("@toolchain_utils//toolchain/local/which:defs.bzl", "toolchain_local_which") | ||
|
||
[ | ||
( | ||
resolved( | ||
name = "resolved-{}".format(tool), | ||
basename = tool, | ||
toolchain_type = "//coreutils/toolchain/{}:type".format(tool), | ||
), | ||
which( | ||
name = "which-{}".format(tool), | ||
basename = tool, | ||
), | ||
) | ||
for tool in ( | ||
"busybox", | ||
"coreutils", | ||
"arch", | ||
"b2sum", | ||
"base32", | ||
"base64", | ||
"basename", | ||
"basenc", | ||
"cat", | ||
"chcon", | ||
"chgrp", | ||
"chmod", | ||
"chown", | ||
"chroot", | ||
"cksum", | ||
"comm", | ||
"cp", | ||
"csplit", | ||
"cut", | ||
"date", | ||
"dd", | ||
"df", | ||
"dir", | ||
"dircolors", | ||
"dirname", | ||
"du", | ||
"echo", | ||
"env", | ||
"expand", | ||
"expr", | ||
"factor", | ||
"false", | ||
"fmt", | ||
"fold", | ||
"head", | ||
"hostname", | ||
"hostid", | ||
"id", | ||
"install", | ||
"join", | ||
"link", | ||
"ln", | ||
"logname", | ||
"ls", | ||
"md5sum", | ||
"mkdir", | ||
"mkfifo", | ||
"mknod", | ||
"mktemp", | ||
"more", | ||
"mv", | ||
"nice", | ||
"nl", | ||
"nohup", | ||
"nproc", | ||
"numfmt", | ||
"od", | ||
"paste", | ||
"pathchk", | ||
"pinky", | ||
"pr", | ||
"printenv", | ||
"printf", | ||
"ptx", | ||
"pwd", | ||
"readlink", | ||
"realpath", | ||
"rm", | ||
"rmdir", | ||
"runcon", | ||
"seq", | ||
"sha1sum", | ||
"sha224sum", | ||
"sha256sum", | ||
"sha3sum", | ||
"sha384sum", | ||
"sha512sum", | ||
"shred", | ||
"shuf", | ||
"sleep", | ||
"sort", | ||
"split", | ||
"stat", | ||
"stdbuf", | ||
"stty", | ||
"sum", | ||
"sync", | ||
"tac", | ||
"tail", | ||
"tee", | ||
"test", | ||
"timeout", | ||
"touch", | ||
"tr", | ||
"true", | ||
"truncate", | ||
"uname", | ||
"unexpand", | ||
"uniq", | ||
"unlink", | ||
"users", | ||
"vdir", | ||
"wc", | ||
"who", | ||
"whoami", | ||
"yes", | ||
) | ||
] | ||
|
||
register_toolchains("//coreutils/toolchain/...") |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
bcr_test_module: | ||
module_path: e2e | ||
matrix: | ||
bazel: | ||
- 7.x | ||
platform: | ||
- centos7_java11_devtoolset10 | ||
- debian10 | ||
- debian11 | ||
- ubuntu2004 | ||
- ubuntu2004_arm64 | ||
- ubuntu2204 | ||
- fedora39 | ||
- macos | ||
- macos_arm64 | ||
- windows | ||
tasks: | ||
e2e_tests: | ||
name: Run end-to-end Tests | ||
bazel: ${{ bazel }} | ||
platform: ${{ platform }} | ||
test_targets: | ||
- "//..." |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"url": "https://gitlab.arm.com/bazel/rules_coreutils/-/releases/v1.0.0-beta.3/downloads/src.tar.gz", | ||
"integrity": "sha512-78hjgTconWPm3F7ryP6ZLwc49gSV7Feu/L7wq1Kc1RMC3cxgmbFbxd9cSfS/dccgzJsTcnvcy1n/CX44duc98Q==", | ||
"strip_prefix": "rules_coreutils-v1.0.0-beta.3" | ||
} |
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