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

Do not warn if the origin paths are the same. #615

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions pkg/private/pkg_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,23 @@ _DestFile = provider(
def _check_dest(content_map, dest, src, origin):
old_entry = content_map.get(dest)

# TODO(#385): This is insufficient but good enough for now. We should
# compare over all the attributes too. That will detect problems where
# people specify the owner in one place, but another overly broad glob
# brings in the file with a different owner.
if old_entry and old_entry.src != src:
# buildifier: disable=print
print("Duplicate output path: <%s>, declared in %s and %s" % (
dest,
origin,
content_map[dest].origin,
))
# TODO(#385): This is insufficient but good enough for now.
# Ideally, we should
# - If the origin paths are different, then fail (breaking change)
# - If the origin paths are the same, then warn if any of the attributes
# (mode, owner, architecture) are different as we are going to pick
# one, but not necessairly the one that the user intended.
# This would also detect problems where people specify the owner in
# one place, but another overly broad glob brings in the file with
# a different owner.
if origin != old_entry.origin:
# buildifier: disable=print
print("Duplicate output path: <%s>, declared in %s and %s" % (
dest,
origin,
old_entry.origin,
))

def _merge_attributes(info, mode, user, group):
if hasattr(info, "attributes"):
Expand Down