@@ -4,6 +4,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
44load ("//python/private:attributes.bzl" , "apply_config_settings_attr" )
55load ("//python/private:builders.bzl" , "builders" )
66load ("//python/private:common.bzl" , "actions_run" , "maybe_create_repo_mapping" , "runfiles_root_path" )
7+ load ("//python/private:common_labels.bzl" , "labels" )
78load ("//python/private:py_executable_info.bzl" , "PyExecutableInfo" )
89load ("//python/private:py_internal.bzl" , "py_internal" )
910load ("//python/private:py_runtime_info.bzl" , "PyRuntimeInfo" )
@@ -202,12 +203,16 @@ def _py_zipapp_executable_impl(ctx):
202203 ]
203204
204205def _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