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 (7)
# [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
- **assimilate:** ensure Windows executable extension ([4e63652](https://git.gitlab.arm.com/bazel/ape/commit/4e636524a5cfa246a24d8478d2c2f2494fee0983))
# [1.0.0-beta.10](https://git.gitlab.arm.com/bazel/ape/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2024-06-18)
### Bug Fixes
......
module(
name = "ape",
version = "1.0.0-beta.10",
version = "1.0.0-beta.11",
bazel_compatibility = [
">=7.0.0",
],
......
......@@ -22,7 +22,7 @@ List the available executables:
bazel query 'kind(alias, @ape//:*)'
```
Register a binary as a toolchain for [supported platforms][supported-platforms][^1]:
Register a binary as a toolchain for [supported platforms][supported-platforms]:
```py
load("@ape//ape/toolchain:defs.bzl", "ape_toolchain")
......@@ -54,7 +54,7 @@ The [superconfigure] source code is mirrored in this repository on the [`superco
Binaries are mirrored in the [GitLab generic package registry][package-registry] to protect against upstream outages.
The launcher for Apple Silicon must be built from source. [Zig] is used to compile the [source][ape-m1.c] from source. These are both mirrored in the [package registry][package-registry]. Source, licenses and distribution information is available at the upstream links.
The launcher for Apple Silicon must be built from source. [Zig] is used to compile the [launcher][ape-m1.c] from source. These are both mirrored in the [package registry][package-registry]. Source, licenses and distribution information is available at the upstream links.
---
......@@ -64,6 +64,5 @@ The launcher for Apple Silicon must be built from source. [Zig] is used to compi
[package-registry]: https://gitlab.arm.com/bazel/ape/-/packages
[mirror]: https://gitlab.arm.com/bazel/ape/-/tree/superconfigure/main
[supported-platforms]: https://github.com/jart/cosmopolitan/wiki/Features#systems-and-cpu-arch-supported
[^1]: Apple silicon is supported upstream but currently unsupported by this ruleset, see #1
[Zig]: https://ziglang.org/
[ape-m1.c]: https://github.com/jart/cosmopolitan/blob/3.3.3/ape/ape-m1.c
......@@ -4,6 +4,7 @@ load("//:binaries.bzl", "BINARIES")
alias(
name = binary,
actual = "//ape/assimilate:{}".format(binary),
tags = ["manual"],
visibility = ["//:__subpackages__"],
)
for binary in BINARIES
......
......@@ -5,6 +5,7 @@ load("//ape/assimilate:defs.bzl", "ape_assimilate")
ape_assimilate(
name = binary,
src = "@cosmos-{}//:{}".format(binary, binary),
tags = ["manual"],
visibility = ["//:__subpackages__"],
)
for binary in BINARIES
......
......@@ -44,6 +44,8 @@ def implementation(ctx):
arm64 = ctx.attr._arm64[platform_common.ConstraintValueInfo]
basename = ctx.attr.basename or ctx.label.name
if ctx.target_platform_has_constraint(windows) and not basename.endswith(".exe"):
basename += ".exe"
executable = ctx.actions.declare_file("{}.ape/{}".format(ctx.label.name, basename))
......
......@@ -5,6 +5,7 @@ load(":rule.bzl", "ape_binary")
ape_binary(
name = binary,
src = "@cosmos-{}//:{}".format(binary, binary),
tags = ["manual"],
visibility = ["//:__subpackages__"],
)
for binary in BINARIES
......
package main
import (
"fmt"
"os"
)
func main() {
if len(os.Args) < 2 {
fmt.Fprintf(os.Stderr, "readlink: missing operand\n")
os.Exit(1)
}
for _, file := range os.Args[1:] {
link, err := os.Readlink(file)
if err != nil {
os.Exit(1)
}
fmt.Println(link)
}
}
......@@ -10,6 +10,7 @@ toolchain_type(
(
toolchain_info(
name = "ape-{}-{}".format(cpu, os),
tags = ["manual"],
target = "{}//:ape".format(target),
),
toolchain(
......@@ -38,6 +39,7 @@ toolchain_type(
alias(
name = "resolved",
actual = "@resolved-ape",
tags = ["manual"],
visibility = ["//visibility:public"],
)
......
load("//symlink/test:defs.bzl", "e2e_symlink_test")
e2e_symlink_test(
name = "test",
)
load(":rule.bzl", _test = "test")
visibility("public")
e2e_symlink_test = _test
visibility("//...")
DOC = "Use to validate that symlinked APE binaries can be used"
ATTRS = {
"_test": attr.label(
executable = True,
cfg = "exec",
allow_single_file = True,
default = "@ape//:true",
),
}
def implementation(ctx):
output = ctx.actions.declare_file(ctx.label.name)
ctx.actions.symlink(
output = output,
target_file = ctx.file._test,
is_executable = True,
)
runfiles = ctx.runfiles((ctx.file._test, output))
runfiles.merge(ctx.attr._test.default_runfiles)
return DefaultInfo(
executable = output,
files = depset([output]),
runfiles = runfiles,
)
e2e_symlink_test = rule(
doc = DOC,
attrs = ATTRS,
implementation = implementation,
test = True,
)
test = e2e_symlink_test
......@@ -6,6 +6,7 @@ load("//:binaries.bzl", "BINARIES")
name = ape,
src = "@{}//:ape".format(ape),
dst = ape,
tags = ["manual"],
url = "https://gitlab.arm.com/api/v4/projects/bazel%2Fape/packages/generic/cosmos.zip/3.3.1",
)
for ape in (
......@@ -20,6 +21,7 @@ load("//:binaries.bzl", "BINARIES")
name = binary,
src = "@cosmos-{}//:{}".format(binary, binary),
dst = binary,
tags = ["manual"],
url = "https://gitlab.arm.com/api/v4/projects/bazel%2Fape/packages/generic/cosmos.zip/3.3.1",
)
for binary in BINARIES
......@@ -29,5 +31,6 @@ curl_upload_file(
name = "ape-m1.c",
src = "@ape-m1.c",
dst = "ape-m1.c",
tags = ["manual"],
url = "https://gitlab.arm.com/api/v4/projects/bazel%2Fape/packages/generic/cosmos.zip/3.3.1",
)