Rstudio is still not working with a segmentation fault. I am on 25.11, and id like help debugging it or knowing how to find the error to patch it. Regards
❯ rstudio
/bin/sh: line 1: /usr/bin/which: No such file or directory
zsh: segmentation fault (core dumped) rstudio
How did you install rstudio? That looks like a package for another distro, you’d need to do extensive patching (which the nixpkgs package should have already done for you) to use that on NixOS.
I’m getting the exact same error message on 25.11; this worked just fine with the same configuration until just recently.My configuration is like this:
{ config, pkgs, lib, ... }:
let
# Define required R packages:
required_r_packages = with pkgs.rPackages; [
arrow
tidymodels
tidyverse
# And more packages as needed.
];
r_w_pkgs = pkgs.rWrapper.override { packages = required_r_packages; };
rLibsSite = "${r_w_pkgs}/lib/R/library";
in
{
# Install R with Packages:
environment.systemPackages = with pkgs; [
stanc
r_w_pkgs
quarto
pandoc
which # added this, but doesn't resolve.
(rstudioWrapper.override {
R = r_w_pkgs;
packages = required_r_packages;
})
];
}
This just creates a symlink to which and after I ran nixos-rebuild switchmy rstudio is back up and running as it used to!
Now, what would be ideal is reviewing the packaging code, and submitting a PR to resolve this for others when they install the package without that symlink hack.
I’m not an R user, but it strikes me as odd that you’re doubly installing R (both via r_w_pkgs/rWrapperand an override of the rstudioWrapper). Depending on ordering, it’s quite possible you end up with a binary that doesn’t have whatever workarounds apply to which applied.
Additionally, the issue might actually be in one of the R packages rather than R itself. Simplifying the config and incrementally adding that complexity back until you find the root cause would be the first step to writing an issue that can actually be fixed.
well i have just build the package locally without any changes and it still cannot run with the same segmentation fault again /bin/sh: line 1: /usr/bin/which: No such file or directory
zsh: segmentation fault (core dumped) ./result/bin/rstudio. I think we should look at the build process to find the error
Agreed it is hacky. I just wanted to get some of my work done - and confirm there wasn’t more to it since I also received a bunch of GPU warnings and a subsequent segfault.
Just wanted to share an easy workaround until the proper fix is found:
setting the environment variable RSTUDIO_QUERY_FONTS=0 will skip calling the function that segfaults.
I’ll keep working to try to find a proper fix.
Thanks for this info - I wrote my Rstudio configuration when I was brand new to NixOS, and actually haven’t revisited it. If I recall, I was struggling to get R packages to show-up in my environment which is why there’s the bizarre wrapper set-up.
This works for me with export RSTUDIO_QUERY_FONTS=0, allthough the /usr/bin/which error still complains. I think it would still make sense to rewrite this such that it is nixos compatible.
❯ export RSTUDIO_QUERY_FONTS=0
~
❯ rstudio
[5794:1212/082441.242894:ERROR:ui/gl/init/gl_factory.cc:103] Requested GL implementation (gl=none,angle=none) not found in allowed implementations: [(gl=egl-angle,angle=default)].
[5794:1212/082441.244039:ERROR:components/viz/service/main/viz_main_impl.cc:184] Exiting GPU process due to errors during initialization
/bin/sh: line 1: /usr/bin/which: No such file or directory