commit e9a4e93ed71 changed the meaning of the patches parameter to patch() in tools/build_defs/repo/utils.bzl #16190
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: bug
Description of the bug:
Prior to commit e9a4e93, patch() in tools/build_defs/repo/utils.bzl processed its patches parameter as follows:
This idiom is consistent with how patch() processes patch_cmds and patch_cmds_win, and means that if a custom repository rule has supplied patches or patch_cmds or patch_cmds_win explicitly, then patch() will not look at the attributes of the repository rule.
commit e9a4e93 altered this logic to
With this new logic, patch() will now process the sum of any explicitly supplied patches, and any patches supplied to the repository rule.
This change in semantics broke a custom repository rule that called
patch()
multiple times, and which relied on being able to passpatches = []
to force patch() to ignore the repository rule's ctx.attr.patches.I cannot see anything in the description of commit e9a4e93 to explain why it makes this breaking change. It appears to be completely orthogonal to adding support for remote_patches. Side note: if patch() is now to support a remote_patches attribute on the repository rules, why did it not add a corresponding remote_patches parameter to patch()?
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Write a custom repository rule that calls patch() with patches = [] and observe that it applies patches from the patches attribute of a call to that repository rule.
Which operating system are you running Bazel on?
Ubuntu 20.04
What is the output of
bazel info release
?release 5.3.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: