rust-lang / rust-lang/rust-analyzer

What would it take for `sysroot` crates to be treated as "just" another dependency in rust-analyzer?

Open
#14,903 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-support
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Hi! A colleague is making some changes of how the sysroot is configured and exposed in Buck2's rust_rules. They asked me a question I didn't have the answer to: if we were building std from source, could it be treated/exposed as just another dependency in a rust-project.json? I know that there's some special handling for sysroot crates inside of project-model/src/sysroot.rs and Lukas mentioned that dependencies of std require weird workarounds to avoid circular dependencies.

Is treating sysroot crates as "just" another dependency de-facto blocked on the stabilization of build-std?

(This isn't a feature request; it's more of a "how hard would it be to support this" and if y'all don't have an answer off-hand, I'll treat it as "build-std needs to be stabilized first".)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with crates/project-model/src/sysroot.rs and the rust-project.json sysroot handling described in the issue. Review the linked build-std documentation and the referenced pull-request discussion, then document whether sysroot crates can be modeled as ordinary dependencies and which blockers remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.