Skip to content

Commit 9e07f49

Browse files
feat(rules_coreutils): add 1.0.0-alpha.8 (#1751)
Adds new `coreutils_sha*sum` rules.
1 parent 961bde7 commit 9e07f49

File tree

4 files changed

+209
-14
lines changed

4 files changed

+209
-14
lines changed

Diff for: modules/rules_coreutils/1.0.0-alpha.8/MODULE.bazel

+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
module(
2+
name = "rules_coreutils",
3+
version = "1.0.0-alpha.8",
4+
bazel_compatibility = [
5+
">=7.0.0",
6+
],
7+
compatibility_level = 1,
8+
)
9+
10+
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.1")
11+
bazel_dep(name = "download_utils", version = "1.0.0-beta.1")
12+
13+
archive = use_repo_rule("@download_utils//download/archive:defs.bzl", "download_archive")
14+
15+
[
16+
archive(
17+
name = "coreutils-{}".format(triplet),
18+
srcs = ["entrypoint"],
19+
integrity = integrity,
20+
links = {
21+
"coreutils.exe" if "windows" in triplet else "coreutils": "entrypoint",
22+
},
23+
strip_prefix = "coreutils-0.0.23-{}".format(slug),
24+
urls = ["https://github.com/uutils/coreutils/releases/download/0.0.23/coreutils-0.0.23-{}.{}".format(
25+
slug,
26+
"zip" if "windows" in triplet else "tar.gz",
27+
)],
28+
)
29+
for triplet, slug, integrity in (
30+
("arm64-linux-gnu", "aarch64-unknown-linux-gnu", "sha256-8wMVMgAgf8JQ2+2LdoewkyDo416VEsf9RlMJl4jiBjk="),
31+
("amd64-linux-gnu", "x86_64-unknown-linux-gnu", "sha256-u7OMW43Y46aXRRIKULfKdfUW51WJn6G70s5Xxwb6/1g="),
32+
("amd64-windows-msvc", "x86_64-pc-windows-msvc", "sha256-aglIj5JvFGLm2ABwRzWAsZRTTD3X444V3GxHM9pGJS4="),
33+
("arm64-macos-darwin", "aarch64-apple-darwin", "sha256-KP90sjKxtXDbLC+o5f4+gQnvP3Tr7O0RopME4g9QF5E="),
34+
("amd64-macos-darwin", "x86_64-apple-darwin", "sha256-SswetVAuK/hMK1r9uBvNnKj5JpSgD0bzkbsHTxOabCo="),
35+
)
36+
]
37+
38+
select = use_repo_rule("@toolchain_utils//toolchain/local/select:defs.bzl", "toolchain_local_select")
39+
40+
select(
41+
name = "coreutils",
42+
map = {
43+
"amd64-linux-gnu": "@coreutils-amd64-linux-gnu",
44+
"arm64-linux-gnu": "@coreutils-arm64-linux-gnu",
45+
"amd64-windows": "@coreutils-amd64-windows-msvc",
46+
"arm64-macos-darwin": "@coreutils-arm64-macos-darwin",
47+
"amd64-macos-darwin": "@coreutils-amd64-macos-darwin",
48+
},
49+
)
50+
51+
export = use_extension("@toolchain_utils//toolchain/export:defs.bzl", "toolchain_export")
52+
export.symlink(
53+
name = "coreutils",
54+
target = "@coreutils",
55+
)
56+
57+
deb = use_repo_rule("@download_utils//download/deb:defs.bzl", "download_deb")
58+
59+
deb(
60+
name = "busybox-arm64-linux",
61+
srcs = ["busybox"],
62+
integrity = "sha256-C0+0zi0/0Woc11BTX5d1ugxC2GOeE9ZjUka6g6DUvc8=",
63+
strip_prefix = "bin",
64+
urls = ["http://ftp.uk.debian.org/debian/pool/main/b/busybox/busybox-static_1.35.0-4+b3_arm64.deb"],
65+
)
66+
67+
deb(
68+
name = "busybox-amd64-linux",
69+
srcs = ["busybox"],
70+
integrity = "sha256-rMRMIHKVuGEU2kiV71Ouvxhr8839wmmloaCer6xqYNs=",
71+
strip_prefix = "bin",
72+
urls = ["http://ftp.uk.debian.org/debian/pool/main/b/busybox/busybox-static_1.35.0-4+b3_amd64.deb"],
73+
)
74+
75+
resolved = use_repo_rule("@toolchain_utils//toolchain/resolved:defs.bzl", "toolchain_resolved")
76+
77+
which = use_repo_rule("@toolchain_utils//toolchain/local/which:defs.bzl", "toolchain_local_which")
78+
79+
[
80+
(
81+
resolved(
82+
name = "resolved-{}".format(tool),
83+
basename = tool,
84+
toolchain_type = "//coreutils/toolchain/{}:type".format(tool),
85+
),
86+
which(
87+
name = "which-{}".format(tool),
88+
basename = tool,
89+
),
90+
)
91+
for tool in (
92+
"busybox",
93+
"coreutils",
94+
"arch",
95+
"base64",
96+
"basename",
97+
"cat",
98+
"chmod",
99+
"chown",
100+
"cp",
101+
"cut",
102+
"date",
103+
"dd",
104+
"df",
105+
"dirname",
106+
"du",
107+
"echo",
108+
"env",
109+
"expand",
110+
"expr",
111+
"factor",
112+
"false",
113+
"fold",
114+
"head",
115+
"hostname",
116+
"install",
117+
"link",
118+
"ln",
119+
"ls",
120+
"md5sum",
121+
"mkdir",
122+
"mktemp",
123+
"more",
124+
"mv",
125+
"nl",
126+
"nproc",
127+
"od",
128+
"paste",
129+
"printf",
130+
"pwd",
131+
"readlink",
132+
"realpath",
133+
"rm",
134+
"rmdir",
135+
"seq",
136+
"sha1sum",
137+
"sha256sum",
138+
"sha3sum",
139+
"sha512sum",
140+
"shred",
141+
"shuf",
142+
"sleep",
143+
"sort",
144+
"sync",
145+
"tac",
146+
"tail",
147+
"tee",
148+
"test",
149+
"touch",
150+
"tr",
151+
"true",
152+
"truncate",
153+
"uname",
154+
"unexpand",
155+
"uniq",
156+
"unlink",
157+
"wc",
158+
"whoami",
159+
"yes",
160+
)
161+
]
162+
163+
register_toolchains("//coreutils/toolchain/...")

Diff for: modules/rules_coreutils/1.0.0-alpha.8/presubmit.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
bcr_test_module:
2+
module_path: e2e
3+
matrix:
4+
bazel:
5+
- 7.x
6+
platform:
7+
- centos7_java11_devtoolset10
8+
- debian10
9+
- debian11
10+
- ubuntu2004
11+
- ubuntu2004_arm64
12+
- ubuntu2204
13+
- fedora39
14+
- macos
15+
# TODO: enable this once `@ape` gets Apple Silicon support as `rules_diff` uses `@ape//:diff`
16+
# https://gitlab.arm.com/bazel/ape/-/issues/1
17+
# - macos_arm64
18+
# TODO: enable this once the runner has had a certificate refresh
19+
# - windows
20+
tasks:
21+
run_tests:
22+
name: Run end-to-end Tests
23+
bazel: ${{ bazel }}
24+
platform: ${{ platform }}
25+
test_targets:
26+
- "//..."

Diff for: modules/rules_coreutils/1.0.0-alpha.8/source.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"url": "https://gitlab.arm.com/bazel/rules_coreutils/-/releases/v1.0.0-alpha.8/downloads/src.tar.gz",
3+
"integrity": "sha512-uXUHM6aqwAHX3BAl3oxtjVFGz3kqr8NqmGMYgzjERCIeD3AHSa8HOviWmoPqenzysvrqx4bUoHWNRAyG9i5Y3Q==",
4+
"strip_prefix": "rules_coreutils-v1.0.0-alpha.8"
5+
}

Diff for: modules/rules_coreutils/metadata.json

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
2-
"homepage": "https://gitlab.arm.com/bazel/rules_coreutils",
3-
"repository": [
4-
"https://gitlab.arm.com/bazel/rules_coreutils"
5-
],
6-
"versions":[
7-
"1.0.0-alpha.7"
8-
],
9-
"maintainers": [
10-
{
11-
"email": "[email protected]",
12-
"github": "mattyclarkson",
13-
"name": "Matt Clarkson"
14-
}
15-
]
2+
"homepage": "https://gitlab.arm.com/bazel/rules_coreutils",
3+
"repository": [
4+
"https://gitlab.arm.com/bazel/rules_coreutils"
5+
],
6+
"versions": [
7+
"1.0.0-alpha.7",
8+
"1.0.0-alpha.8"
9+
],
10+
"maintainers": [
11+
{
12+
"email": "[email protected]",
13+
"name": "Matt Clarkson",
14+
"github": "mattyclarkson"
15+
}
16+
]
1617
}

0 commit comments

Comments
 (0)