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 (7)
# Use pre-release registry. Remove when available in BCR
common --registry https://bcr.bazel.build
common --registry=https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.1/downloads
common --registry=https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.2/downloads
# Build cache
build --experimental_guard_against_concurrent_changes
......
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/ruleset@v1.2.0"
versions:
- 7.1.0
- 7.x
- 8.x
- last_rc
inputs:
oses:
- linux
- windows
- macos
versions:
- 7.4.0
- 7.x
- 8.x
- last_rc
default:
tags:
......
## [1.0.1](https://git.gitlab.arm.com/bazel/download_utils/compare/v1.0.0...v1.0.1) (2025-02-12)
### Bug Fixes
- upgrade to `toolchain_utils@1.0.2` ([c02f469](https://git.gitlab.arm.com/bazel/download_utils/commit/c02f469c5c424e183b25368e85a65cea215bc0d9))
# 1.0.0 (2025-01-22)
### Bug Fixes
......
module(
name = "download_utils",
version = "1.0.0",
version = "1.0.1",
bazel_compatibility = [
">=7.1.0",
],
......@@ -10,7 +10,7 @@ module(
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1", dev_dependency = True)
bazel_dep(name = "toolchain_utils", version = "1.0.1", dev_dependency = True)
bazel_dep(name = "toolchain_utils", version = "1.0.2", dev_dependency = True)
separator = use_repo_rule("//lib:separator.bzl", "separator")
......
......@@ -127,15 +127,15 @@
"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.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01",
"https://bcr.bazel.build/modules/toolchain_utils/1.0.1/MODULE.bazel": "not found",
"https://bcr.bazel.build/modules/toolchain_utils/1.0.2/MODULE.bazel": "not found",
"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.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79",
"https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d",
"https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198",
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.1/downloads/bazel_registry.json": "not found",
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.1/downloads/modules/toolchain_utils/1.0.1/MODULE.bazel": "e490baaaa201408bcb3757f3827f1d9f096fad10af26a12c74897a5550246110",
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.1/downloads/modules/toolchain_utils/1.0.1/source.json": "afe923f3f5f0b93ba3928ee5150065103418eae05757846595840e5bb9a1a400"
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.2/downloads/bazel_registry.json": "not found",
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.2/downloads/modules/toolchain_utils/1.0.2/MODULE.bazel": "9b8be503a4fcfd3b8b952525bff0869177a5234d5c35dc3e566b9f5ca2f755a1",
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.2/downloads/modules/toolchain_utils/1.0.2/source.json": "f70c533c9f1c9e27d4f6be8e985dbd2e9ddfe50b59953ff02c38568b3fa16729"
},
"selectedYankedVersions": {},
"moduleExtensions": {
......
# Use pre-release registry. Remove when available in BCR
common --registry https://bcr.bazel.build
common --registry=https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.1/downloads
common --registry=https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.2/downloads
# Build cache
build --experimental_guard_against_concurrent_changes
......
......@@ -11,8 +11,7 @@ local_path_override(
path = "..",
)
bazel_dep(name = "rules_diff", version = "1.0.0-beta.6")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.18")
bazel_dep(name = "toolchain_utils", version = "1.0.2")
archive = use_repo_rule("@download_utils//download/archive:defs.bzl", "download_archive")
......
......@@ -10,8 +10,6 @@
"https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915",
"https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed",
"https://bcr.bazel.build/modules/abseil-cpp/20240116.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da",
"https://bcr.bazel.build/modules/ape/1.0.0-beta.15/MODULE.bazel": "8e80575b6a5914a7e98b76327f3084efebe2de464178a4e6c1a5bc01b0688a28",
"https://bcr.bazel.build/modules/ape/1.0.0-beta.15/source.json": "25c9a8eac68c904fa8615d66aea263b4d457498c33fef7715451615af0b6ef32",
"https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd",
"https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8",
"https://bcr.bazel.build/modules/bazel_features/1.13.0/MODULE.bazel": "c14c33c7c3c730612bdbe14ebbb5e61936b6f11322ea95a6e91cd1ba962f94df",
......@@ -76,8 +74,6 @@
"https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f",
"https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e",
"https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5",
"https://bcr.bazel.build/modules/rules_diff/1.0.0-beta.6/MODULE.bazel": "5af9b4750785ee7603e4616a7463e87cb3ef016ec86da8cb6d592a33c735b6c0",
"https://bcr.bazel.build/modules/rules_diff/1.0.0-beta.6/source.json": "58c2d1082dce218af90bcb70eddcb3b6b011dbe9168134614022f825f722a8db",
"https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6",
"https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8",
"https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e",
......@@ -131,13 +127,15 @@
"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.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01",
"https://bcr.bazel.build/modules/toolchain_utils/1.0.0-beta.18/MODULE.bazel": "b90d1ed54151985dd8ed72277885858540fa54d04ade39c9ba26e23c2086255d",
"https://bcr.bazel.build/modules/toolchain_utils/1.0.0-beta.18/source.json": "4aa5f1a92e2b36b0723c978713d9aeb54089f2bef25319d7e7b5162e2d1798d2",
"https://bcr.bazel.build/modules/toolchain_utils/1.0.2/MODULE.bazel": "not found",
"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.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79",
"https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d",
"https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198"
"https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198",
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.2/downloads/bazel_registry.json": "not found",
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.2/downloads/modules/toolchain_utils/1.0.2/MODULE.bazel": "9b8be503a4fcfd3b8b952525bff0869177a5234d5c35dc3e566b9f5ca2f755a1",
"https://gitlab.arm.com/bazel/toolchain_utils/-/releases/v1.0.2/downloads/modules/toolchain_utils/1.0.2/source.json": "f70c533c9f1c9e27d4f6be8e985dbd2e9ddfe50b59953ff02c38568b3fa16729"
},
"selectedYankedVersions": {},
"moduleExtensions": {
......
load("@rules_diff//diff/file/test:defs.bzl", "diff_file_test")
load("//diff/file/test:defs.bzl", "diff_file_test")
diff_file_test(
name = "fixture",
......
load("@rules_diff//diff/file/test:defs.bzl", "diff_file_test")
load("//diff/file/test:defs.bzl", "diff_file_test")
diff_file_test(
name = "fixture",
......
alias(
name = "template",
actual = select({
"@toolchain_utils//toolchain/constraint/os:windows": ":nt.tmpl.bat",
"//conditions:default": ":posix.tmpl.sh",
}),
visibility = ["//visibility:public"],
)
load(":rule.bzl", _test = "test")
visibility("public")
diff_file_test = _test
@echo off
:: Enable Batch extensions
verify other 2>nul
setlocal EnableExtensions
if errorlevel 1 (
echo>&2.Failed to enable extensions
exit /b 120
)
:: Bazel substitutions
call :rlocation A "{{a}}"
if errorlevel 1 (
echo>&2.Failed to resolve runfile
exit /b 2
)
call :rlocation B "{{b}}"
if errorlevel 1 (
echo>&2.Failed to resolve runfile
exit /b 2
)
:: Provided on all Windows installations
set "DIFF=%SYSTEMROOT%\\system32\\fc.exe"
:: Perform the difference
"%DIFF%" "%A%" "%B%"
exit /b %ERRORLEVEL%
:rlocation - resolve run files
:: %1 - return code variable
:: %2 - runfile path
setlocal
set "FILEPATH=%2%"
for /f usebackq %%a in ('%FILEPATH%') do set "FILEPATH=%%~a"
if [%RUNFILES_MANIFEST_ONLY%] neq [1] (
echo>&2.Only runfile manifests are supported
exit /b 2
)
for /f "tokens=1,2* usebackq" %%a in ("%RUNFILES_MANIFEST_FILE%") do (
if "_main/%FILEPATH%" == "%%a" (
set "FILEPATH=%%~fb"
)
if "%FILEPATH%" == "../%%a" (
set "FILEPATH=%%~fb"
)
)
if not exist "%FILEPATH%" (
echo>&2.Failed to resolve runfile: %FILEPATH%
exit /b 2
)
endlocal & set "%~1=%FILEPATH%"
goto :eof
#!/usr/bin/env sh
# Strict shell
set -o errexit
set -o nounset
# Bazel substitutions
A="{{a}}"
B="{{b}}"
readonly A B
# Test environment
JUNIT="${XML_OUTPUT_FILE-junit.xml}"
readonly JUNIT
diff() (
INDEX="${1}"
FILEPATH="${2}"
EXPECTED="${3}"
while true; do
FAILS=0
IFS= read -r L <&3 || FAILS=$((FAILS + 1))
IFS= read -r R <&4 || FAILS=$((FAILS + 1))
if test "${FAILS}" -eq 1; then
printf >&2 'not ok %i - %s had a different number of lines to %s\n' "${INDEX}" "${FILEPATH}" "${EXPECTED}"
printf ' <testcase name="%s">\n' "${FILEPATH}"
printf ' <failure type="Difference">%s contained different line counts:\n' "${FILEPATH}"
printf '%s %s\n' '---' "${FILEPATH}"
printf '%s %s\n' '+++' "${EXPECTED}"
printf '@@ -1 +1 @@\n'
printf '%s%s\n' '-' "${A-}"
printf '%s%s\n' '+' "${B-}"
printf '</failure>\n'
printf ' </testcase>\n'
exit
elif test "${FAILS}" -eq 2; then
break
elif test "${L}" != "${R}"; then
printf >&2 'not ok %i: %s had different content to %s\n' "${INDEX}" "${FILEPATH}" "${EXPECTED}"
printf ' <testcase name="%s">\n' "${FILEPATH}"
printf ' <failure type="Difference">%s contained different content:\n' "${FILEPATH}"
printf '%s %s\n' '---' "${FILEPATH}"
printf '%s %s\n' '+++' "${EXPECTED}"
printf '@@ -1 +1 @@\n'
printf '%s%s\n' '-' "${L}"
printf '%s%s\n' '+' "${R}"
printf '</failure>\n'
printf ' </testcase>\n'
exit
fi
done 3<"${FILEPATH}" 4<"${EXPECTED}"
printf >&2 'ok %s - %s was equal to %s\n' "${INDEX}" "${FILEPATH}" "${EXPECTED}"
printf ' <testcase name="%s"/>\n' "${FILEPATH}"
)
junit() (
COUNT="${#}"
TESTS=$((COUNT / 2))
readonly COUNT TESTS
printf '<testsuite tests="%s">\n' "${TESTS}"
printf >&2 '1..%i\n' "${TESTS}"
INDEX=1
while ! test -z ${2+x}; do
FILEPATH="${1}"
EXPECTED="${2}"
shift 2
diff "${INDEX}" "${FILEPATH}" "${EXPECTED}"
INDEX=$((INDEX + 1))
done
printf '</testsuite>\n'
)
junit "${A}" "${B}" >"${JUNIT}"
while IFS= read -r LINE; do
if test -z "${LINE#*</failure>*}"; then
exit 1
fi
done <"${JUNIT}"
visibility("//...")
DOC = """Performs a difference between two files and fails if any are found.
```py
diff_file_test(
name = "test",
a = ":some-file.txt",
b = ":some-file.txt",
size = "small",
)
```
"""
ATTRS = {
"a": attr.label(
doc = "A file to compare.",
allow_single_file = True,
mandatory = True,
),
"b": attr.label(
doc = "Another file to compare.",
allow_single_file = True,
mandatory = True,
),
"template": attr.label(
doc = "The script template to be rendered into the test executable.",
allow_single_file = True,
default = ":template",
),
}
def implementation(ctx):
rendered = ctx.actions.declare_file("{}.rendered.{}".format(ctx.label.name, ctx.file.template.extension))
ctx.actions.expand_template(
output = rendered,
template = ctx.file.template,
is_executable = True,
substitutions = {
"{{a}}": ctx.file.a.short_path,
"{{b}}": ctx.file.b.short_path,
},
)
files = depset([rendered])
runfiles = ctx.runfiles(files = [ctx.file.a, ctx.file.b])
return DefaultInfo(
executable = rendered,
files = files,
runfiles = runfiles,
)
diff_file_test = rule(
doc = DOC,
attrs = ATTRS,
implementation = implementation,
test = True,
)
test = diff_file_test
load("@rules_diff//diff/file/test:defs.bzl", "diff_file_test")
load("//diff/file/test:defs.bzl", "diff_file_test")
diff_file_test(
name = "fixture",
......