-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bazel/C#: avoid zipmerge #16544
Bazel/C#: avoid zipmerge #16544
Conversation
misc/bazel/pkg.bzl
Outdated
pkg_symlinks = [], | ||
), | ||
DefaultInfo( | ||
files = depset(transitive = [src[DefaultInfo].files for src in ctx.attr.srcs]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be pkg_files
flattened to a list, instead of exposing all variants of the files we just overlay'd away?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was thinking about it, let me see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, done that 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more question, otherwise LGTM! If you need the reversed
, feel free to merge as-is.
depsets.append(depset(dest_src_map.values())) | ||
return [ | ||
PackageFilegroupInfo( | ||
pkg_files = reversed(files), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why we need the reversed
here and in DefaultInfo
? To me, it seems like we're constructing files
and depsets
to be free of duplicates, and therefore order shouldn't matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reversed
here and below are not strictly required for soundness, but I think they make the end result less surprising: the order in which files will be written in the rules_pkg
manifest and then installed will follow the order in which things have been added, and similarly with the list of files printed by bazel taken from DefaultInfo
This uses a rule to combine
pkg_rules
targets with no overlap (with latest entries taking priority over earlier ones)