vscode-rust icon indicating copy to clipboard operation
vscode-rust copied to clipboard

rls keeps showing build_script_build

Open Phoenixkaze opened this issue 5 years ago • 6 comments

I opened a rust project folder in VS Code and rls started. After that it kept showing build_script_build. Sometimes VS Code alerted that rls crashed 5 times in the last 3 minutes. The features provided by the extension doesn't work when showing this. Reinstallation doesn't work. Tried on my Windows PC and everything's fine.

rls 0.6.3 VS Code 1.38.1 rustc 1.31.0 (abe02cefd 2018-12-04) macOS 10.15 Beta(19A582a)

Phoenixkaze avatar Oct 05 '19 13:10 Phoenixkaze

build_script_build means it's running a build script for a crate, be it a dependency or a primary crate.

Is the project you're working on open-source? If not, could you at least tell me the dependencies pulled or just Cargo.toml without the private bits (e.g. name)?

Xanewok avatar Oct 14 '19 12:10 Xanewok

It's just a little piece of demo which I was going to show to my students. The only dependency I added is rand. It sometimes gets stuck at build_script_build but not always the same.

Phoenixkaze avatar Oct 14 '19 13:10 Phoenixkaze

I have a similar problem with https://github.com/substrate-developer-hub/substrate-package It has a somewhat complex build process using https://crates.io/crates/substrate-wasm-builder-runner https://crates.io/crates/substrate-wasm-builder to generate a wasm file from the 'runtime' folder that is then included in the larger project

The code does build correctly with cargo build --release

rls highlights the whole Cargo.toml file in red with message:

build failed
error: failed to run custom build command for `node-template-runtime v2.0.0 (C:\dev\test\substrate-package\substrate-node-template\runtime)`

Caused by:
  process didn't exit successfully: `c:\dev\test\substrate-package\substrate-node-template\target\rls\debug\build\node-template-runtime-a1b38eda3810b960\build-script-build` (exit code: 1)
--- stdout
Unknown argument 'run'. Supported arguments:

    --version or -V to print the version and commit info
    --help or -h for this message
    --cli starts the RLS in command line mode
    No input starts the RLS as a language server

twhiteheadzm avatar Nov 25 '19 07:11 twhiteheadzm

Problem still exists with https://github.com/substrate-developer-hub/substrate-node-template master branch. There's an issue in Substrate repo. Developer answered that it's an internal compiler error: https://github.com/paritytech/substrate/issues/3278 It's impossible for me to develop (at least using Substrate framework) with rls-vscode , until issue is fixed.

@twhiteheadzm have you managed something?

F3Joule avatar Feb 18 '20 15:02 F3Joule

@F3Joule I switched to using rust-analyzer due to various issues with rls. For substrate I would recommend looking at the template in the main substrate repo. If I recall correctly they changed the build process that gets around this particular issue.

twhiteheadzm avatar Feb 18 '20 15:02 twhiteheadzm

I have a similar problem to @twhiteheadzm's similar problem...

rls also highlights my whole Cargo.toml red with the same message about failed to run custom build command for.... However, while I know what is causing the problem, I do not know how to make rls happy. The custom build script simply needs a PKG_CONFIG_PATH set, which I set inside the shell when compiling from the command line. I also use the vscode terminal.integrated.env.linux setting to automatically set this variable in any integrated terminal shell I open. But I cannot figure out how to tell rls about this variable and its value. Any ideas?

plwalsh avatar Nov 02 '20 19:11 plwalsh