Skip to content

Commit f6a3324

Browse files
committed
make zipapp transition set build zip to false
1 parent a41b4fc commit f6a3324

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

python/private/zipapp/py_zipapp_rule.bzl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
44
load("//python/private:attributes.bzl", "apply_config_settings_attr")
55
load("//python/private:builders.bzl", "builders")
66
load("//python/private:common.bzl", "actions_run", "maybe_create_repo_mapping", "runfiles_root_path")
7+
load("//python/private:common_labels.bzl", "labels")
78
load("//python/private:py_executable_info.bzl", "PyExecutableInfo")
89
load("//python/private:py_internal.bzl", "py_internal")
910
load("//python/private:py_runtime_info.bzl", "PyRuntimeInfo")
@@ -202,12 +203,16 @@ def _py_zipapp_executable_impl(ctx):
202203
]
203204

204205
def _transition_zipapp_impl(settings, attr):
205-
return apply_config_settings_attr(dict(settings), attr)
206+
settings = apply_config_settings_attr(dict(settings), attr)
207+
208+
# Force this to false, otherwise the binary is already a zipapp
209+
settings[labels.BUILD_PYTHON_ZIP] = False
210+
return settings
206211

207212
_zipapp_transition = transition(
208213
implementation = _transition_zipapp_impl,
209214
inputs = TRANSITION_LABELS,
210-
outputs = TRANSITION_LABELS,
215+
outputs = TRANSITION_LABELS + [labels.BUILD_PYTHON_ZIP],
211216
)
212217

213218
_ATTRS = {

0 commit comments

Comments
 (0)