-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
miri-script: use --remap-path-prefix to print errors relative to the right root #3798
Merged
bors
merged 5 commits into
rust-lang:master
from
RalfJung:miri-script-remap-path-prefix
Aug 12, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bd52f55
miri-script: use --remap-path-prefix to print errors relative to the …
RalfJung 790cc4b
update suggested RA config; the './miri cargo' command is not needed …
RalfJung c64efd7
add './miri doc' command
RalfJung d3fb2b8
miri-script: pass around the relative crate dir, not the absolute pat…
RalfJung b9ebd52
CI: we now need the nightly toolchain as well
RalfJung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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 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,15 @@ | ||
#!/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 | ||
RalfJung marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# We need a nightly toolchain, for the `profile-rustflags` cargo feature. | ||
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we now need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose more than anything I'm confused that we didn't need this before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now need this because miri-script needs nightly because it picks up the
.config/cargo.toml
which uses nightly features.Previously we didn't need this because miri-script was built with stable, and then it used rustup-toolchain-install-master to install the toolchain used for Miri.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah.