Skip to content
Commits on Source (8)
......@@ -10,5 +10,8 @@ build --incompatible_strict_action_env
# Prevent symlink forest under `.runfiles/wsname/external/repo`
build --nolegacy_external_runfiles
# Avoid building all targets when testing
test --build_tests_only
# User-specific .bazelrc
try-import %workspace%/.bazelrc.user
......@@ -22,9 +22,6 @@ common --attempt_to_print_relative_paths
# Output as much information in the CI log about failures as possible
build --verbose_failures
# Avoid building all targets when testing
test --build_tests_only
# Noisy logs but allows debugging CI run failures
test --test_output=errors
......
7.0.0rc7
\ No newline at end of file
7.x
# [1.0.0-alpha.9](https://git.gitlab.arm.com/bazel/rules_toolchain/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2023-12-13)
### Bug Fixes
- create hardlinks on Windows ([fb7691d](https://git.gitlab.arm.com/bazel/rules_toolchain/commit/fb7691df6a7948dd19cddceca2a169480ed40913))
- set minimum version to Bazel 7 ([0db2cc7](https://git.gitlab.arm.com/bazel/rules_toolchain/commit/0db2cc79ca316ef76fb02c33baf35810479dbc59))
### Features
- add `msvc` C library constraint ([f638f1f](https://git.gitlab.arm.com/bazel/rules_toolchain/commit/f638f1fa59df687302443216857d6353a48e9f64))
# [1.0.0-alpha.8](https://git.gitlab.arm.com/bazel/rules_toolchain/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2023-12-11)
### Bug Fixes
......
module(
name = "rules_toolchain",
version = "1.0.0-alpha.8",
version = "1.0.0-alpha.9",
bazel_compatibility = [
">=6.4.0",
">=7.0.0",
],
compatibility_level = 1,
)
......
{
"lockFileVersion": 3,
"moduleFileHash": "55a8f1e3f74b9d8c0339def09fee2ef9e3ba7d6867977992475a8ff11094305f",
"moduleFileHash": "903e61c59d8500c0616898a6fa8efbf2fd6c9b8936db0d502880b5ead514bb02",
"flags": {
"cmdRegistries": [
"https://bcr.bazel.build/"
......
......@@ -72,7 +72,15 @@ toolchain(
To create a hermetic toolchain from a downloaded target:
```py
# Assume `:echo-arm64-linux-gnu` is a downloaded `echo` binary
load("@rules_toolchain//toolchain/symlink/target:defs.bzl", "toolchain_symlink_target")
# Create the necessary toolchain providers around the downloaded target
toolchain_symlink_target(
name = "echo-arm64-linux-gnu",
target = ":downloaded-echo-arm64-linux-gnu"
)
# Register with the correct contraints
toolchain(
name = "arm64-linux",
toolchain = ":echo-arm64-linux-gnu",
......
7.0.0rc7
\ No newline at end of file
7.x
module(
name = "e2e",
bazel_compatibility = [
">=6.4.0",
">=7.0.0",
],
)
......
{
"lockFileVersion": 3,
"moduleFileHash": "33d7bab2dd31ed91bc652763be07b5096e6999fccdf0ed68bad1008aa7b9884c",
"moduleFileHash": "b5e5212db85ac60ce843baccd184e5d16937d6d310b430f73224a70d9bf8cfa1",
"flags": {
"cmdRegistries": [
"https://bcr.bazel.build/"
......@@ -13,7 +13,7 @@
"compatibilityMode": "ERROR"
},
"localOverrideHashes": {
"rules_toolchain": "55a8f1e3f74b9d8c0339def09fee2ef9e3ba7d6867977992475a8ff11094305f",
"rules_toolchain": "903e61c59d8500c0616898a6fa8efbf2fd6c9b8936db0d502880b5ead514bb02",
"bazel_tools": "922ea6752dc9105de5af957f7a99a6933c0a6a712d23df6aad16a9c399f7e787"
},
"moduleDepGraph": {
......@@ -848,7 +848,7 @@
"moduleExtensions": {
"//:MODULE.bazel%_repo_rules": {
"general": {
"bzlTransitiveDigest": "gyM/unRUgkxmFCQHcLcZtVkdb+4qFdRusznNLzQ7Ukc=",
"bzlTransitiveDigest": "0/0JKbXjdx0+MCsL4hbq33HmaZLsejCHZ1wZeOcD9Es=",
"accumulatedFileDigests": {},
"envVariables": {},
"generatedRepoSpecs": {
......
......@@ -11,3 +11,8 @@ constraint_value(
name = "ucrt",
constraint_setting = ":libc",
)
constraint_value(
name = "msvc",
constraint_setting = ":libc",
)
......@@ -39,7 +39,7 @@ def implementation(ctx):
elif not extension and "." not in basename and ctx.target_platform_has_constraint(windows):
basename = "{}.exe".format(basename)
executable = ctx.actions.declare_file(basename)
executable = ctx.actions.declare_file("toolchain/resolved/{}".format(basename))
ctx.actions.symlink(
output = executable,
target_file = target,
......
......@@ -36,11 +36,27 @@ def implementation(ctx):
elif not extension and "." not in basename and ctx.target_platform_has_constraint(windows):
basename = "{}.exe".format(basename)
executable = ctx.actions.declare_symlink(basename)
ctx.actions.symlink(
output = executable,
target_path = ctx.attr.path,
)
if ctx.target_platform_has_constraint(windows):
executable = ctx.actions.declare_file("toolchain/symlink/path/{}".format(basename))
args = ctx.actions.args()
args.add("/c")
args.add("mklink")
args.add("/h")
args.add(executable.path, format = '"%s"')
args.add(ctx.attr.path, format = '"%s"')
ctx.actions.run(
outputs = [executable],
executable = "cmd.exe",
arguments = [args],
)
else:
executable = ctx.actions.declare_symlink("toolchain/symlink/path/{}".format(basename))
ctx.actions.symlink(
output = executable,
target_path = ctx.attr.path,
)
variables = platform_common.TemplateVariableInfo({
variable: executable.path,
......
......@@ -72,7 +72,7 @@ def implementation(ctx):
elif not extension and "." not in basename and ctx.target_platform_has_constraint(windows):
basename = "{}.exe".format(basename)
executable = ctx.actions.declare_file(basename)
executable = ctx.actions.declare_file("toolchain/symlink/target/{}".format(basename))
ctx.actions.symlink(
output = executable,
target_file = target,
......
......@@ -42,7 +42,7 @@ def implementation(ctx):
fail("Only one toolchain can be provided")
toolchain = ctx.attr.toolchains[0][platform_common.ToolchainInfo]
executable = ctx.actions.declare_file("{}.{}".format(ctx.label.name, ctx.file.template.extension))
executable = ctx.actions.declare_file("toolchain/test/{}.{}".format(ctx.label.name, ctx.file.template.extension))
substitutions = ctx.actions.template_dict()
substitutions.add("{{executable}}", str(toolchain.executable.short_path))
......
......@@ -19,7 +19,7 @@ def implementation(ctx):
value = ctx.attr.value or ctx.label.name
triplet = TripletInfo(value)
output = ctx.actions.declare_file("{}.txt".format(value))
output = ctx.actions.declare_file("toolchain/triplet/{}.txt".format(value))
ctx.actions.write(
output = output,
content = value,
......@@ -28,7 +28,7 @@ def implementation(ctx):
substitutions = ctx.actions.template_dict()
substitutions.add("{{triplet}}", value)
executable = ctx.actions.declare_file("{}.{}".format(value, ctx.file.template.extension))
executable = ctx.actions.declare_file("toolchain/triplet/{}.{}".format(value, ctx.file.template.extension))
ctx.actions.expand_template(
output = executable,
template = ctx.file.template,
......