Skip to content

Commit

Permalink
rules_coreutils/rules_diff Bazel 8 support (#3073)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyclarkson authored Nov 1, 2024
1 parent 1e7a350 commit d2d22a3
Show file tree
Hide file tree
Showing 8 changed files with 302 additions and 2 deletions.
209 changes: 209 additions & 0 deletions modules/rules_coreutils/1.0.0-beta.7/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
module(
name = "rules_coreutils",
version = "1.0.0-beta.7",
bazel_compatibility = [
">=7.0.0",
],
compatibility_level = 1,
)

bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.17")
bazel_dep(name = "download_utils", version = "1.0.0-beta.2")
bazel_dep(name = "ape", version = "1.0.0-beta.14")

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/...")
23 changes: 23 additions & 0 deletions modules/rules_coreutils/1.0.0-beta.7/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
bcr_test_module:
module_path: e2e
matrix:
bazel:
- 7.x
- 8.0.0rc2
platform:
- centos7_java11_devtoolset10
- debian10
- debian11
- ubuntu2004
- ubuntu2204
- fedora39
- macos
- macos_arm64
- windows
tasks:
e2e_tests:
name: Run end-to-end Tests
bazel: ${{ bazel }}
platform: ${{ platform }}
test_targets:
- "//..."
5 changes: 5 additions & 0 deletions modules/rules_coreutils/1.0.0-beta.7/source.json
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.7/downloads/src.tar.gz",
"integrity": "sha512-XlD74RCaEpg0xFId1p+7kzv96jlSworUyoRIFvDDbfIFiD5ceaqIouX6xT5kXaOktEqWn4Pk4H5w70f+GiQ6ZA==",
"strip_prefix": "rules_coreutils-v1.0.0-beta.7"
}
3 changes: 2 additions & 1 deletion modules/rules_coreutils/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"1.0.0-beta.1",
"1.0.0-beta.3",
"1.0.0-beta.4",
"1.0.0-beta.6"
"1.0.0-beta.6",
"1.0.0-beta.7"
],
"maintainers": [
{
Expand Down
33 changes: 33 additions & 0 deletions modules/rules_diff/1.0.0-beta.5/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module(
name = "rules_diff",
version = "1.0.0-beta.5",
bazel_compatibility = [
">=7.1.0",
],
compatibility_level = 1,
)

bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.17")
bazel_dep(name = "ape", version = "1.0.0-beta.14")

export = use_extension("@toolchain_utils//toolchain/export:defs.bzl", "toolchain_export")

resolved = use_repo_rule("@toolchain_utils//toolchain/resolved:defs.bzl", "toolchain_resolved")

[
(
use_repo(export, "ape-{}".format(tool)),
export.symlink(
name = tool,
target = "@ape-{}".format(tool),
),
use_repo(export, tool),
resolved(
name = "resolved-{}".format(tool),
toolchain_type = "//diff/toolchain/{}:type".format(tool),
),
)
for tool in ("diff", "diff3", "sdiff", "cmp")
]

register_toolchains("//diff/toolchain/...")
23 changes: 23 additions & 0 deletions modules/rules_diff/1.0.0-beta.5/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
bcr_test_module:
module_path: e2e
matrix:
bazel:
- 7.x
- 8.0.0rc2
platform:
- centos7_java11_devtoolset10
- debian10
- debian11
- ubuntu2004
- ubuntu2204
- fedora39
- macos
- macos_arm64
- windows
tasks:
e2e_tests:
name: Run end-to-end Tests
bazel: ${{ bazel }}
platform: ${{ platform }}
test_targets:
- "//..."
5 changes: 5 additions & 0 deletions modules/rules_diff/1.0.0-beta.5/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"url": "https://gitlab.arm.com/bazel/rules_diff/-/releases/v1.0.0-beta.5/downloads/src.tar.gz",
"integrity": "sha512-dHJ878OWN7gJqGtwkQbuzbtSNMWlbg20bLj1E4MnO0U2dLsH+fyqKq80RBsBvs8doCSA90/lbq4bXjnwK4SpyA==",
"strip_prefix": "rules_diff-v1.0.0-beta.5"
}
3 changes: 2 additions & 1 deletion modules/rules_diff/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"1.0.0-alpha.3",
"1.0.0-beta.2",
"1.0.0-beta.3",
"1.0.0-beta.4"
"1.0.0-beta.4",
"1.0.0-beta.5"
],
"maintainers": [
{
Expand Down

0 comments on commit d2d22a3

Please sign in to comment.