I’m doing Rust + webpack development inside of an FHS environment, and most everything is great. However, the code is also large enough that RLS is just excruciatingly slow, and all of my co-workers want me to switch to rust-analyzer.
Which I’ve tried, however rust-analyzer crashes inside of the FHS environment, and the backtrace is really uninformative:
[env] savanni@garnet:~/s/a/core $ rust-analyzer
Segmentation fault (core dumped)
[env] savanni@garnet:~/s/a/core $ gdb
GNU gdb (GDB) 8.3.1
...
(gdb) core core.14516
[New LWP 14516]
Core was generated by `/nix/store/6737cq9nvp4k5r70qcgf61004r0l2g3v-bash-4.4-p23/bin/bash -e /usr/bin/r'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fff67dfde06 in getcpu ()
(gdb) backtrace
#0 0x00007fff67dfde06 in getcpu ()
#1 0x00007f74145f5f07 in ?? ()
#2 0x0000000000000000 in ?? ()
(gdb)
This is going to be a little long, but this is my FHS bundle:
fhsEnv = pkgs.buildFHSUserEnv {
name = "project-fhs";
targetPkgs = pkgs: [
pkgs.alsaLib
pkgs.at-spi2-atk
pkgs.at-spi2-core
pkgs.atk
pkgs.binutils
pkgs.cairo
pkgs.cairo.dev
pkgs.clang
pkgs.cups
pkgs.curl
pkgs.glibc
pkgs.dbus
pkgs.dbus.dev
pkgs.dpkg
pkgs.expat
pkgs.gcc
pkgs.gdb
pkgs.gdk-pixbuf
pkgs.git
pkgs.glib
pkgs.glib.dev
pkgs.gnumake
pkgs.gtk3
pkgs.gtk3-x11
pkgs.jq
pkgs.lcov
pkgs.libdrm
pkgs.llvm_10
pkgs.lsb-release
pkgs.mesa
pkgs.nodejs-12_x
pkgs.nspr
pkgs.nss
pkgs.openssl
pkgs.openssl.dev
pkgs.pango
pkgs.pkgconfig
pkgs.python3
pkgs.python3Packages.pip
pkgs.rustup
pkgs.stdenv.cc
pkgs.udev
pkgs.unzip
pkgs.vim
pkgs.xorg.libX11
pkgs.xorg.libxcb
pkgs.xorg.libXcomposite
pkgs.xorg.libXcursor
pkgs.xorg.libXdamage
pkgs.xorg.libXext
pkgs.xorg.libXfixes
pkgs.xorg.libXi
pkgs.xorg.libXrandr
pkgs.xorg.libXrender
pkgs.xorg.libXScrnSaver
pkgs.xorg.libXtst
pkgs.yarn
pkgs.zip
pkgs.zlib
pkgs.zlib.dev
rust.rust
rust.rust-src
unstable.rust-analyzer
unstable.wasm-pack
];
runScript = "bash --init-file /etc/profile";
...
What should I add in? In the past, say when Electron crashed, I was able to finally trace it to a missing library that was being loaded dynamically. But getcpu
is a system call and I have no idea how to include that.
An alternative is to just give up and install rust-analyzer globally, but then I get file collisions between rust-src and rustlib that I don’t really want to resolve at the moment.