fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

UebelAndreAdded support for producing distribution archives (#1194)cd44b367

0.8.1
858 B33 linesraw
1load("@rules_pkg//:pkg.bzl", "pkg_tar")
2
3pkg_tar(
4    name = "rules_rust",
5    srcs = ["//:distro"],
6    extension = "tar.gz",
7    mode = "0444",
8    # Make it owned by root so it does not have the uid of the CI robot.
9    owner = "0.0",
10    package_dir = ".",
11    strip_prefix = ".",
12    visibility = ["//:__subpackages__"],
13)
14
15# This filegroup allows the tar file to appear in runfiles
16# https://github.com/bazelbuild/bazel/issues/12348
17filegroup(
18    name = "distro",
19    srcs = [":rules_rust"],
20    visibility = ["//:__subpackages__"],
21)
22
23sh_binary(
24    name = "publish",
25    srcs = ["publisher.sh"],
26    data = [":distro"],
27    env = {"ARCHIVE": "$(rootpath :distro)"},
28    target_compatible_with = select({
29        "@platforms//os:linux": [],
30        "@platforms//os:macos": [],
31        "//conditions:default": ["@platforms//:incompatible"],
32    }),
33)