-
Notifications
You must be signed in to change notification settings - Fork 361
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
9 changed files
with
91 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[unstable] | ||
profile-rustflags = true | ||
|
||
# Add back the containing directory of the packages we have to refer to using --manifest-path. | ||
# Per-package profiles avoid adding this to build dependencies. | ||
[profile.dev.package."cargo-miri"] | ||
rustflags = ["--remap-path-prefix", "=cargo-miri"] | ||
[profile.dev.package."miri-script"] | ||
rustflags = ["--remap-path-prefix", "=miri-script"] |
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
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,14 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
# 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 | ||
# 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 | ||
cargo +nightly 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 'nightly' 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="$(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 || \ | ||
( echo "Failed to build miri-script. Is the 'stable' toolchain installed?"; exit 1 ) | ||
"$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
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