@@ -783,8 +783,8 @@ def _create_stage1_bootstrap(
783783
784784def _find_launcher_maker (ctx ):
785785 if rp_config .bazel_9_or_later :
786- return ctx .toolchains [_LAUNCHER_MAKER_TOOLCHAIN_TYPE ].binary
787- return ctx .executable ._windows_launcher_maker
786+ return ( ctx .toolchains [_LAUNCHER_MAKER_TOOLCHAIN_TYPE ].binary , _LAUNCHER_MAKER_TOOLCHAIN_TYPE )
787+ return ( ctx .executable ._windows_launcher_maker , None )
788788
789789def _create_windows_exe_launcher (
790790 ctx ,
@@ -805,15 +805,17 @@ def _create_windows_exe_launcher(
805805 launch_info .add ("1" if use_zip_file else "0" , format = "use_zip_file=%s" )
806806
807807 launcher = ctx .attr ._launcher [DefaultInfo ].files_to_run .executable
808+ executable , toolchain = _find_launcher_maker (ctx )
808809 ctx .actions .run (
809- executable = _find_launcher_maker ( ctx ) ,
810+ executable = executable ,
810811 arguments = [launcher .path , launch_info , output .path ],
811812 inputs = [launcher ],
812813 outputs = [output ],
813814 mnemonic = "PyBuildLauncher" ,
814815 progress_message = "Creating launcher for %{label}" ,
815816 # Needed to inherit PATH when using non-MSVC compilers like MinGW
816817 use_default_shell_env = True ,
818+ toolchain = toolchain ,
817819 )
818820
819821def _create_zip_file (ctx , * , output , zip_main , runfiles ):
0 commit comments