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

Significant delay on check-on-save after loading workspace, and for some files it never triggers #18914

Open
RalfJung opened this issue Jan 11, 2025 · 5 comments
Labels
C-bug Category: bug

Comments

@RalfJung
Copy link
Member

RalfJung commented Jan 11, 2025

To reproduce:

  • open Miri in RA
  • wait until the "budy" indicator at the bottom of the windows disappears
  • change some file and hit Ctrl-S

Expected behavior:

  • the check build starts pretty much immediately, with a "busy" indicator at the bottom of the window

Actual behavior:

  • it can take 15s until the "busy" indicator appears and the check build actually starts

I think that's new; check builds used to be pretty responsive always, even immediately after loading a workspace.

rust-analyzer version: rust-analyzer version: 0.3.2257-standalone [/home/r/.vscode-oss/extensions/rust-lang.rust-analyzer-0.3.2257-linux-x64/server/rust-analyzer]

rustc version: very recent nightly

editor or extension: VSCodium, extension v0.3.2257

relevant settings:

{
    "rust-analyzer.rustc.source": "discover",
    "rust-analyzer.linkedProjects": [
        "Cargo.toml",
        "cargo-miri/Cargo.toml",
        "miri-script/Cargo.toml",
    ],
    "rust-analyzer.check.invocationLocation": "root",
    "rust-analyzer.check.invocationStrategy": "once",
    "rust-analyzer.check.overrideCommand": [
        "env",
        "MIRI_AUTO_OPS=no",
        "./miri",
        "clippy",
        "--message-format=json",
    ],
    // Contrary to what the name suggests, this also affects proc macros.
    "rust-analyzer.cargo.buildScripts.invocationLocation": "root",
    "rust-analyzer.cargo.buildScripts.invocationStrategy": "once",
    "rust-analyzer.cargo.buildScripts.overrideCommand": [
        "env",
        "MIRI_AUTO_OPS=no",
        "./miri",
        "check",
        "--message-format=json",
    ],
}
    "rust-analyzer.lens.enable": false,
    "rust-analyzer.cachePriming.enable": false,
    "rust-analyzer.cargo.buildScripts.useRustcWrapper": false, // https://github.com/rust-lang/rust-analyzer/issues/14722
    "rust-analyzer.diagnostics.disabled": [
        "unlinked-file",
        "macro-error" // trouble with the xshell `cmd!` macro
    ],

repository link (if public, optional): https://github.com/rust-lang/miri/

@RalfJung RalfJung added the C-bug Category: bug label Jan 11, 2025
@RalfJung
Copy link
Member Author

Just waiting a while doesn't always seem to help, but I don't understand what helps... I'm playing around with things randomly and at some point check builds start to happen. Very strange.

@RalfJung
Copy link
Member Author

At least for Miri it seems to have to do with which file I am saving. Saving miri-script/src/commands.rs is entirely ignored, but saving src/shims/unix/linux_like/epoll.rs eventually triggers a build. Is RA trying to figure out whether the file belongs to the project and that somehow goes wrong?

@RalfJung RalfJung changed the title Huge delay on check-on-save after loading workspace Huge delay on check-on-save after loading workspace, and for some files it never triggers Jan 11, 2025
@Veykril
Copy link
Member

Veykril commented Jan 11, 2025

Is RA trying to figure out whether the file belongs to the project and that somehow goes wrong?

Most likely this

@RalfJung
Copy link
Member Author

The odd this is that this used to work, a few months ago. I couldn't find recent changes mentioning check-on-save, but maybe I searched for the wrong keywords.

@RalfJung
Copy link
Member Author

RalfJung commented Jan 11, 2025

Okay so actually I think there are two issues here:

  • For files in src/, if I save a file shortly after opening the workspace, it takes ~15s until it even starts doing the check build (or at least, until the "busy" indicator appears)
  • For files outside src/, it never starts a check build; not even if the file is contained in one of the other linkedProjects

Should I report one of these as a separate issue?

@RalfJung RalfJung changed the title Huge delay on check-on-save after loading workspace, and for some files it never triggers Significant delay on check-on-save after loading workspace, and for some files it never triggers Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants