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/download_utils
1 result
Show changes
Commits on Source (6)
# `bzlmod` pre-release registries
common --registry https://bcr.bazel.build
common --registry=https://gitlab.arm.com/bazel/rules_diff/-/releases/v1.0.0-beta.6/downloads
# Build cache
build --experimental_guard_against_concurrent_changes
......
7.3.1
7.4.0
# [1.0.0-beta.5](https://git.gitlab.arm.com/bazel/download_utils/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2024-11-27)
### Bug Fixes
- **commands:** support Bazel 8 naming of `use_repo_rule` ([f1aee87](https://git.gitlab.arm.com/bazel/download_utils/commit/f1aee877e10375658a10b0afe215b62482c03023))
- update dependencies for Bazel 8 support ([eef0671](https://git.gitlab.arm.com/bazel/download_utils/commit/eef0671705d34b6693ca3bf909e2337b5ea8a351))
# [1.0.0-beta.4](https://git.gitlab.arm.com/bazel/download_utils/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2024-11-04)
### Bug Fixes
......
# Contributing
# Getting Started
## Getting Started
[Install][bazelisk-install] `bazelisk` and run the tests:
......@@ -11,7 +11,14 @@ $ (cd e2e; bazelisk test //...)
[bazelisk-install]: https://github.com/bazelbuild/bazelisk?tab=readme-ov-file#installation
# Release
## Workflow
- Follow the [contributions guide] to be granted forking permissions.
- [Fork] the project
- Implement the change
- [Create merge request] from fork
## Release
`semantic-release` performs automatic releases of the project.
......@@ -20,5 +27,7 @@ Release channels for `alpha`, `beta` and `stable` releases are used.
The [upstream configuration usage guide][semrel-release-channels-usage] provides information on how to perform a
release.
[semrel-release-channels-usage]:
https://gitlab.arm.com/semantic-release/config-release-channels/-/blob/main/README.md?ref_type=heads#usage
[semrel-release-channels-usage]: https://gitlab.arm.com/semantic-release/config-release-channels/-/blob/main/README.md?ref_type=heads#usage
[contributions guide]: https://gitlab.arm.com/documentation/contributions#contributions
[Fork]: https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html#create-a-fork
[Create merge request]: https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html#merge-changes-back-upstream
module(
name = "download_utils",
version = "1.0.0-beta.4",
version = "1.0.0-beta.5",
bazel_compatibility = [
">=7.1.0",
],
compatibility_level = 1,
)
bazel_dep(name = "rules_diff", version = "1.0.0-beta.5", dev_dependency = True)
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.17", dev_dependency = True)
bazel_dep(name = "rules_diff", version = "1.0.0-beta.6", dev_dependency = True)
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.18", dev_dependency = True)
separator = use_repo_rule("//lib:separator.bzl", "separator")
......
This diff is collapsed.
# `bzlmod` pre-release registries
common --registry https://bcr.bazel.build
common --registry=https://gitlab.arm.com/bazel/rules_diff/-/releases/v1.0.0-beta.6/downloads
# Build cache
build --experimental_guard_against_concurrent_changes
......
7.3.1
7.4.0
......@@ -11,8 +11,8 @@ local_path_override(
path = "..",
)
bazel_dep(name = "rules_diff", version = "1.0.0-beta.5")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.17")
bazel_dep(name = "rules_diff", version = "1.0.0-beta.6")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.18")
archive = use_repo_rule("@download_utils//download/archive:defs.bzl", "download_archive")
......@@ -88,10 +88,10 @@ select = use_repo_rule("@toolchain_utils//toolchain/local/select:defs.bzl", "too
select(
name = "coreutils",
map = {
"arm64-linux": "@coreutils-arm64-linux-musl",
"amd64-linux": "@coreutils-amd64-linux-musl",
"amd64-windows": "@coreutils-amd64-windows-msvc",
"arm64-macos-darwin": "@coreutils-arm64-macos-darwin",
"amd64-macos-darwin": "@coreutils-amd64-macos-darwin",
"@coreutils-arm64-linux-musl": "arm64-linux",
"@coreutils-amd64-linux-musl": "amd64-linux",
"@coreutils-amd64-windows-msvc": "amd64-windows",
"@coreutils-arm64-macos-darwin": "arm64-macos-darwin",
"@coreutils-amd64-macos-darwin": "amd64-macos-darwin",
},
)
This diff is collapsed.
......@@ -55,18 +55,39 @@ def commands(rctx):
if not rctx.attr.commands:
return {}
def _label(label):
prefix, _ = rctx.name.rsplit(SEPARATOR, 1)
def _digits(s):
for c in s.elems():
if c < "0" or "9" < c:
return False
return True
def _workspace(label):
name, _ = rctx.name.rsplit(SEPARATOR, 1)
workspace = label.workspace_name
if not workspace:
return workspace
# Bazel 8-
prefix = name + SEPARATOR
if workspace.startswith(prefix):
return workspace.removeprefix(prefix)
# Bazel 8+
prefix, _ = workspace.rsplit(SEPARATOR, 1)
prefix += SEPARATOR
workspace = label.workspace_name.removeprefix(prefix)
if _digits(prefix.removeprefix(name).removesuffix(SEPARATOR)):
return workspace.removeprefix(prefix)
fail("Failed to calculate `commands` label workspace for {} within {}".format(label, rctx.name))
def _label(label):
workspace = _workspace(label)
package = label.package
name = label.name
if not package and name == workspace:
return "@{}".format(workspace)
elif package == name:
return "//{}".format(package)
elif prefix.startswith(workspace):
return "//{}:{}".format(package, name)
elif workspace:
return "@{}//{}:{}".format(workspace, package, name)
else:
......