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/toolchain_utils
1 result
Show changes
Commits on Source (12)
......@@ -16,9 +16,6 @@ common --show_timestamps
# Do not wrap any output
common --terminal_columns=0
# Print relative paths where possible to reduce noise
common --attempt_to_print_relative_paths
# Output as much information in the CI log about failures as possible
build --verbose_failures
......@@ -28,6 +25,9 @@ test --test_output=errors
# Output as much information when a test exceeds a timeout
test --test_verbose_timeout_warnings
# Validate that the lockfile is correct
common --lockfile_mode=error
# These locations are cached on the CI
build:local --disk_cache=${CI_PROJECT_DIR}/.cache/bazel/disk
build:local --repository_cache=${CI_PROJECT_DIR}/.cache/bazel/repo
......
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/bazelisk@v1.0.0-beta.3"
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/bazelisk@v1.0.0-beta.4"
inputs:
variables: |
CI_PROJECT_DIR
......@@ -21,6 +21,12 @@ default:
test:
extends: .bazelisk
cache:
- !reference [.bazelisk, cache]
- key: "bazel-cache-${CI_PROJECT_ID}"
paths:
- ".cache/bazel/disk"
- ".cache/bazel/repo"
parallel:
matrix:
- ROOT:
......@@ -30,7 +36,8 @@ test:
- local
- remote
script:
- cd "${ROOT}"; bazelisk test --config="${CONFIG}" //...
- (cd "${ROOT}"; bazelisk build --config="${CONFIG}" //...)
- (cd "${ROOT}"; bazelisk test --config="${CONFIG}" //...)
# TODO: switch this out for `rules_semantic_release`
semantic-release:
......
# [1.0.0-beta.14](https://git.gitlab.arm.com/bazel/toolchain_utils/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2024-09-06)
### Bug Fixes
- **local:** grab first part of `uname -r` ([e040928](https://git.gitlab.arm.com/bazel/toolchain_utils/commit/e040928dc9ba3ba87e6feedbe3850d751a0896a2))
- **local:** provide `/etc/os-release` defaults ([177738d](https://git.gitlab.arm.com/bazel/toolchain_utils/commit/177738d71b8b50b0c13a02c494f6cf04d93bd316))
- remove `ToolchainInfo#inherited` ([7608c42](https://git.gitlab.arm.com/bazel/toolchain_utils/commit/7608c42b57f6c2b7b9db4b61aed54a3fc27557d7))
### Features
- add `//toolchain/constraint/local:{cpu,os,libc}` aliases ([a384e64](https://git.gitlab.arm.com/bazel/toolchain_utils/commit/a384e6491bbad9975e4cf9ce5e16758e8e6b7c01))
- add `//toolchain/local/constraint:{cpu,os,libc}` targets ([cf24d76](https://git.gitlab.arm.com/bazel/toolchain_utils/commit/cf24d7609f95b765698181a24a370fc4b5c160ac))
- add couplet platforms ([27ba292](https://git.gitlab.arm.com/bazel/toolchain_utils/commit/27ba292a92948f25e8b429d25b463f47727c8597))
### BREAKING CHANGES
- `ToolchainInfo#inherited` removed
It is not possible to use these in an action as the host
environment variables cannot be read host environment variables.
# [1.0.0-beta.13](https://git.gitlab.arm.com/bazel/toolchain_utils/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2024-07-30)
### Bug Fixes
......
module(
name = "toolchain_utils",
version = "1.0.0-beta.13",
version = "1.0.0-beta.14",
bazel_compatibility = [
">=7.0.0",
],
......
......@@ -16,9 +16,6 @@ common --show_timestamps
# Do not wrap any output
common --terminal_columns=0
# Print relative paths where possible to reduce noise
common --attempt_to_print_relative_paths
# Output as much information in the CI log about failures as possible
build --verbose_failures
......@@ -28,6 +25,9 @@ test --test_output=errors
# Output as much information when a test exceeds a timeout
test --test_verbose_timeout_warnings
# Validate that the lockfile is correct
common --lockfile_mode=error
# These locations are cached on the CI
build:local --disk_cache=${CI_PROJECT_DIR}/.cache/bazel/disk
build:local --repository_cache=${CI_PROJECT_DIR}/.cache/bazel/repo
......
alias(
name = "cpu",
actual = "//toolchain/local:cpu",
visibility = ["//visibility:public"],
)
alias(
name = "os",
actual = "//toolchain/local:os",
visibility = ["//visibility:public"],
)
alias(
name = "libc",
actual = "//toolchain/local:libc",
visibility = ["//visibility:public"],
)
......@@ -86,10 +86,8 @@ def implementation(ctx):
)
env = {}
inherited = ()
if RunEnvironmentInfo in ctx.attr.target:
env = ctx.attr.target[RunEnvironmentInfo].environment
inherited = tuple(ctx.attr.target[RunEnvironmentInfo].inherited_environment)
toolchain = platform_common.ToolchainInfo(
variables = variables,
......@@ -97,7 +95,6 @@ def implementation(ctx):
executable = ctx.executable.target,
run = ctx.attr.target.files_to_run or ctx.executable.target,
env = env,
inheritied = inherited,
)
return [variables, toolchain, default]
......
......@@ -13,6 +13,24 @@ config_setting(
visibility = ["//visibility:public"],
)
alias(
name = "cpu",
actual = "//toolchain/constraint/cpu:{}".format(TRIPLET.cpu),
visibility = ["//visibility:public"],
)
alias(
name = "os",
actual = "//toolchain/constraint/os:{}".format(TRIPLET.os.kind),
visibility = ["//visibility:public"],
)
alias(
name = "libc",
actual = "//toolchain/constraint/libc:{}".format(TRIPLET.libc.kind),
visibility = ["//visibility:public"],
)
platform(
name = "platform",
constraint_values = TRIPLET.constraints,
......
......@@ -12,7 +12,8 @@ def _release(rctx, path):
content = rctx.read(path)
lines = content.splitlines()
pairs = [line.split("=", 1) for line in lines if "=" in line]
processed = {k.lower(): _unquote(v) for k, v in pairs}
processed = {"id": None, "id_like": None}
processed |= {k.lower(): _unquote(v) for k, v in pairs}
data = struct(**processed)
if data.id in ("arch", "debian", "fedora"):
......
......@@ -106,7 +106,7 @@ def _uname(rctx, path):
if result.return_code != 0:
fail("Failed to get `uname` release: {}".format(result.stderr))
version, _ = result.stdout.split("-", 1)
version = result.stdout.split("-", 1)[0]
major, minor, patch = split(version, ".", {
3: lambda x, y, z: (x, y, z),
......
......@@ -9,6 +9,24 @@ load("//toolchain/triplet:triplets.bzl", "TRIPLETS")
for t in TRIPLETS
]
[
platform(
name = "{}-{}".format(cpu, os),
constraint_values = [
"//toolchain/constraint/cpu:{}".format(cpu),
"//toolchain/constraint/os:{}".format(os),
],
)
for cpu, os in (
("amd64", "linux"),
("arm64", "linux"),
("amd64", "windows"),
("arm64", "windows"),
("amd64", "macos"),
("arm64", "macos"),
)
]
alias(
name = "local",
actual = "//toolchain/local:platform",
......
......@@ -10,6 +10,7 @@ exports_files([
[
triplet(
name = t.value,
tags = ["manual"],
visibility = ["//visibility:public"],
)
for t in TRIPLETS
......