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 (5)
......@@ -59,3 +59,6 @@ build:remote --experimental_profile_include_primary_output
# Eliminate duplicate references in the Build Event Stream
build:remote --nolegacy_important_outputs
# TODO: remove this when `bazel/ape` binaries work on remote execution `arm64` instances
build:remote --host_platform=@toolchain_utils//toolchain/platform:amd64-linux-gnu
load(":binaries.bzl", "BINARIES")
load("@toolchain_utils//toolchain/symlink/target:defs.bzl", "toolchain_symlink_target")
load("@toolchain_utils//toolchain/info:defs.bzl", "toolchain_info")
[
toolchain_symlink_target(
toolchain_info(
name = binary,
target = "//ape:{}".format(binary),
visibility = ["//visibility:public"],
......
# [1.0.0-beta.5](https://git.gitlab.arm.com/bazel/ape/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2024-05-04)
### Bug Fixes
- upgrade to `toolchain_utils@1.0.0-beta.9` ([246b23b](https://git.gitlab.arm.com/bazel/ape/commit/246b23be38f24f24b360a4649a1f55706f5b651f))
# [1.0.0-beta.4](https://git.gitlab.arm.com/bazel/ape/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2024-05-01)
### Bug Fixes
......
module(
name = "ape",
version = "1.0.0-beta.4",
version = "1.0.0-beta.5",
bazel_compatibility = [
">=7.0.0",
],
......@@ -9,7 +9,7 @@ module(
bazel_dep(name = "rules_curl", version = "1.0.0-alpha.6", dev_dependency = True)
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.6")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.9")
bazel_dep(name = "download_utils", version = "1.0.0-beta.2")
download_archive = use_repo_rule("@download_utils//download/archive:defs.bzl", "download_archive")
......
This diff is collapsed.
......@@ -4,9 +4,27 @@
set -o nounset
set -o errexit
# Runfiles
rlocation() (
readonly FILEPATH="${1}"
if test -x "${FILEPATH}"; then
printf '%s' "${FILEPATH}"
return
fi
if test -x "${0}.runfiles/${FILEPATH#../}"; then
printf '%s' "${0}.runfiles/${FILEPATH#../}"
return
fi
printf >&2 'Failed to find runfile: %s\n' "${FILEPATH}"
exit 1
)
# Bazel substitutions
TARGET="{{target}}"
APE="{{ape}}"
TARGET="$(rlocation "{{target}}")"
APE="$(rlocation "{{ape}}")"
readonly TARGET APE
# Execute!
......
......@@ -37,7 +37,7 @@ def implementation(ctx):
files = depset([executable])
runfiles = ctx.runfiles([executable, ctx.file.target])
runfiles = ctx.runfiles([executable, ctx.executable.target, ape.executable])
runfiles = runfiles.merge(ctx.attr.target.default_runfiles)
runfiles = runfiles.merge(ape.default.default_runfiles)
......
load("@toolchain_utils//toolchain/symlink/target:defs.bzl", "toolchain_symlink_target")
load("@toolchain_utils//toolchain/info:defs.bzl", "toolchain_info")
load("@toolchain_utils//toolchain/test:defs.bzl", "toolchain_test")
toolchain_type(
......@@ -8,7 +8,7 @@ toolchain_type(
[
(
toolchain_symlink_target(
toolchain_info(
name = "ape-{}-{}".format(cpu, os),
target = "{}//:ape".format(target),
),
......
......@@ -59,3 +59,6 @@ build:remote --experimental_profile_include_primary_output
# Eliminate duplicate references in the Build Event Stream
build:remote --nolegacy_important_outputs
# TODO: remove this when `bazel/ape` binaries work on remote execution `arm64` instances
build:remote --host_platform=@toolchain_utils//toolchain/platform:amd64-linux-gnu
......@@ -7,7 +7,7 @@ module(
bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.6")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.9")
bazel_dep(name = "ape", version = "0.0.0")
local_path_override(
module_name = "ape",
......@@ -24,4 +24,9 @@ resolved(
toolchain_type = "//toolchain/curl:type",
)
resolved(
name = "resolved-install",
toolchain_type = "//toolchain/install:type",
)
register_toolchains("//toolchain/...")
{
"lockFileVersion": 6,
"moduleFileHash": "d0f4687c2ba92b5cea1d8137da756a260fbc825c87094aedbffd4065ee784ef3",
"moduleFileHash": "bd6797dc9ca24d04aa8d01ecb0ccbc1e2f228e1171fcaa833c5105c83069dcb7",
"flags": {
"cmdRegistries": [
"https://bcr.bazel.build/"
......@@ -14,7 +14,7 @@
},
"localOverrideHashes": {
"bazel_tools": "1ae69322ac3823527337acf02016e8ee95813d8d356f47060255b8956fa642f0",
"ape": "c55b9d0f21a2824ac484ee47c97270df98a2353c94fd0bd4fc9acbf6e9775613"
"ape": "bb104da557a69f98614fc08997579f3b6a1d36c6407fd99dff0974bc67867e9a"
},
"moduleDepGraph": {
"<root>": {
......@@ -54,7 +54,8 @@
"column": 0
},
"imports": {
"resolved-curl": "resolved-curl"
"resolved-curl": "resolved-curl",
"resolved-install": "resolved-install"
},
"devImports": [],
"tags": [
......@@ -70,6 +71,19 @@
"line": 22,
"column": 9
}
},
{
"tagName": "@toolchain_utils//toolchain/resolved:defs.bzl%toolchain_resolved",
"attributeValues": {
"toolchain_type": "//toolchain/install:type",
"name": "resolved-install"
},
"devDependency": false,
"location": {
"file": "@@//:MODULE.bazel",
"line": 27,
"column": 9
}
}
],
"hasDevUseExtension": false,
......@@ -78,7 +92,7 @@
],
"deps": {
"bazel_skylib": "bazel_skylib@1.5.0",
"toolchain_utils": "toolchain_utils@1.0.0-beta.6",
"toolchain_utils": "toolchain_utils@1.0.0-beta.9",
"ape": "ape@_",
"bazel_tools": "bazel_tools@_",
"local_config_platform": "local_config_platform@_"
......@@ -114,10 +128,10 @@
}
}
},
"toolchain_utils@1.0.0-beta.6": {
"toolchain_utils@1.0.0-beta.9": {
"name": "toolchain_utils",
"version": "1.0.0-beta.6",
"key": "toolchain_utils@1.0.0-beta.6",
"version": "1.0.0-beta.9",
"key": "toolchain_utils@1.0.0-beta.9",
"repoName": "toolchain_utils",
"executionPlatformsToRegister": [],
"toolchainsToRegister": [],
......@@ -125,9 +139,9 @@
{
"extensionBzlFile": "//:MODULE.bazel",
"extensionName": "_repo_rules",
"usingModule": "toolchain_utils@1.0.0-beta.6",
"usingModule": "toolchain_utils@1.0.0-beta.9",
"location": {
"file": "https://bcr.bazel.build/modules/toolchain_utils/1.0.0-beta.6/MODULE.bazel",
"file": "https://bcr.bazel.build/modules/toolchain_utils/1.0.0-beta.9/MODULE.bazel",
"line": 0,
"column": 0
},
......@@ -144,7 +158,7 @@
},
"devDependency": false,
"location": {
"file": "https://bcr.bazel.build/modules/toolchain_utils/1.0.0-beta.6/MODULE.bazel",
"file": "https://bcr.bazel.build/modules/toolchain_utils/1.0.0-beta.9/MODULE.bazel",
"line": 15,
"column": 8
}
......@@ -156,7 +170,7 @@
},
"devDependency": false,
"location": {
"file": "https://bcr.bazel.build/modules/toolchain_utils/1.0.0-beta.6/MODULE.bazel",
"file": "https://bcr.bazel.build/modules/toolchain_utils/1.0.0-beta.9/MODULE.bazel",
"line": 21,
"column": 9
}
......@@ -177,10 +191,10 @@
"ruleClassName": "http_archive",
"attributes": {
"urls": [
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.0-beta.6/downloads/src.tar.gz"
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.0-beta.9/downloads/src.tar.gz"
],
"integrity": "sha512-NX3FB0+TBG5SBsd8xdXYgpvPC1yj5oRjpyP9DEUAjTaFXgLEW4jO6rrV0E2yIhl/tXS6IZuiP34jAC2Cuef/Ag==",
"strip_prefix": "toolchain_utils-v1.0.0-beta.6",
"integrity": "sha512-H48NSkoptDhNCzbWw/IRThAGL0z+iL6xP1Q+kw6uxsbT8CNXNyBcYuihQCpRuJC8tgBOXyOIXbSu7df6BRYz7w==",
"strip_prefix": "toolchain_utils-v1.0.0-beta.9",
"remote_patches": {},
"remote_patch_strip": 0
}
......@@ -7656,7 +7670,7 @@
}
],
"deps": {
"toolchain_utils": "toolchain_utils@1.0.0-beta.6",
"toolchain_utils": "toolchain_utils@1.0.0-beta.9",
"download_utils": "download_utils@1.0.0-beta.2",
"bazel_tools": "bazel_tools@_",
"local_config_platform": "local_config_platform@_"
......
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load(":defs.bzl", "install")
install(
name = "install",
src = ":fixture.txt",
)
build_test(
name = "test",
targets = [":install"],
)
load(":rule.bzl", _install = "install")
visibility("public")
install = _install
Hello, world!
visibility("//...")
DOC = "Installs a file."
ATTRS = {
"src": attr.label(
doc = "The file to install",
allow_single_file = True,
mandatory = True,
),
}
def implementation(ctx):
install = ctx.toolchains["//toolchain/install:type"]
output = ctx.actions.declare_file(ctx.label.name)
args = ctx.actions.args()
args.add(ctx.file.src)
args.add(output)
ctx.actions.run(
arguments = [args],
executable = install.run,
inputs = ctx.attr.src.files,
outputs = [output],
mnemonic = "Install",
toolchain = "//toolchain/install:type",
)
return DefaultInfo(files = depset([output]))
install = rule(
doc = DOC,
attrs = ATTRS,
implementation = implementation,
toolchains = ["//toolchain/install:type"],
)
load("@ape//ape/toolchain:defs.bzl", "ape_toolchain")
load("@toolchain_utils//toolchain/test:defs.bzl", "toolchain_test")
toolchain_type(
name = "type",
visibility = ["//visibility:public"],
)
ape_toolchain(
name = "ape",
toolchain = "@ape//:install",
toolchain_type = ":type",
)
alias(
name = "resolved",
actual = "@resolved-install",
visibility = ["//visibility:public"],
)
toolchain_test(
name = "test",
size = "small",
args = ["--version"],
toolchains = [":resolved"],
)