diff --git a/decls/core_rules.bzl b/decls/core_rules.bzl index 007073bb9..630b2d1fd 100644 --- a/decls/core_rules.bzl +++ b/decls/core_rules.bzl @@ -1485,10 +1485,9 @@ zip_file = prelude_rule( The regexes must be defined using `java.util.regex.Pattern` syntax. """), - "deterministic_output": attrs.option(attrs.bool(), default = None, doc = """ - If set to true, Buck ensures that all files in the generated zip and their associated metadata are - consistent across all platforms, resulting in an identical zip file everywhere. Note that this might - come at the expense of losing some otherwise relevant metadata, like file permissions and timestamps. + "hardcode_permissions_for_deterministic_output": attrs.option(attrs.bool(), default = None, doc = """ + If set to true, Buck hardcodes the permissions in order to ensures that all files have the same + permissions regardless of the platform on which the zip was generated. """), "on_duplicate_entry": attrs.enum(OnDuplicateEntry, default = "overwrite", doc = """ Action performed when Buck detects that zip\\_file input contains multiple entries with the same diff --git a/zip_file/zip_file.bzl b/zip_file/zip_file.bzl index fa9e02d0a..d4980ec2b 100644 --- a/zip_file/zip_file.bzl +++ b/zip_file/zip_file.bzl @@ -26,7 +26,7 @@ def _zip_file_impl(ctx: AnalysisContext) -> list[Provider]: on_duplicate_entry = ctx.attrs.on_duplicate_entry entries_to_exclude = ctx.attrs.entries_to_exclude - deterministic_output = ctx.attrs.deterministic_output + hardcode_permissions_for_deterministic_output = ctx.attrs.hardcode_permissions_for_deterministic_output zip_srcs = ctx.attrs.zip_srcs srcs = ctx.attrs.srcs @@ -60,8 +60,8 @@ def _zip_file_impl(ctx: AnalysisContext) -> list[Provider]: create_zip_cmd.append("--entries_to_exclude") create_zip_cmd.append(entries_to_exclude) - if deterministic_output: - create_zip_cmd.append("--deterministic_output") + if hardcode_permissions_for_deterministic_output: + create_zip_cmd.append("--hardcode_permissions_for_deterministic_output") ctx.actions.run(cmd_args(create_zip_cmd), category = "zip")