@@ -320,9 +320,9 @@ def get_env_prelude(ctx, installdir, data_dependencies):
320320 """
321321 env_snippet = [
322322 "export EXT_BUILD_ROOT=##pwd##" ,
323- "export INSTALLDIR=$$EXT_BUILD_ROOT$$/" + installdir ,
324- "export BUILD_TMPDIR=$$INSTALLDIR$$.build_tmpdir" ,
325- "export EXT_BUILD_DEPS=$$INSTALLDIR$$.ext_build_deps" ,
323+ "export INSTALLDIR=\" $$EXT_BUILD_ROOT$$/" + installdir + " \" " ,
324+ "export BUILD_TMPDIR=\" $$INSTALLDIR$$.build_tmpdir" + " \" " ,
325+ "export EXT_BUILD_DEPS=\" $$INSTALLDIR$$.ext_build_deps" + " \" " ,
326326 ]
327327
328328 env = dict ()
@@ -472,14 +472,14 @@ def cc_external_rule_impl(ctx, attrs):
472472 "##echo## \" \" " ,
473473 "##script_prelude##" ,
474474 ] + env_prelude + [
475- "##path## $$EXT_BUILD_ROOT$$" ,
476- "##rm_rf## $$BUILD_TMPDIR$$" ,
477- "##rm_rf## $$EXT_BUILD_DEPS$$" ,
478- "##mkdirs## $$INSTALLDIR$$" ,
479- "##mkdirs## $$BUILD_TMPDIR$$" ,
480- "##mkdirs## $$EXT_BUILD_DEPS$$" ,
475+ "##path## \" $$EXT_BUILD_ROOT$$\" " ,
476+ "##rm_rf## \" $$BUILD_TMPDIR$$\" " ,
477+ "##rm_rf## \" $$EXT_BUILD_DEPS$$\" " ,
478+ "##mkdirs## \" $$INSTALLDIR$$\" " ,
479+ "##mkdirs## \" $$BUILD_TMPDIR$$\" " ,
480+ "##mkdirs## \" $$EXT_BUILD_DEPS$$\" " ,
481481 ] + _print_env () + _copy_deps_and_tools (inputs ) + [
482- "cd $$BUILD_TMPDIR$$" ,
482+ "cd \" $$BUILD_TMPDIR$$\" " ,
483483 ] + attrs .create_configure_script (ConfigureParameters (ctx = ctx , attrs = attrs , inputs = inputs )) + postfix_script + [
484484 # replace references to the root directory when building ($BUILD_TMPDIR)
485485 # and the root where the dependencies were installed ($EXT_BUILD_DEPS)
@@ -488,7 +488,7 @@ def cc_external_rule_impl(ctx, attrs):
488488 "##replace_absolute_paths## $$INSTALLDIR$$ $$EXT_BUILD_DEPS$$" ,
489489 "##replace_sandbox_paths## $$INSTALLDIR$$ $$EXT_BUILD_ROOT$$" ,
490490 installdir_copy .script ,
491- "cd $$EXT_BUILD_ROOT$$" ,
491+ "cd \" $$EXT_BUILD_ROOT$$\" " ,
492492 ] + [
493493 "##replace_symlink## {}" .format (file .path )
494494 for file in (
@@ -704,9 +704,9 @@ def _get_transitive_artifacts(deps):
704704
705705def _print_env ():
706706 return [
707- "##echo## \" Environment:______________\" " ,
707+ "##echo## Environment:______________" ,
708708 "##env##" ,
709- "##echo## \" __________________________\" " ,
709+ "##echo## __________________________" ,
710710 ]
711711
712712def _normalize_path (path ):
@@ -767,14 +767,14 @@ def _copy_deps_and_tools(files):
767767 lines += _symlink_contents_to_dir ("include" , files .headers + files .include_dirs )
768768
769769 if files .tools_files :
770- lines .append ("##mkdirs## $$EXT_BUILD_DEPS$$/bin" )
770+ lines .append ("##mkdirs## \" $$EXT_BUILD_DEPS$$/bin\" " )
771771 for tool in files .tools_files :
772772 tool_prefix = "$EXT_BUILD_ROOT/"
773773 tool = tool [len (tool_prefix ):] if tool .startswith (tool_prefix ) else tool
774- lines .append ("##symlink_to_dir## $$EXT_BUILD_ROOT$$/{} $$EXT_BUILD_DEPS$$/bin/ False" .format (tool ))
774+ lines .append ("##symlink_to_dir## \" $$EXT_BUILD_ROOT$$/{}\" \" $$EXT_BUILD_DEPS$$/bin/\" False" .format (tool ))
775775
776776 for ext_dir in files .ext_build_dirs :
777- lines .append ("##symlink_to_dir## $$EXT_BUILD_ROOT$$/{} $$EXT_BUILD_DEPS$$ True" .format (_file_path (ext_dir )))
777+ lines .append ("##symlink_to_dir## \" $$EXT_BUILD_ROOT$$/{}\" \" $$EXT_BUILD_DEPS$$\" True" .format (_file_path (ext_dir )))
778778
779779 lines .append ("##path## $$EXT_BUILD_DEPS$$/bin" )
780780
@@ -786,13 +786,13 @@ def _symlink_contents_to_dir(dir_name, files_list):
786786 files_list = collections .uniq (files_list )
787787 if len (files_list ) == 0 :
788788 return []
789- lines = ["##mkdirs## $$EXT_BUILD_DEPS$$/" + dir_name ]
789+ lines = ["##mkdirs## \" $$EXT_BUILD_DEPS$$/" + dir_name + " \" " ]
790790
791791 for file in files_list :
792792 path = _file_path (file ).strip ()
793793 if path :
794794 lines .append ("##symlink_contents_to_dir## \
795- $$EXT_BUILD_ROOT$$/{} $$EXT_BUILD_DEPS$$/{} True" .format (path , dir_name ))
795+ \" $$EXT_BUILD_ROOT$$/{}\" \" $$EXT_BUILD_DEPS$$/{}\" True" .format (path , dir_name ))
796796
797797 return lines
798798
@@ -1121,4 +1121,4 @@ def _expand_locations_in_string(ctx, expandable, data):
11211121 if "EXT_BUILD_ROOT" in expandable :
11221122 return ctx .expand_location (expandable , data )
11231123 else :
1124- return ctx .expand_location (expandable .replace ("$(execpath " , "$$EXT_BUILD_ROOT$$/$(execpath " ), data )
1124+ return ctx .expand_location (expandable .replace ("$(execpath " , "\" $$EXT_BUILD_ROOT$$\" /$(execpath " ), data )
0 commit comments