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 (5)
# [1.0.0-beta.2](https://git.gitlab.arm.com/bazel/toolchain_utils/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2024-02-21)
### Bug Fixes
- find POSIX shell with `/usr/bin/env` ([2294100](https://git.gitlab.arm.com/bazel/toolchain_utils/commit/2294100e1efa4dee95bf61542cca3730bc618aa2))
- **resolved:** default to the correct `basename` ([3e2fc92](https://git.gitlab.arm.com/bazel/toolchain_utils/commit/3e2fc92eb112f1925a21e74cc179a2e3abbe2743))
# 1.0.0-beta.1 (2024-01-23)
### Bug Fixes
......
module(
name = "toolchain_utils",
version = "1.0.0-beta.1",
version = "1.0.0-beta.2",
bazel_compatibility = [
">=7.0.0",
],
......
......@@ -129,4 +129,21 @@ genrule(
)
```
## Hermeticity
### POSIX
On POSIX systems, this ruleset is entirely hermetic and only requires a POSIX compatible shell and `/usr/bin/env` to find that shell.
### NT
The rule set has Batch implementation on Windows so does not require Bash.
A binary Windows launcher is created by compiling [C# code][launcher-cs] with the .NET `csc`. This is provided by the base install of Windows.
The `toolchain_test` uses the `FC.exe` binary to compare `stdout`/`stderr` of toolchain binaries. This is provided in the base install of Windows.
Effectively, the ruleset is hermetic.
[launcher-cs]: toolchain/launcher/launcher.cs
[resolved]: https://github.com/bazelbuild/bazel/issues/14009
......@@ -862,7 +862,7 @@
"moduleExtensions": {
"//:MODULE.bazel%_repo_rules": {
"general": {
"bzlTransitiveDigest": "hbZzyE9nsHnAjBWz6wHACQ5LM1Hpm3bvSTklmVSuAyk=",
"bzlTransitiveDigest": "PFMopTeXeJUXjO7mhAB0zNjVZIwhLS7SVjw/jiFEK+4=",
"accumulatedFileDigests": {},
"envVariables": {},
"generatedRepoSpecs": {
......
#! /bin/sh
#! /usr/bin/env sh
set -eu
......
#!/bin/sh
#! /usr/bin/env sh
# Strict shell
set -o errexit -o nounset
......
#! /bin/sh
#! /usr/bin/env sh
# Strict shell
set -o errexit -o nounset
......
......@@ -33,10 +33,12 @@ ATTRS = _ATTRS | {
}
def implementation(rctx):
target = rctx.attr.target or rctx.attr.name.rsplit("~", 1)[1]
basename = rctx.attr.basename or target.removeprefix("resolved-")
substitutions = {
"{{toolchain_type}}": str(rctx.attr.toolchain_type),
"{{basename}}": str(rctx.attr.basename),
"{{target}}": rctx.attr.target or rctx.attr.name.rsplit("~", 1)[1],
"{{basename}}": basename,
"{{target}}": target,
}
rctx.template("resolved.bzl", rctx.attr.resolved, substitutions, executable = False)
rctx.template("BUILD.bazel", rctx.attr.build, substitutions, executable = False)
......
#! /bin/sh
#! /usr/bin/env sh
# e: quit on command errors
# u: quit on undefined variables
......
#!/bin/sh
#! /usr/bin/env sh
# Strict shell
set -o errexit -o nounset
......