@@ -375,7 +375,7 @@ def construct_arguments(
375375 # `exec_root`. Since we cannot (seemingly) get the `exec_root` from skylark, we cheat a little
376376 # and use `$(pwd)` which resolves the `exec_root` at action execution time.
377377 package_dir = ctx .build_file_path [:ctx .build_file_path .rfind ("/" )]
378- dynamic_env ["CARGO_MANIFEST_DIR" ] = "$EXEC_ROOT/{}" .format (package_dir )
378+ dynamic_env ["CARGO_MANIFEST_DIR" ] = "${{ EXEC_ROOT}} /{}" .format (package_dir )
379379
380380 return args , env , dynamic_env
381381
@@ -408,7 +408,7 @@ def construct_compile_command(
408408 if src != dst :
409409 maybe_rename = " && /bin/mv {src} {dst}" .format (src = src , dst = dst )
410410
411- # Set $EXEC_ROOT so that actions which chdir still work.
411+ # Set ${ EXEC_ROOT} so that actions which chdir still work.
412412 # See https://github.com/google/cargo-raze/issues/71#issuecomment-433225853 for the rationale as
413413 # to why.
414414 return 'export EXEC_ROOT=$(pwd) && {} && {} "$@" --remap-path-prefix="$(pwd)"=__bazel_redacted_pwd {}{}' .format (
@@ -533,19 +533,19 @@ def _create_out_dir_action(ctx, file, build_info, dep_info):
533533 if build_info :
534534 prep_commands .append ("export $(cat %s)" % build_info .rustc_env .path )
535535 # out_dir will be added as input by the transitive_build_infos loop below.
536- dynamic_env ["OUT_DIR" ] = "$EXEC_ROOT/{}" .format (build_info .out_dir .path )
536+ dynamic_env ["OUT_DIR" ] = "${{ EXEC_ROOT}} /{}" .format (build_info .out_dir .path )
537537 dynamic_build_flags .append ("$(cat '%s')" % build_info .flags .path )
538538 elif tar_file_attr :
539539 out_dir = ".out-dir"
540540 prep_commands .append ("mkdir -p $OUT_DIR" )
541541 prep_commands .append ("tar -xzf {tar} -C $OUT_DIR" .format (tar = tar_file_attr .path ))
542542 input_files .append (tar_file_attr )
543- dynamic_env ["OUT_DIR" ] = "$EXEC_ROOT/{}" .format (out_dir )
543+ dynamic_env ["OUT_DIR" ] = "${{ EXEC_ROOT}} /{}" .format (out_dir )
544544
545545 # This should probably only actually be exposed to actions which link.
546546 for dep_build_info in dep_info .transitive_build_infos .to_list ():
547547 input_files .append (dep_build_info .out_dir )
548- dynamic_build_flags .append ("$(cat '{}' | sed -e \" s#\$EXEC_ROOT#$ EXEC_ROOT#g\" )" .format (dep_build_info .link_flags .path ))
548+ dynamic_build_flags .append ("$(cat '{}' | sed -e \" s#\${{ EXEC_ROOT}}#${{ EXEC_ROOT}} #g\" )" .format (dep_build_info .link_flags .path ))
549549 input_files .append (dep_build_info .link_flags )
550550
551551 return input_files , prep_commands , dynamic_env , dynamic_build_flags
0 commit comments