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 (10)
Showing with 90 additions and 156 deletions
# 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.2/downloads
# Build cache
build --experimental_guard_against_concurrent_changes
......
......@@ -22,5 +22,8 @@ package_info(
# Just here to provide a test target so `bazel test ...` passes
build_test(
name = "test",
targets = [":license", ":package_info"],
targets = [
":license",
":package_info",
],
)
# [1.1.0-beta.1](https://git.gitlab.arm.com/bazel/download_utils/compare/v1.0.1...v1.1.0-beta.1) (2025-02-28)
### Bug Fixes
- append canonical arguments to `WORKSPACE` if it exists ([86b169d](https://git.gitlab.arm.com/bazel/download_utils/commit/86b169d04841489f83c13a64a8b48dd24f0e3fad))
- do not write `WORKSPACE` if `metadata` attribute is set ([1dc4fb7](https://git.gitlab.arm.com/bazel/download_utils/commit/1dc4fb7fc1b7b0e92cdfa4d9693e5df5b17ed4b6))
### Features
- allow custom metadata files ([ea05186](https://git.gitlab.arm.com/bazel/download_utils/commit/ea05186e72848a1dca7348f035989cf40d7ab91c))
## [1.0.1](https://git.gitlab.arm.com/bazel/download_utils/compare/v1.0.0...v1.0.1) (2025-02-12)
### Bug Fixes
......
module(
name = "download_utils",
version = "1.0.1",
version = "1.1.0-beta.1",
bazel_compatibility = [
">=7.1.0",
],
......
......@@ -127,15 +127,13 @@
"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.2/MODULE.bazel": "not found",
"https://bcr.bazel.build/modules/toolchain_utils/1.0.2/MODULE.bazel": "9b8be503a4fcfd3b8b952525bff0869177a5234d5c35dc3e566b9f5ca2f755a1",
"https://bcr.bazel.build/modules/toolchain_utils/1.0.2/source.json": "88769ec576dddacafd8cca4631812cf8eead89f10a29d9405d9f7a553de6bf87",
"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.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"
"https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198"
},
"selectedYankedVersions": {},
"moduleExtensions": {
......@@ -176,70 +174,6 @@
]
]
}
},
"@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": {
"general": {
"bzlTransitiveDigest": "sFhcgPbDQehmbD1EOXzX4H1q/CD5df8zwG4kp4jbvr8=",
"usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=",
"recordedFileInputs": {},
"recordedDirentsInputs": {},
"envVariables": {},
"generatedRepoSpecs": {
"com_github_jetbrains_kotlin_git": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository",
"attributes": {
"urls": [
"https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip"
],
"sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88"
}
},
"com_github_jetbrains_kotlin": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository",
"attributes": {
"git_repository_name": "com_github_jetbrains_kotlin_git",
"compiler_version": "1.9.23"
}
},
"com_github_google_ksp": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository",
"attributes": {
"urls": [
"https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip"
],
"sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d",
"strip_version": "1.9.23-1.0.20"
}
},
"com_github_pinterest_ktlint": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file",
"attributes": {
"sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985",
"urls": [
"https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint"
],
"executable": true
}
},
"rules_android": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
"strip_prefix": "rules_android-0.1.1",
"urls": [
"https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"
]
}
}
},
"recordedRepoMappingEntries": [
[
"rules_kotlin+",
"bazel_tools",
"bazel_tools"
]
]
}
}
}
}
......@@ -3,6 +3,7 @@ load("//lib:download_and_extract.bzl", "download_and_extract", _DOWNLOAD_AND_EXT
load("//lib:patch.bzl", "patch", _PATCH = "ATTRS")
load("//lib:build.bzl", "build", _BUILD = "ATTRS")
load("//lib:links.bzl", "links", _LINKS = "ATTRS")
load("//lib:metadata.bzl", "metadata", _METADATA = "ATTRS")
load("//lib:workspace.bzl", "write")
visibility("//download/...")
......@@ -18,7 +19,7 @@ download_archive(
```
"""
ATTRS = _COMMANDS | _DOWNLOAD_AND_EXTRACT | _PATCH | _BUILD | _LINKS | {
ATTRS = _COMMANDS | _DOWNLOAD_AND_EXTRACT | _PATCH | _BUILD | _LINKS | _METADATA | {
"extension": attr.string(
doc = "The extension of the archive when not available from the URL.",
values = [".zip", ".tar", ".tar.gz", ".tar.bz2", ".tar.xz", ".tar.zst"],
......@@ -34,6 +35,8 @@ def implementation(rctx):
canonical |= links(rctx)
canonical |= commands(rctx)
metadata(rctx, canonical)
return write(rctx, canonical)
archive = repository_rule(
......
......@@ -3,6 +3,7 @@ load("//lib:download_and_extract.bzl", "download_and_extract", _DOWNLOAD_AND_EXT
load("//lib:patch.bzl", "patch", _PATCH = "ATTRS")
load("//lib:build.bzl", "build", _BUILD = "ATTRS")
load("//lib:links.bzl", "links", _LINKS = "ATTRS")
load("//lib:metadata.bzl", "metadata", _METADATA = "ATTRS")
load("//lib:workspace.bzl", "write")
visibility("//download/...")
......@@ -21,7 +22,7 @@ download_deb(
```
"""
ATTRS = _COMMANDS | _DOWNLOAD_AND_EXTRACT | _PATCH | _BUILD | _LINKS
ATTRS = _COMMANDS | _DOWNLOAD_AND_EXTRACT | _PATCH | _BUILD | _LINKS | _METADATA
def implementation(rctx):
canonical = {a: getattr(rctx.attr, a) for a in ATTRS} | {"name": rctx.name}
......@@ -32,6 +33,8 @@ def implementation(rctx):
canonical |= links(rctx)
canonical |= commands(rctx)
metadata(rctx, canonical)
return write(rctx, canonical)
deb = repository_rule(
......
......@@ -3,6 +3,7 @@ load("//lib:download.bzl", "download", _DOWNLOAD = "ATTRS")
load("//lib:patch.bzl", "patch", _PATCH = "ATTRS")
load("//lib:build.bzl", "build", _BUILD = "ATTRS")
load("//lib:links.bzl", "links", _LINKS = "ATTRS")
load("//lib:metadata.bzl", "metadata", _METADATA = "ATTRS")
load("//lib:workspace.bzl", "write")
visibility("//download/...")
......@@ -20,12 +21,7 @@ download_file(
```
"""
ATTRS = _COMMANDS | _DOWNLOAD | _PATCH | _BUILD | _LINKS | {
"build": attr.label(
doc = "The template for the `BUILD.bazel` file.",
default = ":BUILD.tmpl.bazel",
),
}
ATTRS = _COMMANDS | _DOWNLOAD | _PATCH | _BUILD | _LINKS | _METADATA
def implementation(rctx):
canonical = {a: getattr(rctx.attr, a) for a in ATTRS} | {"name": rctx.name}
......@@ -36,6 +32,8 @@ def implementation(rctx):
canonical |= links(rctx)
canonical |= commands(rctx)
metadata(rctx, canonical)
return write(rctx, canonical)
file = repository_rule(
......
# 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.2/downloads
# Build cache
build --experimental_guard_against_concurrent_changes
......
......@@ -27,6 +27,9 @@ archive(
},
extension = ".tar.xz",
integrity = "sha256-PWscbDJ+esMLMe4/ix5LTP+lsR1piMNe7r9eHsx/KOg=",
metadata = {
"//archive:metadata.tmpl": ".integrity",
},
patches = [
"//archive:fixture.patch",
],
......@@ -48,6 +51,20 @@ file(
urls = ["file://%workspace%/fixture.txt"],
)
file(
name = "file_with_build",
build = "//file:BUILD.bazel.tmpl",
integrity = "sha256-2QFMRiSESqW6wxR3PWtomtRn+k4dGlChuKmdWpX3L/U=",
metadata = {
"//file:metadata.tmpl": ".integrity",
},
output = "fixture.txt",
patches = [
"//file:fixture.patch",
],
urls = ["file://%workspace%/fixture.txt"],
)
deb = use_repo_rule("@download_utils//download/deb:defs.bzl", "download_deb")
deb(
......@@ -56,6 +73,9 @@ deb(
links = {
"etc/test/fixture.txt": "symlink.txt",
},
metadata = {
"//deb:metadata.tmpl": ".integrity",
},
patches = [
"//deb:fixture.patch",
],
......
......@@ -127,15 +127,13 @@
"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.2/MODULE.bazel": "not found",
"https://bcr.bazel.build/modules/toolchain_utils/1.0.2/MODULE.bazel": "9b8be503a4fcfd3b8b952525bff0869177a5234d5c35dc3e566b9f5ca2f755a1",
"https://bcr.bazel.build/modules/toolchain_utils/1.0.2/source.json": "88769ec576dddacafd8cca4631812cf8eead89f10a29d9405d9f7a553de6bf87",
"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.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"
"https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198"
},
"selectedYankedVersions": {},
"moduleExtensions": {
......@@ -176,70 +174,6 @@
]
]
}
},
"@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": {
"general": {
"bzlTransitiveDigest": "sFhcgPbDQehmbD1EOXzX4H1q/CD5df8zwG4kp4jbvr8=",
"usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=",
"recordedFileInputs": {},
"recordedDirentsInputs": {},
"envVariables": {},
"generatedRepoSpecs": {
"com_github_jetbrains_kotlin_git": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository",
"attributes": {
"urls": [
"https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip"
],
"sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88"
}
},
"com_github_jetbrains_kotlin": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository",
"attributes": {
"git_repository_name": "com_github_jetbrains_kotlin_git",
"compiler_version": "1.9.23"
}
},
"com_github_google_ksp": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository",
"attributes": {
"urls": [
"https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip"
],
"sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d",
"strip_version": "1.9.23-1.0.20"
}
},
"com_github_pinterest_ktlint": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file",
"attributes": {
"sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985",
"urls": [
"https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint"
],
"executable": true
}
},
"rules_android": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
"strip_prefix": "rules_android-0.1.1",
"urls": [
"https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"
]
}
}
},
"recordedRepoMappingEntries": [
[
"rules_kotlin+",
"bazel_tools",
"bazel_tools"
]
]
}
}
}
}
......@@ -13,3 +13,10 @@ diff_file_test(
a = "@archive//:symlink.txt",
b = ":fixture.txt",
)
diff_file_test(
name = "metadata",
size = "small",
a = "@archive//:.integrity",
b = ":fixture.integrity",
)
sha256-PWscbDJ+esMLMe4/ix5LTP+lsR1piMNe7r9eHsx/KOg=
{{integrity}}
......@@ -13,3 +13,10 @@ diff_file_test(
a = "@deb//:symlink.txt",
b = ":fixture.txt",
)
diff_file_test(
name = "metadata",
size = "small",
a = "@deb//:.integrity",
b = ":fixture.integrity",
)
sha256-vMiq8kFBwoSrVEE+Tcs08RvaiNp6MsboWlXS7p1clO0=
{{integrity}}
......@@ -6,3 +6,10 @@ diff_file_test(
a = "@file//:fixture.txt",
b = ":fixture.txt",
)
diff_file_test(
name = "metadata",
size = "small",
a = "@file_with_build//:.integrity",
b = ":fixture.integrity",
)
filegroup(
name = "srcs",
srcs = glob({{srcs}}),
visibility = ["//visibility:public"],
)
exports_files(
glob({{srcs}} + [".integrity"]),
visibility = ["//visibility:public"],
)
sha256-2QFMRiSESqW6wxR3PWtomtRn+k4dGlChuKmdWpX3L/U=