Open ethanniser opened 1 month ago
Does cargo check
work in the VS Code terminal?
@lnicola Yes here is the whole project if it means anything: https://github.com/ethanniser/rust-analyzer-issue
happy to provide additional information or try different steps
thanks again
Any cargo.toml
anywhere? Where do these come from: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET
?
I appreciate you taking the time to help
Any cargo.toml anywhere?
as in like randomly in my file system? there shouldnt be
Where do these come from: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET?
I genuinely have no clue I thought they were something specific to the crate
I installed the rust toolchain today via fenix
Is there anything else I can do to help you?
Does cargo check work in the VS Code terminal? @lnicola Yes
Sorry, cargo build
!
I genuinely have no clue I thought they were something specific to the crate
No, I think it will fail even without dependencies.
Is there anything else I can do to help you?
I don't know anything about Nix, sorry :pensive:.
Normally, rust-lld
is installed by rustup
, somewhere like ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/rust-lld
. But it shouldn't be used on Mac OS, where the system linker is "good enough" AFAIK.
both cargo build
and cargo check
run fine
I really dont see how this would be a nix thing
in my mind either the required executables / variables are in the environment or they arent ... and everything is (right?- thats why cargo build
works?)
just to try it I removed the fenix stuff, just installed rustup as a nix package (no different than downloading it)
then running
╰─ rustup toolchain install stable
info: syncing channel updates for 'stable-aarch64-apple-darwin'
stable-aarch64-apple-darwin unchanged - rustc 1.79.0 (129f3b996 2024-06-10)
so I should have a regular rustup install
so that path exists on my machine:
─ ~/.r/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin ········································································································· ✔ 23:45:23
╰─ lst
.
├── gcc-ld
│ ├── ld.lld
│ ├── ld64.lld
│ ├── lld-link
│ └── wasm-ld
└── rust-lld
same issue remains
Can you try building with rust-analyzer via task? That should pop up a new terminal tab showing what command is being run, including what cargo specifically. Ctrl/⌘+Shift+P -> rust-analyzer: Run
when inside the main.rs file
main.rs -> Ctrl/⌘+Shift+P -> rust-analyzer: Run -> cargo run -p run-test
* Executing task: cargo run --package rust-test
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s
Running `target/debug/rust-test`
hello world
(there was also cargo check -p run-test --all-targets
and cargo test -p run-test --all-targets
- all ran successfully)
same error as at the start still present in rust-analyzer output
Any
cargo.toml
anywhere? Where do these come from:env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET
?
Hi, I've run into an issue I believe to share a root cause. In my example repo I make use of cargo.toml and am able to reproduce the behavior of rust-analyzer rejecting code that rustc is happy to compile.
OS: Win 11 Home 22H2 (22621.3880)
rustc version: 1.81.0-nightly (5affbb171 2024-07-18)
rust-analyzer version: 1.81.0-nightly (5affbb17 2024-07-18)
editor: helix 23.10 (f6021dd0)
relevant settings: .cargo/config.toml
of linked repository
This behavior seems to have manifested itself somewhat recently for me. Maybe around 2 - 3 weeks ago. It's been a while since I had worked in the affected repository and longer since a toolchain upgrade so I cannot be sure.
This repo replicates the issue using uuid
and sqlx
.
It does seem to be an issue in part with the [env]
structure in config.toml.
I've tracked my issue to nightly-2024-06-24-x86_64-pc-windows-msvc.
Ill see if I can try to find the specific commit tonight or tomorrow.
really appreciate you taking a look
fwiw I just tried using rust-anaylzer in neovim through mason which installed 2024-07-22
and it seems to be working just fine
really appreciate you taking a look fwiw I just tried using rust-anaylzer in neovim through mason which installed
2024-07-22
and it seems to be working just fine
I will move to a new issue then.
sure just to clarify, the issue is still the same as originally described in vscode
Any
cargo.toml
anywhere? Where do these come from:env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET
?Hi, I've run into an issue I believe to share a root cause. In my example repo I make use of cargo.toml and am able to reproduce the behavior of rust-analyzer rejecting code that rustc is happy to compile.
OS: Win 11 Home 22H2 (22621.3880) rustc version: 1.81.0-nightly (5affbb171 2024-07-18) rust-analyzer version: 1.81.0-nightly (5affbb17 2024-07-18) editor: helix 23.10 (f6021dd0) relevant settings:
.cargo/config.toml
of linked repositoryThis behavior seems to have manifested itself somewhat recently for me. Maybe around 2 - 3 weeks ago. It's been a while since I had worked in the affected repository and longer since a toolchain upgrade so I cannot be sure.
This repo replicates the issue using
uuid
andsqlx
.It does seem to be an issue in part with the
[env]
structure in config.toml.
I think your issue is resolved by https://github.com/rust-lang/rust-analyzer/pull/17697
Regarding the original issue, I am a bit stumped here as well
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
0.3.2037-standalone (e9afba57a 2024-07-14)
rustc version: (eg. output of
rustc -V
)rustc 1.79.0 (129f3b996 2024-06-10)
editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)
vscode
relevant settings: (eg. client settings, or environment variables like
CARGO
,RUSTC
,RUSTUP_HOME
orCARGO_HOME
)none
===
I am on macos I have a barebones
cargo init
project just with theuncased
crate added in cargo.toml (the issue is not specific to this crate, it happens with others too)cargo build
runs just finebut rust analyzer is unable compile it
Im a bit confused how
rust-lld.exe
would ever be called on macos any help is appreciated thanks