| 13 Sep 2022 |
farcaller | openssl works. kinda. | 17:57:51 |
farcaller | If I add RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}" to my mkShell attrs then rust-analyzer seems to work too. To some extent:
proc macro `main` not expanded: Cannot create expander for /home/nixos/src/kube-cidr-manager/target/debug/deps/libtokio_macros-a639847ca16674fe.so: Io(Custom { kind: InvalidData, error: DlOpen { desc: "/nix/store/0xxjx37fcy2nl3yz6igmv4mag2a7giq6-glibc-2.33-123/lib/libc.so.6: version `GLIBC_2.34\' not found (required by /home/nixos/src/kube-cidr-manager/target/debug/deps/libtokio_macros-a639847ca16674fe.so)" } })rust-analyzerunresolved-proc-macro
| 18:11:15 |
farcaller | * If I add RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}" to my mkShell attrs then rust-analyzer seems to work too. To some extent:
proc macro mainnot expanded: Cannot create expander for /home/nixos/src/kube-cidr-manager/target/debug/deps/libtokio_macros-a639847ca16674fe.so: Io(Custom { kind: InvalidData, error: DlOpen { desc: "/nix/store/0xxjx37fcy2nl3yz6igmv4mag2a7giq6-glibc-2.33-123/lib/libc.so.6: versionGLIBC_2.34' not found (required by /home/nixos/src/kube-cidr-manager/target/debug/deps/libtokio_macros-a639847ca16674fe.so)" } })rust-analyzerunresolved-proc-macro`
| 18:11:26 |
farcaller | * If I add RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}" to my mkShell attrs then rust-analyzer seems to work too. To some extent:
proc macro mainnot expanded: Cannot create expander for /home/nixos/src/kube-cidr-manager/target/debug/deps/libtokio_macros-a639847ca16674fe.so: Io(Custom { kind: InvalidData, error: DlOpen { desc: "/nix/store/0xxjx37fcy2nl3yz6igmv4mag2a7giq6-glibc-2.33-123/lib/libc.so.6: versionGLIBC\_2.34' not found (required by /home/nixos/src/kube-cidr-manager/target/debug/deps/libtokio\_macros-a639847ca16674fe.so)" } })rust-analyzerunresolved-proc-macro\
| 18:11:34 |
farcaller | * If I add RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}" to my mkShell attrs then rust-analyzer seems to work too. To some extent:
proc macro mainnot expanded: Cannot create expander for /home/nixos/src/kube-cidr-manager/target/debug/deps/libtokio_macros-a639847ca16674fe.so: Io(Custom { kind: InvalidData, error: DlOpen { desc: "/nix/store/0xxjx37fcy2nl3yz6igmv4mag2a7giq6-glibc-2.33-123/lib/libc.so.6: versionGLIBC\_2.34' not found (required by /home/nixos/src/kube-cidr-manager/target/debug/deps/libtokio\_macros-a639847ca16674fe.so)" } })rust-analyzerunresolved-proc-macro
| 18:11:37 |
farcaller | I have no idea why it looks up glibc 2.34 in what clearly is glibc 2.33 | 18:12:11 |
farcaller | and given it's nixos I have no idea what's my glibc anywhere :( | 18:12:23 |
x10an14 | I've tried the rust-analyzer and vscode (read: codium) combo too, but can't get it to work... Would some kind soul here be willing to take a look at my below paste and tell me what I'm doing wrong? The rust-analyzer extension keeps complaning when I start up vscode - other than that I have no error messages (it complains about missing binaries for my OS - NixOS).
This is my first time ever using VS Code for rust, and first time ever touching rust-analyzer. Reading the Rust wiki and the plugins' issues didn't help me understand where to go from here. Any pointers anyone? https://paste.sr.ht/~x10an14/c9d82c36b864b0bd334a9ffaf43e065da385f9bb
| 22:12:11 |
x10an14 | In reply to @x10an14:matrix.org
I've tried the rust-analyzer and vscode (read: codium) combo too, but can't get it to work... Would some kind soul here be willing to take a look at my below paste and tell me what I'm doing wrong? The rust-analyzer extension keeps complaning when I start up vscode - other than that I have no error messages (it complains about missing binaries for my OS - NixOS).
This is my first time ever using VS Code for rust, and first time ever touching rust-analyzer. Reading the Rust wiki and the plugins' issues didn't help me understand where to go from here. Any pointers anyone? https://paste.sr.ht/~x10an14/c9d82c36b864b0bd334a9ffaf43e065da385f9bb
The flake was created with the command nix flake init --template github:the-nix-way/dev-templates#rust as a starting point. | 22:20:32 |
x10an14 | * I've tried the rust-analyzer and vscode (read: codium) combo too, but can't get it to work... Would some kind soul here be willing to take a look at my below paste and tell me what I'm doing wrong? The rust-analyzer extension keeps complaning when I start up vscode - other than that I have no error messages (it complains about missing binaries for my OS - NixOS).
This is my first time ever using VS Code for rust, and first time ever touching rust-analyzer (heck - first time ever using vscode on nix/nixos too). Reading the Rust wiki and the plugins' issues didn't help me understand where to go from here. Any pointers anyone? https://paste.sr.ht/~x10an14/c9d82c36b864b0bd334a9ffaf43e065da385f9bb
| 22:21:28 |
x10an14 | In reply to @farcaller:matrix.org
If I add RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}" to my mkShell attrs then rust-analyzer seems to work too. To some extent:
proc macro mainnot expanded: Cannot create expander for /home/nixos/src/kube-cidr-manager/target/debug/deps/libtokio_macros-a639847ca16674fe.so: Io(Custom { kind: InvalidData, error: DlOpen { desc: "/nix/store/0xxjx37fcy2nl3yz6igmv4mag2a7giq6-glibc-2.33-123/lib/libc.so.6: versionGLIBC\_2.34' not found (required by /home/nixos/src/kube-cidr-manager/target/debug/deps/libtokio\_macros-a639847ca16674fe.so)" } })rust-analyzerunresolved-proc-macro
I don't know how, but have you considered testing the fhs version in nixpkgs? I think it was referenced in the wiki page I linked in my above message. | 22:22:43 |
| 14 Sep 2022 |
farcaller | In reply to @x10an14:matrix.org I don't know how, but have you considered testing the fhs version in nixpkgs? I think it was referenced in the wiki page I linked in my above message. nothing in the toolchain should require fhs per se, though, no? | 08:29:07 |
x10an14 | In reply to @farcaller:matrix.org nothing in the toolchain should require fhs per se, though, no? I dunno, I only came across this in the wiki like I said. I'm really at a loss here myself on my own issues with rust-analyzer | 10:08:02 |
x10an14 | In reply to @farcaller:matrix.org nothing in the toolchain should require fhs per se, though, no? * I dunno, I only came across this in the wiki like I said. I'm really at a loss here myself on my own issues with rust-analyzer
https://nixos.wiki/wiki/Visual_Studio_Code#Use_VS_Code_extensions_without_additional_configuration
| 10:08:19 |
farcaller | ah right. my vscode is outside of nix so I don't think that applies. | 10:08:50 |
| pennae left the room. | 14:11:10 |
x10an14 | In reply to @x10an14:matrix.org
I've tried the rust-analyzer and vscode (read: codium) combo too, but can't get it to work... Would some kind soul here be willing to take a look at my below paste and tell me what I'm doing wrong? The rust-analyzer extension keeps complaning when I start up vscode - other than that I have no error messages (it complains about missing binaries for my OS - NixOS).
This is my first time ever using VS Code for rust, and first time ever touching rust-analyzer (heck - first time ever using vscode on nix/nixos too). Reading the Rust wiki and the plugins' issues didn't help me understand where to go from here. Any pointers anyone? https://paste.sr.ht/~x10an14/c9d82c36b864b0bd334a9ffaf43e065da385f9bb
I found a solution to my issue (I think - still veryfing/testing).
The rust-lang.rust-analyzer extension supports a "rust-analyzer.server.path": "rust-analyzer" setting, which can be put in <project/git repo root>/.vscode/settings.json. That along with the arrterian.nix-env-selector extension (and required shell.nix since I use flakes) seem to have done the trick for me.
Many thanks to @NobbZ on the Unofficial Nix/NixOS Discord Server for sharing the solution.
| 15:29:58 |
farcaller | arrterian.nix-env-selector didn't do anything useful for me :( what did you set rust-analyzer.server.path to? | 15:30:58 |
x10an14 | In reply to @farcaller:matrix.org arrterian.nix-env-selector didn't do anything useful for me :( what did you set rust-analyzer.server.path to? I installed rust-analyzer into the PATH that my flake's devShell specified. Check out the paste in my opening post. | 15:32:17 |
farcaller | ah | 15:32:51 |
farcaller | I've past that step :) I think you can also do the same with direnv and echo use\ flake >> .envrc | 15:34:58 |
x10an14 | In reply to @farcaller:matrix.org I've past that step :) I think you can also do the same with direnv and echo use\ flake >> .envrc Yes, that's correct =) | 15:36:25 |
x10an14 | In reply to @farcaller:matrix.org arrterian.nix-env-selector didn't do anything useful for me :( what did you set rust-analyzer.server.path to? To answer your question;
{
"rust-analyzer.server.path": "rust-analyzer"
}
| 15:38:16 |
farcaller | ah huh. | 15:58:26 |
schuelermine | farcaller: maybe you need to set the environment variable RUST_SRC_PATH to ${rustPlatform.rustLibSrc}? | 17:11:23 |
farcaller | In reply to @schuelermine:matrix.org farcaller: maybe you need to set the environment variable RUST_SRC_PATH to ${rustPlatform.rustLibSrc}? what's rustPlatform? where is it coming from? | 17:13:24 |
schuelermine | sorry, I mean pkgs.rustPlatform.rustLibSrc | 17:13:54 |
schuelermine | at any rate that was the issue I had which made VSCode not work | 17:14:16 |
farcaller | no cricket, same glibc issue :( | 17:19:06 |
farcaller | thanks for the idea, still. | 17:19:15 |