Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • bazel/ape
1 result
Show changes
Commits on Source (9)
load(":binaries.bzl", "BINARIES")
load("@toolchain_utils//toolchain/info:defs.bzl", "toolchain_info")
load("//:binaries.bzl", "BINARIES")
[
toolchain_info(
alias(
name = binary,
target = "//ape:{}".format(binary),
actual = "//ape/toolchain/info:{}".format(binary),
deprecation = "The `@ape//:{0}` target is deprecated in favour of the more explicit `@ape//toolchain/info:{0}` and will be removed in a subsequent version.".format(binary),
tags = ["manual"],
visibility = ["//visibility:public"],
)
for binary in BINARIES
......
# [1.0.0-beta.12](https://git.gitlab.arm.com/bazel/ape/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2024-07-22)
### Bug Fixes
- **assimilate:** make rule public ([d4b1be0](https://git.gitlab.arm.com/bazel/ape/commit/d4b1be09d711defd822cb581c43674924e04e656))
- **binary:** make rule public ([793c0f2](https://git.gitlab.arm.com/bazel/ape/commit/793c0f2e83b3f95ce7b147d6fc65c2a9c3c07d79))
- **entrypoint:** add `local = True` ([699fcb6](https://git.gitlab.arm.com/bazel/ape/commit/699fcb6c036b94a3505d4231ee522daafbb4391d))
- **entrypoint:** assimilate on Linux ([b4ff17b](https://git.gitlab.arm.com/bazel/ape/commit/b4ff17be88820667fd85fb37283e0e5d06130087))
### Features
- add `@ape//ape/toolchain/info:*` targets ([c767ec0](https://git.gitlab.arm.com/bazel/ape/commit/c767ec08894e1874cd183ffe99e76c4f25e1bc86))
- make `@ape//ape:*` targets publically visible ([4978c17](https://git.gitlab.arm.com/bazel/ape/commit/4978c177fd073b18eec3e600a5a2fe1e26f5b5f8))
# [1.0.0-beta.11](https://git.gitlab.arm.com/bazel/ape/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2024-06-18)
### Bug Fixes
......
module(
name = "ape",
version = "1.0.0-beta.11",
version = "1.0.0-beta.12",
bazel_compatibility = [
">=7.0.0",
],
......
......@@ -13,13 +13,13 @@ bazel_dep(name = "ape", version = "0.0.0")
Binaries are provided as executable targets:
```sh
bazel run -- @ape//:curl --version
bazel run -- @ape//ape:curl --version
```
List the available executables:
```sh
bazel query 'kind(alias, @ape//:*)'
bazel query 'kind(alias, @ape//ape:*)'
```
Register a binary as a toolchain for [supported platforms][supported-platforms]:
......@@ -33,7 +33,7 @@ toolchain_type(
ape_toolchain(
name = "ape",
toolchain = "@ape//:curl",
toolchain = "@ape//toolchain/info:curl",
toolchain_type = ":type",
)
```
......
......@@ -5,7 +5,7 @@ load("//:binaries.bzl", "BINARIES")
name = binary,
actual = "//ape/assimilate:{}".format(binary),
tags = ["manual"],
visibility = ["//:__subpackages__"],
visibility = ["//visibility:public"],
)
for binary in BINARIES
]
load(":rule.bzl", _assimilate = "assimilate")
visibility("//...")
visibility("public")
ape_assimilate = _assimilate
load(":rule.bzl", _binary = "binary")
visibility("//...")
visibility("public")
ape_binary = _binary
......@@ -13,6 +13,13 @@ ATTRS = {
cfg = "exec",
default = "@launcher//:ape",
),
"assimilate": attr.label(
doc = "The assimilation APE binary.",
allow_single_file = True,
executable = True,
cfg = "exec",
default = "@cosmos-assimilate//:assimilate",
),
"binary": attr.label(
doc = "The αcτµαlly pδrταblε εxεcµταblε binary.",
allow_single_file = True,
......@@ -31,13 +38,19 @@ ATTRS = {
}
def implementation(rctx):
if "windows" in rctx.os.name:
if rctx.os.name != "linux":
rctx.symlink(rctx.attr.binary, "entrypoint")
else:
rctx.template("entrypoint", rctx.attr.posix, {
"{{launcher}}": str(rctx.path(rctx.attr.launcher)),
"{{binary}}": str(rctx.path(rctx.attr.binary)),
}, executable = True)
cmd = (
rctx.attr.launcher,
rctx.path(rctx.attr.assimilate),
"-o",
"entrypoint",
rctx.path(rctx.attr.binary),
)
result = rctx.execute(cmd)
if result.return_code != 0:
fail("Failed to assimilate: {}".format(cmd))
rctx.template("BUILD.bazel", rctx.attr.build, {
"{{exports}}": repr(["entrypoint"]),
......@@ -48,4 +61,5 @@ entrypoint = repository_rule(
attrs = ATTRS,
implementation = implementation,
configure = True,
local = True,
)
......@@ -20,7 +20,7 @@ alias(
name = binary,
size = "small",
arguments = arguments,
target = "//:{}".format(binary),
target = "//ape:{}".format(binary),
)
for binary, arguments in {
"assimilate": ["-v"],
......
load("//:binaries.bzl", "BINARIES")
load("@toolchain_utils//toolchain/info:defs.bzl", "toolchain_info")
[
toolchain_info(
name = binary,
target = "//ape:{}".format(binary),
visibility = ["//visibility:public"],
)
for binary in BINARIES
]
......@@ -7,7 +7,7 @@ ATTRS = {
executable = True,
cfg = "exec",
allow_single_file = True,
default = "@ape//:true",
default = "@ape//ape:true",
),
}
......
......@@ -8,7 +8,7 @@ toolchain_type(
ape_toolchain(
name = "ape",
toolchain = "@ape//:curl",
toolchain = "@ape//ape/toolchain/info:curl",
toolchain_type = ":type",
)
......
......@@ -8,7 +8,7 @@ toolchain_type(
ape_toolchain(
name = "ape",
toolchain = "@ape//:install",
toolchain = "@ape//ape/toolchain/info:install",
toolchain_type = ":type",
)
......