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

visual studio code with rust-analyzer reports nightly compiler needed #3513

Closed
winksaville opened this issue Aug 26, 2022 · 4 comments
Closed

Comments

@winksaville
Copy link
Contributor

winksaville commented Aug 26, 2022

Description

I ran VSCODE using code . from root of lighthouse repo and the following message was displayed:

rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /home/wink/prgs/rust/forks/lighthouse/Cargo.toml, Some(Version { major: 1, minor: 52, patch: 0 }): Failed to run `"cargo" "metadata" "--format-version" "1" "--manifest-path" "/home/wink/prgs/rust/forks/lighthouse/Cargo.toml" "--filter-platform" "x86_64-unknown-linux-gnu"`: `cargo metadata` exited with an error: error: failed to parse manifest at `/home/wink/prgs/rust/forks/lighthouse/account_manager/Cargo.toml`

Caused by:
  feature `edition2021` is required

  this Cargo does not support nightly features, but if you
  switch to nightly channel you can add
  `cargo-features = ["edition2021"]` to enable this feature

Version

wink@3900x 22-08-26T16:39:54.991Z:~/prgs/rust/forks/lighthouse (stable)
$ git log -1 --format=short
commit 18c61a5e8be3e54226a86a69b96f8f4f7fd790e4 (HEAD -> stable, upstream/stable)
Author: Paul Hauner <[email protected]>

    v3.0.0 (#3464)
wink@3900x 22-08-26T16:40:18.885Z:~/prgs/rust/forks/lighthouse (stable)
$ rustc --version
rustc 1.52.1 (9bc8c42bb 2021-05-09)
wink@3900x 22-08-26T16:40:45.797Z:~/prgs/rust/forks/lighthouse (stable)

Present Behaviour

Got an error notification as noted above

Expected Behaviour

Don't expect the error notification.

Steps to resolve

As suggested in the error message, adding rust-toolchain.toml with "nightly" resolves the problem, but if that's the case I suggest adding rust-toolchain.toml to the repo.

wink@3900x 22-08-26T16:29:17.568Z:~/prgs/rust/forks/lighthouse (stable)
$ cat rust-toolchain.toml 
[toolchain]
channel = "nightly"
@pawanjay176
Copy link
Member

I think your rustc version is too old. We are currently using 1.63 and minimum supported version is 1.62. We are trying to do a better job of documenting required rust versions. Check this comment #3474 (comment)

@winksaville
Copy link
Contributor Author

@pawanjay176, that worked and I don't see the error notification and rustup check reports:

wink@3900x 22-08-26T18:22:36.436Z:~/prgs/rust/forks/lighthouse (stable)
$ rustup check
stable-x86_64-unknown-linux-gnu - Up to date : 1.63.0 (4b91a6ea7 2022-08-08)
nightly-x86_64-unknown-linux-gnu - Up to date : 1.65.0-nightly (748038961 2022-08-25)
rustup - Up to date : 1.25.1
wink@3900x 22-08-26T18:23:31.132Z:~/prgs/rust/forks/lighthouse (stable)

But the weird thing is rustc --version is 1.52 if in lighthouse/:

wink@3900x 22-08-26T18:23:31.132Z:~/prgs/rust/forks/lighthouse (stable)
$ rustc --version
rustc 1.52.1 (9bc8c42bb 2021-05-09)

But it's 1.63 if I'm in its parent:

wink@3900x 22-08-26T18:24:47.768Z:~/prgs/rust/forks/lighthouse (stable)
$ cd ..
wink@3900x 22-08-26T18:25:32.838Z:~/prgs/rust/forks
$ rustc --version
rustc 1.63.0 (4b91a6ea7 2022-08-08)

Could you explain that?

@pawanjay176
Copy link
Member

Ohh you might have done an override at some point in the lighthouse directory? Try this from the lighthouse directory

rustup override unset

@winksaville
Copy link
Contributor Author

winksaville commented Aug 26, 2022

Sure enough, IIRC something was broken at one point and I was using override. Add good now, TXS!

wink@3900x 22-08-26T19:45:20.035Z:~/prgs/rust/forks/lighthouse (stable)
$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/wink/.rustup

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

stable-x86_64-unknown-linux-gnu (default)
nightly-2020-07-10-x86_64-unknown-linux-gnu
nightly-2021-03-25-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.41.0-x86_64-unknown-linux-gnu
1.52.1-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

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

1.52.1-x86_64-unknown-linux-gnu (directory override for '/home/wink/prgs/rust/forks/lighthouse')
rustc 1.52.1 (9bc8c42bb 2021-05-09)

wink@3900x 22-08-26T19:45:25.370Z:~/prgs/rust/forks/lighthouse (stable)
$ rustup override unset
info: override toolchain for '/home/wink/prgs/rust/forks/lighthouse' removed
wink@3900x 22-08-26T19:46:46.258Z:~/prgs/rust/forks/lighthouse (stable)
$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/wink/.rustup

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

stable-x86_64-unknown-linux-gnu (default)
nightly-2020-07-10-x86_64-unknown-linux-gnu
nightly-2021-03-25-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.41.0-x86_64-unknown-linux-gnu
1.52.1-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

aarch64-unknown-linux-gnu
arm-unknown-linux-gnueabihf
thumbv7em-none-eabihf
thumbv7m-none-eabi
wasm32-unknown-unknown
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl

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

stable-x86_64-unknown-linux-gnu (default)
rustc 1.63.0 (4b91a6ea7 2022-08-08)
wink@3900x 22-08-26T19:46:51.803Z:~/prgs/rust/forks/lighthouse (stable)
$ rustc --version
rustc 1.63.0 (4b91a6ea7 2022-08-08)

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

No branches or pull requests

2 participants