rust-lang / rust-lang/rust-analyzer
RA breaks incremental compilation when using dev profile for wasm
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: rust-analyzer 0.0.0 (366db7242 2022-06-12)
rustc version: rustc 1.63.0-nightly (c52b9c10b 2022-05-16)
os: Linux 5.18.3-arch1-1
editor: vscode 1.67.1
Minimal reproducible example: (vscode)
- Create lib project with:
cargo new --lib ra_wasm_bug - Add a some random dependency, eg: clap = "3.2.5"
- Compile with:
cargo build --target wasm32-unknown-unknown
> Clap and its dependencies get compiled as expected. - Rerun the same command
> Clap is no longer compiled as expected - Save lib.rs after no changes
> We can see in vscode's bottom bar that RA reruns cargo check - Rerun the build command
> Clap gets compiled again, for no reason (interestingly, some of its dependencies get compiled again, and some don't)
Note for people encountering this bug: as a workaround, it's possible to create a custom profile which inherits "dev" as a temporary fix. See the docs on custom profiles for more info
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior in a new cargo library using lib.rs, a dependency such as clap, and repeated cargo build --target wasm32-unknown-unknown commands while observing rust-analyzer in VS Code. Investigate the interaction between cargo check, the dev profile, and wasm incremental compilation; done means unchanged repeated builds no longer recompile dependencies unnecessarily.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- build-system, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100