-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
miri-script: use --remap-path-prefix to print errors relative to the …
…right root
- Loading branch information
Showing
6 changed files
with
75 additions
and
61 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,8 +1,16 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
# Instead of doing just `cargo run --manifest-path .. $@`, we invoke miri-script binary directly. Invoking `cargo run` goes through | ||
# rustup (that sets it's own environmental variables), which is undesirable. | ||
# We want to call the binary directly, so we need to know where it ends up. | ||
MIRI_SCRIPT_TARGET_DIR="$(dirname "$0")"/miri-script/target | ||
cargo +stable build $CARGO_EXTRA_FLAGS -q --target-dir "$MIRI_SCRIPT_TARGET_DIR" --manifest-path "$(dirname "$0")"/miri-script/Cargo.toml || \ | ||
# If stdout is not a terminal and we are not on CI, assume that we are being invoked by RA, and use JSON output. | ||
if ! [ -t 1 ] && [ -z "$CI" ]; then | ||
MESSAGE_FORMAT="--message-format=json" | ||
fi | ||
# Set --remap-path-prefix so miri-script build failures are printed relative to the Miri root. | ||
RUSTFLAGS="$RUSTFLAGS --remap-path-prefix =miri-script" \ | ||
cargo +stable build $CARGO_EXTRA_FLAGS --manifest-path "$(dirname "$0")"/miri-script/Cargo.toml \ | ||
-q --target-dir "$MIRI_SCRIPT_TARGET_DIR" $MESSAGE_FORMAT || \ | ||
( echo "Failed to build miri-script. Is the 'stable' toolchain installed?"; exit 1 ) | ||
# Instead of doing just `cargo run --manifest-path .. $@`, we invoke miri-script binary directly. Invoking `cargo run` goes through | ||
# rustup (that sets it's own environmental variables), which is undesirable. | ||
"$MIRI_SCRIPT_TARGET_DIR"/debug/miri-script "$@" |
This file was deleted.
Oops, something went wrong.
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