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)
Showing
with 101 additions and 174 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
......
# [2.0.0-alpha.1](https://git.gitlab.arm.com/bazel/download_utils/compare/v1.0.1...v2.0.0-alpha.1) (2025-02-27)
### Features
- allow custom metadata files ([9ccc46d](https://git.gitlab.arm.com/bazel/download_utils/commit/9ccc46d008ac352ba9e2f63aeb20e6c7ef8c06b0))
### BREAKING CHANGES
- WORKSPACE files are no longer unconditionally written to the repositories.
## [1.0.1](https://git.gitlab.arm.com/bazel/download_utils/compare/v1.0.0...v1.0.1) (2025-02-12)
### Bug Fixes
......
* @matthew.clarkson
* @bazel
[Shell] @matthew.clarkson
[Shell] @bazel
*.sh
[Batch] @matthew.clarkson
[Batch] @bazel
*.bat
[Documentation] @matthew.clarkson
[Documentation] @bazel
*.md
[Licensing] @matthew.clarkson
[Licensing] @bazel
/LICENSE.md
[Configuration] @matthew.clarkson
[Configuration] @bazel
.editorconfig
[CI] @matthew.clarkson
[CI] @bazel
.gitlab-ci.yml
[Release] @matthew.clarkson
[Release] @bazel
/.releaserc.yaml
[Node] @matthew.clarkson
[Node] @bazel
/package.json
/.npmrc
[Branding] @matthew.clarkson
[Branding] @bazel
/icon.svg
[Bazel] @matthew.clarkson
[Bazel] @bazel
/.bazelrc
/.bazelrc.ci
/.bazelignore
......
module(
name = "download_utils",
version = "1.0.1",
version = "2.0.0-alpha.1",
bazel_compatibility = [
">=7.1.0",
],
compatibility_level = 1,
compatibility_level = 2,
)
bazel_dep(name = "rules_license", version = "1.0.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,7 +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:workspace.bzl", "write")
load("//lib:metadata.bzl", "metadata", _METADATA = "ATTRS")
visibility("//download/...")
......@@ -18,7 +18,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,7 +34,9 @@ def implementation(rctx):
canonical |= links(rctx)
canonical |= commands(rctx)
return write(rctx, canonical)
metadata(rctx, canonical)
return canonical
archive = repository_rule(
doc = DOC,
......
......@@ -3,7 +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:workspace.bzl", "write")
load("//lib:metadata.bzl", "metadata", _METADATA = "ATTRS")
visibility("//download/...")
......@@ -21,7 +21,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,7 +32,9 @@ def implementation(rctx):
canonical |= links(rctx)
canonical |= commands(rctx)
return write(rctx, canonical)
metadata(rctx, canonical)
return canonical
deb = repository_rule(
doc = DOC,
......
......@@ -3,8 +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:workspace.bzl", "write")
load("//lib:metadata.bzl", "metadata", _METADATA = "ATTRS")
visibility("//download/...")
DOC = """Download a single file.
......@@ -20,12 +19,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,7 +30,9 @@ def implementation(rctx):
canonical |= links(rctx)
canonical |= commands(rctx)
return write(rctx, canonical)
metadata(rctx, canonical)
return canonical
file = repository_rule(
doc = DOC,
......
# 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
......
......@@ -34,6 +34,9 @@ archive(
"@coreutils",
],
urls = ["file://%workspace%/archive.tar.xz"],
metadata = {
"//archive:metadata.tmpl": ".integrity",
}
)
file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file")
......@@ -45,7 +48,21 @@ file(
patches = [
"//file:fixture.patch",
],
urls = ["file://%workspace%/fixture.txt"]
)
file(
name = "file_with_build",
integrity = "sha256-2QFMRiSESqW6wxR3PWtomtRn+k4dGlChuKmdWpX3L/U=",
output = "fixture.txt",
patches = [
"//file:fixture.patch",
],
urls = ["file://%workspace%/fixture.txt"],
metadata = {
"//file:metadata.tmpl": ".integrity",
},
build = "//file:BUILD.bazel.tmpl"
)
deb = use_repo_rule("@download_utils//download/deb:defs.bzl", "download_deb")
......@@ -60,6 +77,9 @@ deb(
"//deb:fixture.patch",
],
urls = ["file://%workspace%/test_1.0-1_all.deb"],
metadata = {
"//deb:metadata.tmpl": ".integrity",
}
)
[
......
......@@ -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,11 @@ 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=