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

Use the pre-built std if available in sysroot #19

Merged
merged 1 commit into from
May 16, 2022

Conversation

AzureMarker
Copy link
Member

@AzureMarker AzureMarker requested a review from Meziu May 15, 2022 21:22

/// Get the compiler's sysroot path
fn find_sysroot() -> PathBuf {
let sysroot = env::var("SYSROOT").ok().unwrap_or_else(|| {
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member Author

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(|| {
Copy link
Member

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.

@Meziu Meziu merged commit 5420057 into master May 16, 2022
@AzureMarker AzureMarker deleted the feature/use-prebuilt-std branch May 16, 2022 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow using a prebuilt std if one is found
3 participants