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 (9)
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/ruleset@v1.2.0"
inputs:
oses:
- linux
- windows
- macos
versions:
- 7.4.0
- 7.x
- 8.x
- last_rc
default:
tags:
......
## [1.0.2](https://git.gitlab.arm.com/bazel/toolchain_utils/compare/v1.0.1...v1.0.2) (2025-02-06)
### Bug Fixes
- allow four-part `uname -r` versions ([555a674](https://git.gitlab.arm.com/bazel/toolchain_utils/commit/555a67407e3639c71356950f2d2151860ba2fb4f))
- **toolchain_test:** use `$@` rather than `${@}` ([c402079](https://git.gitlab.arm.com/bazel/toolchain_utils/commit/c4020797351cd3f968c286e834b6a9720a579511))
## [1.0.1](https://git.gitlab.arm.com/bazel/toolchain_utils/compare/v1.0.0...v1.0.1) (2025-01-21)
### Bug Fixes
......
* @matthew.clarkson
[Shell] @matthew.clarkson
*.sh
[Batch] @matthew.clarkson
*.bat
[C#] @matthew.clarkson
*.cs
[Documentation] @matthew.clarkson
*.md
......
module(
name = "toolchain_utils",
version = "1.0.1",
version = "1.0.2",
bazel_compatibility = [
">=7.1.0",
],
......
# Enable hermetic `rules_python`
common --@rules_python//python/config_settings:bootstrap_impl=script
# Build cache
build --experimental_guard_against_concurrent_changes
......
......@@ -7,7 +7,6 @@ module(
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_go", version = "0.52.0")
bazel_dep(name = "rules_python", version = "1.0.0")
bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(name = "hermetic_cc_toolchain", version = "3.1.0", dev_dependency = True)
......@@ -18,17 +17,6 @@ local_path_override(
path = "..",
)
# We have to avoid the `chmod`/`chown`/`id` unhermetic-ness
# TODO: remove this when `ignore_root_user_error` is hermetic
# https://github.com/bazelbuild/rules_python/issues/2016
dev = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True)
dev.toolchain(
configure_coverage_tool = True,
# TODO: change the code to use Python for `chmod`/`id`
ignore_root_user_error = True,
python_version = "3.11",
)
which = use_repo_rule("@toolchain_utils//toolchain/local/which:defs.bzl", "toolchain_local_which")
which(
......
......@@ -62,7 +62,6 @@
"https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c",
"https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d",
"https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df",
"https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92",
"https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e",
"https://bcr.bazel.build/modules/protobuf/29.0/source.json": "b857f93c796750eef95f0d61ee378f3420d00ee1dd38627b27193aa482f4f981",
"https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0",
......@@ -103,8 +102,6 @@
"https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab",
"https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2",
"https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe",
"https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017",
"https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939",
"https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2",
"https://bcr.bazel.build/modules/rules_java/8.6.1/source.json": "f18d9ad3c4c54945bf422ad584fa6c5ca5b3116ff55a5b1bc77e5c1210be5960",
"https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7",
......@@ -137,8 +134,7 @@
"https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58",
"https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c",
"https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7",
"https://bcr.bazel.build/modules/rules_python/1.0.0/MODULE.bazel": "898a3d999c22caa585eb062b600f88654bf92efb204fa346fb55f6f8edffca43",
"https://bcr.bazel.build/modules/rules_python/1.0.0/source.json": "b0162a65c6312e45e7912e39abd1a7f8856c2c7e41ecc9b6dc688a6f6400a917",
"https://bcr.bazel.build/modules/rules_python/0.40.0/source.json": "939d4bd2e3110f27bfb360292986bb79fd8dcefb874358ccd6cdaa7bda029320",
"https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c",
"https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b",
"https://bcr.bazel.build/modules/rules_shell/0.3.0/source.json": "c55ed591aa5009401ddf80ded9762ac32c358d2517ee7820be981e2de9756cf3",
......@@ -147,8 +143,7 @@
"https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef",
"https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c",
"https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7",
"https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5",
"https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216",
"https://bcr.bazel.build/modules/stardoc/0.7.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01",
"https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43",
"https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0",
"https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27",
......
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_go//go:def.bzl", "go_binary")
load("@toolchain_utils//toolchain/info:defs.bzl", "toolchain_info")
load("@toolchain_utils//toolchain/test:defs.bzl", "toolchain_test")
load("@bazel_skylib//rules:build_test.bzl", "build_test")
......@@ -8,16 +8,12 @@ toolchain_type(
visibility = ["//visibility:public"],
)
py_binary(
go_binary(
name = "binary",
srcs = ["binary.py"],
srcs = ["binary.go"],
data = [":fixture.txt"],
# FIXME: `rules_python` binary building on Windows seems borked
target_compatible_with = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = ["@rules_python//python/runfiles"],
pure = "on",
deps = ["@rules_go//go/runfiles"],
)
toolchain_info(
......
package main
import (
"github.com/bazelbuild/rules_go/go/runfiles"
"io"
"log"
"os"
)
func main() {
if len(os.Args) > 1 {
log.Fatal("no arguments, please")
}
path, err := runfiles.Rlocation("_main/toolchain/runfiles/fixture.txt")
if err != nil {
log.Fatalf("no runfile found: %s", err)
}
fd, err := os.Open(path)
if err != nil {
log.Fatalf("failed to open runfile: %s", err)
}
if _, err := io.Copy(os.Stdout, fd); err != nil {
log.Fatalf("failed to copy to stdout: %s", err)
}
}
#! /usr/bin/env python3
from sys import argv, stdout
from python.runfiles import Runfiles
first, *rest = argv
assert not rest, "No arguments, please"
runfiles = Runfiles.Create()
resolved = runfiles.Rlocation("_main/toolchain/runfiles/fixture.txt")
assert resolved, "No runfile found"
with open(resolved) as stream:
for line in stream:
stdout.write(line)
......@@ -118,6 +118,7 @@ def _uname(rctx, path):
major, minor, patch = split(version, ".", {
3: lambda x, y, z: (x, y, z),
4: lambda x, y, z, _: (x, y, z),
})
if rctx.path("/.dockerenv").exists:
......
......@@ -16,7 +16,7 @@ JUNIT="${XML_OUTPUT_FILE-junit.xml}"
readonly JUNIT
# Run the toolchain executable and validate the output
"${EXECUTABLE}" "${@}" >stdout.txt 2>stderr.txt && CODE=$? || CODE=$?
"${EXECUTABLE}" "$@" >stdout.txt 2>stderr.txt && CODE=$? || CODE=$?
readonly CODE
if test "${STATUS}" != "${CODE}"; then
echo >&2 "Failed to run (${CODE}): ${EXECUTABLE} ${*}"
......