-
Notifications
You must be signed in to change notification settings - Fork 10
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
Use the pre-built std if available in sysroot #19
Conversation
|
||
/// Get the compiler's sysroot path | ||
fn find_sysroot() -> PathBuf { | ||
let sysroot = env::var("SYSROOT").ok().unwrap_or_else(|| { |
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.
Is this a standard environment variable used by Cargo? I couldn't find any docs or anything related to it (except rust-lang/cargo#7501), although I suppose it doesn't hurt to make this configurable somehow.
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.
It isn’t supposed to be a Cargo defined variable. I believe @AzureMarker just put this in so you could use a different sysroot even while using the unmodified compiler.
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 was looking around and noticed that RLS checks for the variable, so I decided to include it:
https://github.com/rust-dev-tools/rls-analysis/blob/fd9939247dae2dbe4c801af4c0c3f82035f88d49/src/loader.rs#L158
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 don't think rust-analyzer checks for it though, and I don't see it mentioned anywhere else really.
|
||
/// Get the compiler's sysroot path | ||
fn find_sysroot() -> PathBuf { | ||
let sysroot = env::var("SYSROOT").ok().unwrap_or_else(|| { |
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.
It isn’t supposed to be a Cargo defined variable. I believe @AzureMarker just put this in so you could use a different sysroot even while using the unmodified compiler.
Closes #18
cc: @ian-h-chamberlain, @Meziu