Skip to content

Conversation

itsjunetime
Copy link
Contributor

On main, trying to run cargo xtask install --pgo crate@version panics due to some code paths trying to re-attach to the salsa database when it's already attached. To resolve that, I changed some parts of the code to not attach to the database when we already know we're attached.

I'm not sure if this is the "correct" approach, but it seems to do the job for me. After this change, I was able to do all the following just fine:

  1. cargo nextest run
  2. cargo build --release --features mimalloc --target $(rustc --print host-tuple) && cargo xtask install --server --mimalloc --proc-macro-server --pgo apache/[email protected] (as an example crate)
  3. Using my ide with the version of rust-analyzer installed in the previous step and jumping around, using suggestions, etc.

This PR is also probably better viewed without the whitespace changes - there's a good bit of indentation changes.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 2, 2025
@ChayimFriedman2
Copy link
Contributor

That's my mistake in #20765, but the fix needed is much smaller: just shrink the scope of the salsa::attach() to end before the call to run_ide_things().

@itsjunetime itsjunetime force-pushed the no_panic_analysis_stats branch from 6a2f08a to 10763b0 Compare October 4, 2025 17:30
@itsjunetime
Copy link
Contributor Author

itsjunetime commented Oct 4, 2025

@ChayimFriedman2 I fixed that up, does it look good now?

Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

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

Thanks!

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Oct 4, 2025
Merged via the queue into rust-lang:master with commit 4b0c711 Oct 4, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 4, 2025
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.

3 participants