Skip to content
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

Merged
merged 2 commits into from
May 22, 2024
Merged

Conversation

redsun82
Copy link
Contributor

@redsun82 redsun82 commented May 21, 2024

This uses a rule to combine pkg_rules targets with no overlap (with latest entries taking priority over earlier ones)

pkg_symlinks = [],
),
DefaultInfo(
files = depset(transitive = [src[DefaultInfo].files for src in ctx.attr.srcs]),
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, done that 👍

@redsun82 redsun82 marked this pull request as ready for review May 21, 2024 15:34
@redsun82 redsun82 requested review from a team as code owners May 21, 2024 15:34
Copy link
Collaborator

@criemen criemen left a 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),
Copy link
Collaborator

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?

Copy link
Contributor Author

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

@redsun82 redsun82 merged commit b744f9f into criemen/bazel-csharp May 22, 2024
3 checks passed
@redsun82 redsun82 deleted the redsun82/bazel-csharp-2 branch May 22, 2024 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants