diff --git a/misc/bazel/pkg.bzl b/misc/bazel/pkg.bzl index 148bb1a18a90..0e01c4e3a9cc 100644 --- a/misc/bazel/pkg.bzl +++ b/misc/bazel/pkg.bzl @@ -3,6 +3,7 @@ load("@rules_pkg//pkg:providers.bzl", "PackageFilegroupInfo", "PackageFilesInfo" def _pkg_overlay_impl(ctx): destinations = {} files = [] + depsets = [] for src in reversed(ctx.attr.srcs): pfi = src[PackageFilesInfo] @@ -14,6 +15,7 @@ def _pkg_overlay_impl(ctx): attributes = pfi.attributes, ) files.append((new_pfi, src.label)) + depsets.append(depset(dest_src_map.values())) return [ PackageFilegroupInfo( pkg_files = reversed(files), @@ -21,7 +23,7 @@ def _pkg_overlay_impl(ctx): pkg_symlinks = [], ), DefaultInfo( - files = depset(transitive = [src[DefaultInfo].files for src in ctx.attr.srcs]), + files = depset(transitive = reversed(depsets)), ), ]