@@ -300,7 +300,7 @@ def add_artifact_subcommand_global_arguments(parser: argparse.ArgumentParser):
300300 action = "store_true" ,
301301 help = """
302302 If true, writes the Bazel options to the .jax_configure.bazelrc file but
303- does not build the artifacts. Ignored if --use_ci_bazelrc_flags is set.
303+ does not build the artifacts.
304304 """ ,
305305 )
306306
@@ -444,7 +444,7 @@ async def main():
444444 else :
445445 bazel_command .append ("//build:requirements.update" )
446446
447- await executor .run (bazel_command .command , args .dry_run )
447+ await executor .run (bazel_command .get_command_as_string () , args .dry_run )
448448 sys .exit (0 )
449449
450450 wheel_cpus = {
@@ -473,9 +473,9 @@ async def main():
473473 clang_path = args .clang_path or utils .get_clang_path_or_exit ()
474474 logging .debug ("Using Clang as the compiler, clang path: %s" , clang_path )
475475 # Use double quotes around clang path to avoid path issues on Windows.
476- bazel_command .append (f' --action_env=CLANG_COMPILER_PATH="{ clang_path } "' )
477- bazel_command .append (f' --repo_env=CC="{ clang_path } "' )
478- bazel_command .append (f' --repo_env=BAZEL_COMPILER="{ clang_path } "' )
476+ bazel_command .append (f" --action_env=CLANG_COMPILER_PATH=\ "{ clang_path } \" " )
477+ bazel_command .append (f" --repo_env=CC=\ "{ clang_path } \" " )
478+ bazel_command .append (f" --repo_env=BAZEL_COMPILER=\ "{ clang_path } \" " )
479479 bazel_command .append ("--config=clang" )
480480
481481 if not args .disable_mkl_dnn :
@@ -485,7 +485,7 @@ async def main():
485485 if "cuda" in args .command :
486486 bazel_command .append ("--config=cuda" )
487487 bazel_command .append (
488- f' --action_env=CLANG_CUDA_COMPILER_PATH="{ clang_path } "'
488+ f" --action_env=CLANG_CUDA_COMPILER_PATH=\ "{ clang_path } \" "
489489 )
490490 if args .build_cuda_with_clang :
491491 logging .debug ("Building CUDA with Clang" )
@@ -550,7 +550,7 @@ async def main():
550550
551551 if args .rocm_path :
552552 logging .debug ("ROCm tookit path: %s" , args .rocm_path )
553- bazel_command .append (f' --action_env=ROCM_PATH="{ args .rocm_path } "' )
553+ bazel_command .append (f" --action_env=ROCM_PATH=\ "{ args .rocm_path } \" " )
554554 if args .rocm_amdgpu_targets :
555555 logging .debug ("ROCm AMD GPU targets: %s" , args .rocm_amdgpu_targets )
556556 bazel_command .append (
@@ -559,7 +559,7 @@ async def main():
559559
560560 if args .local_xla_path :
561561 logging .debug ("Local XLA path: %s" , args .local_xla_path )
562- bazel_command .append (f' --override_repository=xla="{ args .local_xla_path } "' )
562+ bazel_command .append (f" --override_repository=xla=\ "{ args .local_xla_path } \" " )
563563
564564 if args .bazel_build_options :
565565 logging .debug (
@@ -568,15 +568,14 @@ async def main():
568568 for option in args .bazel_build_options :
569569 bazel_command .append (option )
570570
571- if not args .use_ci_bazelrc_flags :
571+ if args .configure_only :
572572 with open (".jax_configure.bazelrc" , "w" ) as f :
573- jax_configure_options = utils .get_jax_configure_bazel_options (bazel_command .parameters )
573+ jax_configure_options = utils .get_jax_configure_bazel_options (bazel_command .get_command_as_list () )
574574 if not jax_configure_options :
575575 logging .error ("Error retrieving the Bazel options to be written to .jax_configure.bazelrc, exiting." )
576576 sys .exit (1 )
577577 f .write (jax_configure_options )
578578 logging .debug ("Bazel options written to .jax_configure.bazelrc" )
579- if args .configure_only :
580579 logging .debug ("--configure_only is set, exiting without running any Bazel commands." )
581580 sys .exit (0 )
582581
@@ -612,8 +611,9 @@ async def main():
612611 git_hash = utils .get_githash ()
613612 bazel_command .append (f"--jaxlib_git_hash={ git_hash } " )
614613
615- await executor .run (bazel_command .command , args .dry_run )
614+ await executor .run (bazel_command .get_command_as_string () , args .dry_run )
616615
617616
618617if __name__ == "__main__" :
619618 asyncio .run (main ())
619+
0 commit comments