Rustc: Simplify --sysroot
code after rust#103660
#325
Merged
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.
If I'm honest, I still don't fully understand when and where the
--sysroot
argument is required. Clippy has very few comments on the topic. Miri has a few more, but also a custom setup in theircargo-miri
interface, which is probably needed for the way miri operates.Before rust-lang/rust#103660, rustc used to use the path of the executable to get the system root, that's why Clippy and Miri had custom ways to search for the system root. When I wrote Marker's driver, I took Clippy's code for this part and refactored it for readability.
The referenced PR changed rustc's default behavior to use the path of the rustc library, which should work for Clippy, Miri and Marker. Clippy and Miri still have some minimal code, to check for an environment value. This PR mimics Clippy's behavior, with the deviation that we don't use
SYSROOT
, butMARKER_SYSROOT
as the name of the environment value. I think this is a bit cleaner and inline with Miri, which usesMIRI_SYSROOT
Closes #48
Maybe solves #324 as well? I sadly don't have a setup to replicate the reported bug. I'm considering, if we maybe want to do a test release and ask
@tigerros
(the author of #324) if they can test the release binaries for us. This PR has the v0.4.2 tag as the baseline, so we can just create a PR to thehotfix/0.4
branch for that.@Veetaha would you mind taking a look at this PR?