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

internal: tool discovery prefers sysroot tools #16537

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Feb 12, 2024

Fixes #15927, Fixes #16523

After this PR we will look for cargo and rustc in the sysroot if it was succesfully loaded instead of using the current lookup scheme. This should be more correct than the current approach as that relies on the working directory of the server binary or loade workspace, meaning it can behave a bit odd wrt overrides.

Additionally, rust-project.json projects now get the target data layout set so there should be better const eval support now.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 12, 2024
@Veykril
Copy link
Member Author

Veykril commented Feb 12, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Feb 12, 2024

📌 Commit 8f3209b has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Feb 12, 2024

⌛ Testing commit 8f3209b with merge 5e1b09b...

@bors
Copy link
Contributor

bors commented Feb 12, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 5e1b09b to master...

@bors bors merged commit 5e1b09b into rust-lang:master Feb 12, 2024
11 checks passed
@bors bors mentioned this pull request Feb 12, 2024
RustcCfgConfig::Cargo(cargo_toml) => {
let mut cmd = Command::new(toolchain::cargo());
match config {
RustcCfgConfig::Cargo(sysroot, cargo_oml) => {
Copy link
Member

Choose a reason for hiding this comment

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

cargo_oml 😁

@Veykril Veykril deleted the sysroot-tools branch February 12, 2024 14:02
bors added a commit that referenced this pull request Feb 12, 2024
fix: Fix target layout fetching

#16537 broke this, as `cargo rustc` cannot run against a virtual workspace, so it will always fail in such projects (like rust-analyzer itself). This brings back the plain rustc fallback,
bors added a commit that referenced this pull request Feb 14, 2024
fix: Set `RUSTUP_TOOLCHAIN` and invoke the proxies instead of directly invoking sysroot binaries

cc #16537 should fix #16561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
4 participants