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

FetchBuildDataError in some default vscode installs #215

Open
rfulwell opened this issue Dec 29, 2023 · 0 comments
Open

FetchBuildDataError in some default vscode installs #215

rfulwell opened this issue Dec 29, 2023 · 0 comments

Comments

@rfulwell
Copy link

I did my best to faithfully follow defaults to install Rust and Rust Analyzer for WSL/Linux:
https://www.rust-lang.org/learn/get-started
https://code.visualstudio.com/docs/languages/rust

When launched on Debian 11 and Ubuntu 22.04 running in WSL2 I got the following error from the server:

[ERROR rust_analyzer::main_loop] FetchBuildDataError:
Failed to run build scripts for /workspaces/rust-analyzer-repro: No such file or directory (os error 2)

I prepared a dev container with a minimal set of files which reproduces the issue if you are set up to run remote containers:
https://github.com/rfulwell/rust-analyzer-repro

Steps to reproduce:

  1. git pull https://github.com/rfulwell/rust-analyzer-repro
  2. cd rust-analyzer-repro; code .
  3. When prompted, reopen the project in a dev container
  4. Open the src/main.rs file and pause while the server processes the file
  5. Note the error as above and the status bar message with popup:
    image

The most simplified way I was able to find in order to work around the issue is to override three default settings. You can reproduce this by uncommenting the lines in the devcontainer.json file yourself or reverting the last commit in the repo.

So to reproduce the workaround, uncomment these lines and rebuild the dev container:

				// "rust-analyzer.cargo.buildScripts.enable": false,
				// "rust-analyzer.procMacro.attributes.enable": false,
				// "rust-analyzer.procMacro.enable": false

This does not seem to be a blocking issue for the extension but I don't like working with persistent errors in my environment so here we are. 😅

lnicola added a commit that referenced this issue Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant