From ca80d07fcaaca3cb3050cfb8d9bfd1b6c376e9e1 Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 4 Oct 2024 17:41:24 +0200 Subject: [PATCH] Fix unknown repo error with mtree_mutate and Bzlmod (#948) With Bzlmod, every repo has its own namespace. Using Label() should make sure it uses the namespace of the .bzl file instead of the caller's one. --- docs/tar.md | 2 +- lib/tar.bzl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tar.md b/docs/tar.md index 9250d3f..16c9596 100644 --- a/docs/tar.md +++ b/docs/tar.md @@ -119,7 +119,7 @@ Modify metadata in an mtree file. | mtime | new modification time for all entries. | `None` | | owner | new uid for all entries. | `None` | | ownername | new uname for all entries. | `None` | -| awk_script | may be overridden to change the script containing the modification logic. | `"@aspect_bazel_lib//lib/private:modify_mtree.awk"` | +| awk_script | may be overridden to change the script containing the modification logic. | `Label("@aspect_bazel_lib//lib/private:modify_mtree.awk")` | | kwargs | additional named parameters to genrule | none | diff --git a/lib/tar.bzl b/lib/tar.bzl index b52dd01..ee0e00e 100644 --- a/lib/tar.bzl +++ b/lib/tar.bzl @@ -142,7 +142,7 @@ def mtree_mutate( mtime = None, owner = None, ownername = None, - awk_script = "@aspect_bazel_lib//lib/private:modify_mtree.awk", + awk_script = Label("@aspect_bazel_lib//lib/private:modify_mtree.awk"), **kwargs): """Modify metadata in an mtree file.