-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
unresolved extern crate
on Nixos
#17560
Comments
Anybody willing to help me on this ? |
Encountered the same problem and I found out that:
|
I found out that in the part that reads |
I think we also need #10792 |
For those looking for workaround, there is cognitive-engineering-lab/rustc_plugin#26 (comment) by @StealthyKamereon
Just to make my life easier, I've made this script: #!/usr/bin/env bash
# local_nix directory is <current dir>/.local-nix
local_nix="$(dirname "$(readlink -f "$0")")/.local-nix"
# remake if local nix directory do not exists or the current copy do not match $RUST_PKG
if [ ! -d "$local_nix" ]; then
should_remake="true"
elif [ "$(cat "$local_nix/origin_rust_pkg")" != "$RUST_PKG" ]; then
should_remake="true"
# Clear current copy
echo "Clearing $local_nix"
rm -rf "$local_nix"
else
should_remake="false"
fi
if [ "$should_remake" = "true" ]; then
echo "Making $local_nix"
# copy nix
nix copy --to "$local_nix" $RUST_PKG --no-check-sigs
# Make writable
chmod u+w -R "$local_nix"
# Save original path to file
echo "$RUST_PKG" > "$local_nix/origin_rust_pkg"
fi |
Yes, thanks for reposting the workaround here :) For anyone coming here, see this workaround. |
Thanks for making the workaround anyways! I have no idea know how long I'm going to take without the works you've done. Mega time saver. |
rust-analyzer version: rust-analyzer 1.80.0-nightly (d84b903 2024-05-19)
rustc version: rustc 1.80.0-nightly (d84b90375 2024-05-19)
editor or extension: NeoVim configured with lspconfig
relevant settings:
repository link (if public, optional): rustc_plugin example
steps to reproduce:
Clone the example from https://github.com/cognitive-engineering-lab/rustc_plugin/ and change the crate:
Create a shell.nix with the following content:
Enter the shell:
Launch RA:
rust-analyzer diagnostics .
You will have the following errors:
See cognitive-engineering-lab/rustc_plugin#26 for additional information.
The text was updated successfully, but these errors were encountered: