Skip to content
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

improved fn get_or_default_sysroot #103581

Closed
wants to merge 0 commits into from
Closed

Conversation

onur-ozkan
Copy link
Member

fn get_or_default_sysroot is now improved and used in miri and clippy, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy.

Resolves #98832

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 26, 2022
@rustbot
Copy link
Collaborator

rustbot commented Oct 26, 2022

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

The Miri subtree was changed

cc @rust-lang/miri

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @estebank (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 26, 2022
@jyn514
Copy link
Member

jyn514 commented Oct 26, 2022

r? @RalfJung

@rust-highfive rust-highfive assigned RalfJung and unassigned estebank Oct 26, 2022
@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-miri Area: The miri tool A-clippy Area: Clippy labels Oct 26, 2022
}

args.push(sysroot_flag.to_owned());
args.push(default_sysroot);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still using the --sysroot arg-passing hack to set the sysroot, so I don't see how that's better than the status quo.

All this seems to do is extract some common code from Miri and clippy, but we could have that more easily by moving that code to a helper crate. The actual problem of rustc hard-coding the default sysroot does not get resolved by this.

Copy link
Member Author

@onur-ozkan onur-ozkan Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still using the --sysroot arg-passing hack to set the sysroot, so I don't see how that's better than the status quo.

I suppose I misunderstand the goal here then. I guess all sysroot calculation/value passing logic has to be excluded from miri and it should still keep working as before. If so, I will work on that.

@onur-ozkan onur-ozkan changed the title improved fn get_or_default_sysroot WIP: improved fn get_or_default_sysroot Oct 26, 2022
@bors
Copy link
Contributor

bors commented Oct 27, 2022

☔ The latest upstream changes (presumably #103571) made this pull request unmergeable. Please resolve the merge conflicts.

@onur-ozkan onur-ozkan changed the title WIP: improved fn get_or_default_sysroot improved fn get_or_default_sysroot Oct 27, 2022
@onur-ozkan onur-ozkan requested review from RalfJung and bjorn3 and removed request for RalfJung and bjorn3 October 27, 2022 18:25
@RalfJung
Copy link
Member

The Miri change looks great. :) I just hope it will work in all the same cases as before, which are not all covered by our CI...

I don't know all that code in rustc_session so I can't comment on it.

@jyn514
Copy link
Member

jyn514 commented Oct 27, 2022

r? @jyn514

@rustbot rustbot assigned jyn514 and unassigned RalfJung Oct 27, 2022
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me :)

@RalfJung I know we don't run clippy tests in CI - do we run miri tests? Would be nice to see whether this works at all before a full rollup.

@ozkanonur can you run x test src/tools/clippy in the meantime and see if that passes? It will take a long time to compile unfortunately.

compiler/rustc_session/src/filesearch.rs Outdated Show resolved Hide resolved
compiler/rustc_session/src/filesearch.rs Outdated Show resolved Hide resolved
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Oct 27, 2022

Amazing, thanks! Can you please squash the commits? r=me with that done.

@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 27, 2022
@RalfJung
Copy link
Member

RalfJung commented Oct 27, 2022

I know we don't run clippy tests in CI - do we run miri tests? Would be nice to see whether this works at all before a full rollup.

The 'tools' builder (the third PR builder) tests both clippy and miri. But the things touched by this PR are most relevant for out-of-tree builds so it is unclear whether CI is even very informative.

I will locally test Miri building.

@RalfJung
Copy link
Member

Miri is looking good :)

@rustbot rustbot added A-meta Area: Issues about the rust-lang/rust repository. A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Oct 27, 2022
@rustbot
Copy link
Collaborator

rustbot commented Oct 27, 2022

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo

rustc_macros::diagnostics was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@onur-ozkan onur-ozkan closed this Oct 27, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 28, 2022
improve `filesearch::get_or_default_sysroot`

`fn get_or_default_sysroot` is now improved and used in `miri` and `clippy`, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy.

Resolves rust-lang#98832

re-opened from rust-lang#103581
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Nov 3, 2022
improve `filesearch::get_or_default_sysroot`

`fn get_or_default_sysroot` is now improved and used in `miri` and `clippy`, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy.

Resolves rust-lang#98832

re-opened from rust-lang#103581
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Nov 5, 2022
improve `filesearch::get_or_default_sysroot`

`fn get_or_default_sysroot` is now improved and used in `miri` and `clippy`, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy.

Resolves rust-lang#98832

re-opened from rust-lang#103581
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 21, 2022
improve `filesearch::get_or_default_sysroot`

`fn get_or_default_sysroot` is now improved and used in `miri` and `clippy`, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy.

Resolves rust-lang#98832

re-opened from rust-lang#103581
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
improve `filesearch::get_or_default_sysroot`

`fn get_or_default_sysroot` is now improved and used in `miri` and `clippy`, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy.

Resolves rust-lang#98832

re-opened from rust-lang#103581
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-clippy Area: Clippy A-meta Area: Issues about the rust-lang/rust repository. A-miri Area: The miri tool A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the default sysroot configurable by rustc_private tools
9 participants