-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues causing the
Rustc
process wrapper to be built non-determ…
…inistically
- Loading branch information
1 parent
1557205
commit 95cc7f3
Showing
6 changed files
with
118 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@ECHO OFF | ||
SETLOCAL enabledelayedexpansion | ||
|
||
:: The first argument is expected to be `--`, this must be skipped | ||
SET "skip_first_arg=1" | ||
|
||
:: Initialize a counter to track arguments | ||
SET "arg_count=1" | ||
|
||
:: Pass the arguments to the provided command, modifying the second argument | ||
for %%A in (%*) do ( | ||
if !skip_first_arg! equ 1 ( | ||
SET "skip_first_arg=0" | ||
) else if !arg_count! equ 2 ( | ||
:: Ensure the rustc.exe path is executable by sanitizing any `/` to `\` | ||
SET "arg=%%~A" | ||
SET "arg=!arg:/=\!" | ||
SET "command_args=!command_args! !arg!" | ||
) else ( | ||
:: Account for any arguments which contain `${pwd}` (a place holder for the current working directiron) | ||
set "arg=%%~A" | ||
set "arg=!arg:${pwd}=%CD%!" | ||
set "command_args=!command_args! !arg!" | ||
) | ||
SET /a "arg_count+=1" | ||
) | ||
|
||
:: append "--remap-path-prefix" with the current working directory | ||
SET "command_args=!command_args! "--remap-path-prefix=%CD%=" | ||
|
||
:: Execute the provided command with arguments | ||
%command_args% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# Skip the first argument which is expected to be `--` | ||
shift | ||
|
||
args=() | ||
|
||
for arg in "$@"; do | ||
# Check if the argument contains "${PWD}" and replace it with the actual value of PWD | ||
if [[ "${arg}" == *'${pwd}'* ]]; then | ||
arg="${arg//\$\{pwd\}/$PWD}" | ||
fi | ||
args+=("${arg}") | ||
done | ||
|
||
set -x | ||
|
||
exec "${args[@]}" |