From 196b2e720feeb393edfc1767fbdc83e06f3a1fb4 Mon Sep 17 00:00:00 2001 From: lalten Date: Fri, 3 Apr 2026 11:00:07 +0200 Subject: [PATCH 1/4] Update dependencies --- MODULE.bazel | 28 +++++++++++++--------- WORKSPACE | 8 +++++++ deps.bzl | 66 ++++++++++++++++++++++++++++------------------------ docs/BUILD | 2 +- 4 files changed, 62 insertions(+), 42 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 8f17c93d..2d87ca35 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -5,21 +5,27 @@ module( version = "0.0.0", ) -bazel_dep(name = "bazel_skylib", version = "1.8.2") -bazel_dep(name = "platforms", version = "0.0.11") -bazel_dep(name = "rules_cc", version = "0.2.13") -bazel_dep(name = "rules_python", version = "1.7.0") -bazel_dep(name = "rules_shell", version = "0.6.1") +bazel_dep(name = "bazel_skylib", version = "1.9.0") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "rules_cc", version = "0.2.17") +bazel_dep(name = "rules_python", version = "1.9.0") +bazel_dep(name = "rules_shell", version = "0.7.1") bazel_dep(name = "squashfs-tools", version = "4.7.5") -bazel_dep(name = "aspect_bazel_lib", version = "2.21.2", dev_dependency = True) -bazel_dep(name = "container_structure_test", version = "1.19.1", dev_dependency = True) -bazel_dep(name = "rules_oci", version = "2.2.6", dev_dependency = True) -bazel_dep(name = "rules_pkg", version = "1.1.0", dev_dependency = True) +bazel_dep(name = "bazel_lib", version = "3.2.2", dev_dependency = True) +bazel_dep(name = "container_structure_test", version = "1.22.1", dev_dependency = True) +bazel_dep(name = "llvm", version = "0.7.0", dev_dependency = True) +bazel_dep(name = "rules_oci", version = "2.3.0", dev_dependency = True) +bazel_dep(name = "rules_pkg", version = "1.2.0", dev_dependency = True) bazel_dep(name = "rules_pycross", version = "0.8.1", dev_dependency = True) bazel_dep(name = "rules_testing", version = "0.9.0", dev_dependency = True) -bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True) -bazel_dep(name = "with_cfg.bzl", version = "0.10.3", dev_dependency = True) +bazel_dep(name = "stardoc", version = "0.8.1", dev_dependency = True) +bazel_dep(name = "with_cfg.bzl", version = "0.14.6", dev_dependency = True) + +register_toolchains( + "@llvm//toolchain:all", + dev_dependency = True, +) rules_appimage = use_extension("//:extensions.bzl", "appimage_ext_dependencies") use_repo( diff --git a/WORKSPACE b/WORKSPACE index c748342a..0ed038d6 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -6,6 +6,14 @@ rules_appimage_deps() rules_appimage_development_deps() +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains") rules_shell_dependencies() diff --git a/deps.bzl b/deps.bzl index 49626851..6c0a933f 100644 --- a/deps.bzl +++ b/deps.bzl @@ -63,9 +63,9 @@ def _rules_appimage_workspace_deps(): maybe( http_archive, name = "rules_python", - sha256 = "f609f341d6e9090b981b3f45324d05a819fd7a5a56434f849c761971ce2c47da", - strip_prefix = "rules_python-1.7.0", - url = "https://github.com/bazelbuild/rules_python/releases/download/1.7.0/rules_python-1.7.0.tar.gz", + sha256 = "098ba13578e796c00c853a2161f382647f32eb9a77099e1c88bc5299333d0d6e", + strip_prefix = "rules_python-1.9.0", + url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0/rules_python-1.9.0.tar.gz", ) def rules_appimage_development_deps(): @@ -75,48 +75,54 @@ def rules_appimage_development_deps(): maybe( http_archive, name = "bazel_features", - sha256 = "adc8ddf121917f197f75c5245dfa8d7b1619f10a1002e25062b093b7957f2798", - strip_prefix = "bazel_features-1.37.0", - url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.37.0/bazel_features-v1.37.0.tar.gz", + sha256 = "adfdb3cffab3a99a63363d844d559a81965d2b61a6062dd51a3d2478d416768f", + strip_prefix = "bazel_features-1.45.0", + url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.45.0/bazel_features-v1.45.0.tar.gz", ) - # jq.bzl is needed by aspect_bazel_lib + # jq.bzl is needed by bazel_lib maybe( http_archive, name = "jq.bzl", - sha256 = "21617eb71fb775a748ef5639131ab943ef39946bd2a4ce96ea60b03f985db0c5", - strip_prefix = "jq.bzl-0.4.0", - url = "https://github.com/bazel-contrib/jq.bzl/releases/download/v0.4.0/jq.bzl-v0.4.0.tar.gz", + sha256 = "e2eab5410b2eecc72f01d73590c58aefeddbb696ddf9d9c34dcee02dd79625ab", + strip_prefix = "jq.bzl-0.6.1", + url = "https://github.com/bazel-contrib/jq.bzl/releases/download/v0.6.1/jq.bzl-v0.6.1.tar.gz", ) - # aspect_bazel_lib is needed by rules_pycross (which is not used by tests in WORKSPACE) and with_cfg.bzl + # bazel_lib is needed by rules_pycross (which is not used by tests in WORKSPACE) and with_cfg.bzl maybe( http_archive, - name = "aspect_bazel_lib", - sha256 = "53cadea9109e646a93ed4dc90c9bbcaa8073c7c3df745b92f6a5000daf7aa3da", - strip_prefix = "bazel-lib-2.21.2", - url = "https://github.com/bazel-contrib/bazel-lib/releases/download/v2.21.2/bazel-lib-v2.21.2.tar.gz", + name = "bazel_lib", + sha256 = "3d62bf30b95b71a566d9ebca50ee78d370b12522d244235b41166f65b142705d", + strip_prefix = "bazel-lib-3.2.2", + url = "https://github.com/bazel-contrib/bazel-lib/releases/download/v3.2.2/bazel-lib-v3.2.2.tar.gz", + ) + maybe( + http_archive, + name = "platforms", + url = "https://github.com/bazelbuild/platforms/releases/download/1.0.0/platforms-1.0.0.tar.gz", + sha256 = "3384eb1c30762704fbe38e440204e114154086c8fc8a8c2e3e28441028c019a8", ) maybe( http_archive, name = "rules_cc", - sha256 = "472ddca8cec1e64ad78e4f0cabbec55936a3baddbe7bef072764ca91504bd523", - strip_prefix = "rules_cc-0.2.13", - url = "https://github.com/bazelbuild/rules_cc/releases/download/0.2.13/rules_cc-0.2.13.tar.gz", + sha256 = "283fa1cdaaf172337898749cf4b9b1ef5ea269da59540954e51fba0e7b8f277a", + strip_prefix = "rules_cc-0.2.17", + url = "https://github.com/bazelbuild/rules_cc/releases/download/0.2.17/rules_cc-0.2.17.tar.gz", ) maybe( http_archive, name = "rules_oci", - sha256 = "5994ec0e8df92c319ef5da5e1f9b514628ceb8fc5824b4234f2fe635abb8cc2e", - strip_prefix = "rules_oci-2.2.6", - url = "https://github.com/bazel-contrib/rules_oci/releases/download/v2.2.6/rules_oci-v2.2.6.tar.gz", + sha256 = "e987cab7a35475cb9c9060fc3f338a1fc8896c240295a3272968b217acefd0cb", + strip_prefix = "rules_oci-2.3.0", + url = "https://github.com/bazel-contrib/rules_oci/releases/download/v2.3.0/rules_oci-v2.3.0.tar.gz", ) maybe( http_archive, name = "rules_shell", - sha256 = "e6b87c89bd0b27039e3af2c5da01147452f240f75d505f5b6880874f31036307", - strip_prefix = "rules_shell-0.6.1", - url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.6.1/rules_shell-v0.6.1.tar.gz", + sha256 = "3709d1745ba4be4ef054449647b62e424267066eca887bb00dd29242cb8463a0", + strip_prefix = "rules_shell-0.7.1", + url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.7.1/rules_shell-v0.7.1.tar.gz", ) maybe( http_archive, @@ -128,14 +134,14 @@ def rules_appimage_development_deps(): maybe( http_archive, name = "with_cfg.bzl", - sha256 = "c8eb6b436415ad283ccc72291542b597934b95f227211837005f2928eb542e6c", - strip_prefix = "with_cfg.bzl-0.10.3", - url = "https://github.com/fmeum/with_cfg.bzl/releases/download/v0.10.3/with_cfg.bzl-v0.10.3.tar.gz", + sha256 = "87852e133c3755a5642fe10543ee20eda700dae14d30d13dac96e22ea5106d07", + strip_prefix = "with_cfg.bzl-0.14.6", + url = "https://github.com/fmeum/with_cfg.bzl/releases/download/v0.14.6/with_cfg.bzl-v0.14.6.tar.gz", ) maybe( http_archive, name = "container_structure_test", - sha256 = "c91a76f7b4949775941f8308ee7676285555ae4756ec1ec990c609c975a55f93", - strip_prefix = "container-structure-test-1.19.3", - url = "https://github.com/GoogleContainerTools/container-structure-test/archive/refs/tags/v1.19.3.tar.gz", + sha256 = "186bb1493ebb3c597e53b2a7abd5460c683c63d404e44a64223d26bb3315841d", + strip_prefix = "container-structure-test-1.22.1", + url = "https://github.com/GoogleContainerTools/container-structure-test/archive/refs/tags/v1.22.1.tar.gz", ) diff --git a/docs/BUILD b/docs/BUILD index a746421a..736f251f 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -1,4 +1,4 @@ -load("@aspect_bazel_lib//lib:docs.bzl", "stardoc_with_diff_test", "update_docs") +load("@bazel_lib//lib:docs.bzl", "stardoc_with_diff_test", "update_docs") stardoc_with_diff_test( name = "defs", From 73c3b853a56d892798147ddb7f1c6bfb7a015cdd Mon Sep 17 00:00:00 2001 From: lalten Date: Fri, 3 Apr 2026 11:10:00 +0200 Subject: [PATCH 2/4] rm toolchains_llvm_bootstrapped again, needs bazel >8.3 --- MODULE.bazel | 6 ------ 1 file changed, 6 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 2d87ca35..fb748008 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -14,7 +14,6 @@ bazel_dep(name = "squashfs-tools", version = "4.7.5") bazel_dep(name = "bazel_lib", version = "3.2.2", dev_dependency = True) bazel_dep(name = "container_structure_test", version = "1.22.1", dev_dependency = True) -bazel_dep(name = "llvm", version = "0.7.0", dev_dependency = True) bazel_dep(name = "rules_oci", version = "2.3.0", dev_dependency = True) bazel_dep(name = "rules_pkg", version = "1.2.0", dev_dependency = True) bazel_dep(name = "rules_pycross", version = "0.8.1", dev_dependency = True) @@ -22,11 +21,6 @@ bazel_dep(name = "rules_testing", version = "0.9.0", dev_dependency = True) bazel_dep(name = "stardoc", version = "0.8.1", dev_dependency = True) bazel_dep(name = "with_cfg.bzl", version = "0.14.6", dev_dependency = True) -register_toolchains( - "@llvm//toolchain:all", - dev_dependency = True, -) - rules_appimage = use_extension("//:extensions.bzl", "appimage_ext_dependencies") use_repo( rules_appimage, From 4c64d42ae8524a5f224cc95c8631c629c09df26a Mon Sep 17 00:00:00 2001 From: lalten Date: Fri, 3 Apr 2026 11:30:13 +0200 Subject: [PATCH 3/4] patch stardoc --- MODULE.bazel | 6 +++ docs/BUILD | 3 +- third_party/stardoc.diff | 102 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 third_party/stardoc.diff diff --git a/MODULE.bazel b/MODULE.bazel index fb748008..2d19c5cf 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -21,6 +21,12 @@ bazel_dep(name = "rules_testing", version = "0.9.0", dev_dependency = True) bazel_dep(name = "stardoc", version = "0.8.1", dev_dependency = True) bazel_dep(name = "with_cfg.bzl", version = "0.14.6", dev_dependency = True) +single_version_override( + module_name = "stardoc", + patches = ["//third_party:stardoc.diff"], # https://github.com/bazelbuild/stardoc/pull/303 + version = "0.8.1", +) + rules_appimage = use_extension("//:extensions.bzl", "appimage_ext_dependencies") use_repo( rules_appimage, diff --git a/docs/BUILD b/docs/BUILD index 736f251f..b9b5844d 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -1,8 +1,9 @@ -load("@bazel_lib//lib:docs.bzl", "stardoc_with_diff_test", "update_docs") +load("@stardoc//stardoc:stardoc_with_diff_test.bzl", "stardoc_with_diff_test", "update_docs") stardoc_with_diff_test( name = "defs", bzl_library_target = "//appimage:defs", + out_label = "defs.md", ) update_docs(name = "update") diff --git a/third_party/stardoc.diff b/third_party/stardoc.diff new file mode 100644 index 00000000..2f92fb80 --- /dev/null +++ b/third_party/stardoc.diff @@ -0,0 +1,102 @@ +--- MODULE.bazel ++++ MODULE.bazel +@@ -9,8 +9,9 @@ + bazel_dep(name = "bazel_skylib", version = "1.7.1") + bazel_dep(name = "rules_java", version = "8.6.1") + bazel_dep(name = "rules_jvm_external", version = "6.6") + bazel_dep(name = "rules_license", version = "1.0.0") ++bazel_dep(name = "rules_shell", version = "0.7.1") + + # Maven artifacts required by Stardoc; keep consistent with deps.bzl + STARDOC_MAVEN_ARTIFACTS = [ + "com.beust:jcommander:1.82", +new file mode 100644 +--- /dev/null ++++ stardoc/stardoc_with_diff_test.bzl +@@ -0,0 +1,86 @@ ++load("@bazel_skylib//rules:diff_test.bzl", "diff_test") ++load("@bazel_skylib//rules:write_file.bzl", "write_file") ++load("@rules_shell//shell:sh_binary.bzl", "sh_binary") ++load(":stardoc.bzl", "stardoc") ++ ++def stardoc_with_diff_test( ++ name, ++ bzl_library_target, ++ out_label, ++ **kwargs): ++ """Creates a stardoc target that can be auto-detected by update_docs to write the generated doc to the source tree and test that it's up to date. ++ ++ This is helpful for minimizing boilerplate in repos with lots of stardoc targets. ++ ++ Args: ++ name: the name of the stardoc file to be written to the current source directory (.md will be appended to the name). Call bazel run on this target to update the file. ++ bzl_library_target: the label of the `bzl_library` target to generate documentation for ++ out_label: the label of the output MD file ++ **kwargs: additional attributes passed to the stardoc() rule, such as for overriding the templates ++ """ ++ ++ out_file = out_label.replace("//", "").replace(":", "/") ++ ++ # Generate MD from .bzl ++ stardoc( ++ name = out_file.replace("/", "_").replace(".md", "-docgen"), ++ out = out_file.replace(".md", "-docgen.md"), ++ input = bzl_library_target + ".bzl", ++ deps = [bzl_library_target], ++ ) ++ ++ # Ensure that the generated MD has been updated in the local source tree ++ diff_test( ++ name = out_file.replace("/", "_").replace(".md", "-difftest"), ++ failure_message = "Please run \"bazel run //docs:update\"", ++ # Source file ++ file1 = out_label, ++ # Output from stardoc rule above ++ file2 = out_file.replace(".md", "-docgen.md"), ++ ) ++ ++def update_docs( ++ name = "update", ++ docs_folder = "docs"): ++ """Creates a sh_binary target which copies over generated doc files to the local source tree. ++ ++ This is to be used in tandem with `stardoc_with_diff_test()` to produce a convenient workflow ++ for generating, testing, and updating all doc files as follows: ++ ++ ``` bash ++ bazel build //{docs_folder}/... && bazel test //{docs_folder}/... && bazel run //{docs_folder}:update ++ ``` ++ ++ eg. ++ ++ ``` bash ++ bazel build //docs/... && bazel test //docs/... && bazel run //docs:update ++ ``` ++ ++ Args: ++ name: the name of the sh_binary target ++ docs_folder: the name of the folder containing the doc files in the local source tree ++ """ ++ content = ["#!/usr/bin/env bash", "cd ${BUILD_WORKSPACE_DIRECTORY}"] ++ data = [] ++ for r in native.existing_rules().values(): ++ if r["kind"] == "stardoc": ++ doc_gen = r["out"] ++ if doc_gen.startswith(":"): ++ doc_gen = doc_gen[1:] ++ doc_dest = doc_gen.replace("-docgen.md", ".md") ++ data.append(doc_gen) ++ content.append("cp -fv bazel-bin/{0}/{1} {2}".format(docs_folder, doc_gen, doc_dest)) ++ ++ update_script = name + ".sh" ++ write_file( ++ name = "gen_" + name, ++ out = update_script, ++ content = content, ++ ) ++ ++ sh_binary( ++ name = name, ++ srcs = [update_script], ++ data = data, ++ ) From f686d22a19e52c5974231d8f596a6ebfe85987e4 Mon Sep 17 00:00:00 2001 From: lalten Date: Fri, 3 Apr 2026 11:34:52 +0200 Subject: [PATCH 4/4] docs update --- docs/defs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/defs.md b/docs/defs.md index f4551928..59ba49d6 100644 --- a/docs/defs.md +++ b/docs/defs.md @@ -23,7 +23,7 @@ Package your binary into an AppImage. | data | Any additional data that will be made available inside the appimage | List of labels | optional | `[]` | | binary | - | Label | optional | `None` | | build_args | - | List of strings | optional | `[]` | -| env | Runtime environment variables. See https://bazel.build/reference/be/common-definitions#common-attributes-tests | Dictionary: String -> String | optional | `{}` | +| env | Runtime environment variables. See https://bazel.build/reference/be/common-definitions#common-attributes-tests | Dictionary: String -> String | optional | `{}` | @@ -47,7 +47,7 @@ Package your test target into an AppImage. | data | Any additional data that will be made available inside the appimage | List of labels | optional | `[]` | | binary | - | Label | optional | `None` | | build_args | - | List of strings | optional | `[]` | -| env | Runtime environment variables. See https://bazel.build/reference/be/common-definitions#common-attributes-tests | Dictionary: String -> String | optional | `{}` | +| env | Runtime environment variables. See https://bazel.build/reference/be/common-definitions#common-attributes-tests | Dictionary: String -> String | optional | `{}` |