Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Could not compile on Nightly Channel #749

Open
visualcookie opened this issue Mar 17, 2020 · 12 comments
Open

Could not compile on Nightly Channel #749

visualcookie opened this issue Mar 17, 2020 · 12 comments

Comments

@visualcookie
Copy link

Hej, currently trying to get the extension up and running. I already set "rust-client.channel": "nightly", but appearently the extension could not compile.

Cargo.toml

[package]
name = "xxx"
version = "0.1.0"
authors = ["Dean Hidri <xxx@gmail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
juniper = "0.14.2"
juniper_rocket = "0.5.2"
rocket = "0.4.4"
serde_json = "1.0.48"

Error I'm getting:

{
	"resource": "/Users/visualcookie/Development/xxx/Cargo.toml",
	"owner": "rust0",
	"severity": 8,
	"message": "could not compile `serde_derive`.\nerror: could not compile `juniper_codegen`.\n\nTo learn more, run the command again with --verbose.\n",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 10000,
	"endColumn": 1
}

The thing is, when I run rustup run cargo build in the Terminal myself, it works without issues, but I can't seem to disable the build process from the extension. Already checked some of the open issues, but nothing worked.

@dennybritz
Copy link

dennybritz commented Mar 17, 2020

Having the same issue, and have had it for a while now. I was never able to build on nightly.

Seems to be related to rust-lang/rls#1449 and rust-lang/rls#1635?

@raphaelrobert
Copy link

I'm running into the same problem.

@snylonue
Copy link

snylonue commented Mar 18, 2020

After I closed VS Code and ran update command, the error disappeared.

@visualcookie
Copy link
Author

@snylonue Tried that as well, but didn't work for me, as RLS would always rebuild on start.

@rusenask
Copy link

same issue on MacOS, rustup 1.21.1 (7832b2ebe 2019-12-20). Tried removing everything and reinstalling again but only switch to stable channel fixed the issue.

@SorteKanin
Copy link

Same issue. This renders the extension useless for me currently.

@taegyunkim
Copy link

taegyunkim commented Mar 30, 2020

Probably related to rust-lang/rust#69933. The fix for this issue is already included in nightly, so I assume it will eventually be fixed. However, it's weird that cargo build from terminal works, but rls-vscode fails to build with following error message. rls seems to work fine.

{"message":"cannot lex `source_file` without source: /Users/taegyunkim/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.3/src/lib.rs","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror: internal compiler error\u001b[0m\u001b[0m\u001b[1m: cannot lex `source_file` without source: /Users/taegyunkim/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.3/src/lib.rs\u001b[0m\n\n"}
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:880:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0-nightly (f509b26a7 2020-03-18) running on x86_64-apple-darwin

note: compiler flags: -C prefer-dynamic -C debuginfo=2 --crate-type proc-macro

note: some of the compiler flags provided by cargo are hidden

{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to previous error\u001b[0m\n\n"}

My setup.

$> rustup show
Default host: x86_64-apple-darwin
rustup home:  /Users/taegyunkim/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin (default)

active toolchain
----------------

nightly-x86_64-apple-darwin (default)
rustc 1.44.0-nightly (f509b26a7 2020-03-18)

$> rustup --version
rustup 1.21.1 (7832b2ebe 2019-12-20)

@appul
Copy link

appul commented Apr 1, 2020

@taegyunkim RLS isn't available for the latest nightly. The last nightly RLS is available for is 2020-03-18, which I presume is before that fix got implemented.

Rustup will try to find the latest nightly build that has the components available for your toolchain. And since RLS is part of your toolchain, the last compatible build is 2020-03-18, at least until RLS is updated for the latest nightly.

What you can try is using an older nightly build that didn't have this issue. thecodewarrior mentioned 2020-03-09 on that issue, so you can try by specifying that particular build like rustup override set nightly-2020-03-09.

@robintyagiandersson
Copy link

robintyagiandersson commented Apr 5, 2020

If it is any of any help, I am receiving a similar error while testing the pyo3 example

Below is the error that is displayed while having my cursor over the contents of Cargo.toml:

could not compile `serde_derive`.
error: could not compile `ctor`.

To learn more, run the command again with --verbose.
error: could not compile `ghost`.

To learn more, run the command again with --verbose.
error: could not compile `pyo3-derive-backend`.

Worth to mention that cargo build --release works fine.

@picode7
Copy link

picode7 commented Jan 18, 2021

I'm still getting this issue in VS Code (fresh install of the plugin and rust)
image

@Sijisu
Copy link

Sijisu commented Jan 10, 2022

The issue persists for me with rust-lang.rust version v0.7.8 and rustup show: stable-x86_64-unknown-linux-gnu (default) rustc 1.57.0 (f1edd0429 2021-11-29)

@lnicola
Copy link
Member

lnicola commented Jan 10, 2022

@Sijisu if you aren't aware of it, you might want to try https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer (but please download the VSIX from GitHub instead). See #927 for context.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests