@@ -320,9 +320,9 @@ def get_env_prelude(ctx, installdir, data_dependencies):
320
320
"""
321
321
env_snippet = [
322
322
"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" + " \" " ,
326
326
]
327
327
328
328
env = dict ()
@@ -472,14 +472,14 @@ def cc_external_rule_impl(ctx, attrs):
472
472
"##echo## \" \" " ,
473
473
"##script_prelude##" ,
474
474
] + 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$$\" " ,
481
481
] + _print_env () + _copy_deps_and_tools (inputs ) + [
482
- "cd $$BUILD_TMPDIR$$" ,
482
+ "cd \" $$BUILD_TMPDIR$$\" " ,
483
483
] + attrs .create_configure_script (ConfigureParameters (ctx = ctx , attrs = attrs , inputs = inputs )) + postfix_script + [
484
484
# replace references to the root directory when building ($BUILD_TMPDIR)
485
485
# and the root where the dependencies were installed ($EXT_BUILD_DEPS)
@@ -488,7 +488,7 @@ def cc_external_rule_impl(ctx, attrs):
488
488
"##replace_absolute_paths## $$INSTALLDIR$$ $$EXT_BUILD_DEPS$$" ,
489
489
"##replace_sandbox_paths## $$INSTALLDIR$$ $$EXT_BUILD_ROOT$$" ,
490
490
installdir_copy .script ,
491
- "cd $$EXT_BUILD_ROOT$$" ,
491
+ "cd \" $$EXT_BUILD_ROOT$$\" " ,
492
492
] + [
493
493
"##replace_symlink## {}" .format (file .path )
494
494
for file in (
@@ -704,9 +704,9 @@ def _get_transitive_artifacts(deps):
704
704
705
705
def _print_env ():
706
706
return [
707
- "##echo## \" Environment:______________\" " ,
707
+ "##echo## Environment:______________" ,
708
708
"##env##" ,
709
- "##echo## \" __________________________\" " ,
709
+ "##echo## __________________________" ,
710
710
]
711
711
712
712
def _normalize_path (path ):
@@ -767,14 +767,14 @@ def _copy_deps_and_tools(files):
767
767
lines += _symlink_contents_to_dir ("include" , files .headers + files .include_dirs )
768
768
769
769
if files .tools_files :
770
- lines .append ("##mkdirs## $$EXT_BUILD_DEPS$$/bin" )
770
+ lines .append ("##mkdirs## \" $$EXT_BUILD_DEPS$$/bin\" " )
771
771
for tool in files .tools_files :
772
772
tool_prefix = "$EXT_BUILD_ROOT/"
773
773
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 ))
775
775
776
776
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 )))
778
778
779
779
lines .append ("##path## $$EXT_BUILD_DEPS$$/bin" )
780
780
@@ -786,13 +786,13 @@ def _symlink_contents_to_dir(dir_name, files_list):
786
786
files_list = collections .uniq (files_list )
787
787
if len (files_list ) == 0 :
788
788
return []
789
- lines = ["##mkdirs## $$EXT_BUILD_DEPS$$/" + dir_name ]
789
+ lines = ["##mkdirs## \" $$EXT_BUILD_DEPS$$/" + dir_name + " \" " ]
790
790
791
791
for file in files_list :
792
792
path = _file_path (file ).strip ()
793
793
if path :
794
794
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 ))
796
796
797
797
return lines
798
798
@@ -1121,4 +1121,4 @@ def _expand_locations_in_string(ctx, expandable, data):
1121
1121
if "EXT_BUILD_ROOT" in expandable :
1122
1122
return ctx .expand_location (expandable , data )
1123
1123
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