Skip to content
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

rstudioWrapper not exporting environment variables in nix-shell #54872

Closed
afrubin opened this issue Jan 29, 2019 · 3 comments
Closed

rstudioWrapper not exporting environment variables in nix-shell #54872

afrubin opened this issue Jan 29, 2019 · 3 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@afrubin
Copy link

afrubin commented Jan 29, 2019

Issue description

rstudio won't open correctly when built using nix-shell as part of pkgs.rstudioWrapper.override on the master branch.

Starting rstudio returns the following error:

$ rstudio
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Aborted

However, when the same .nix file is passed to nix-build, the application starts as expected.

It appears that when built with nix-shell, the environment variables are not being set correctly:

$ cat $(which rstudio)
#! /nix/store/vs6d2fjkl4kb3jb7rwibsd76k9v2n4xy-bash-4.4-p23/bin/bash -e
export PATH=$PATH${PATH:+':'}'/nix/store/nj0aq4p4m55ci500x1flh8v2cc6snwh7-gnumake-4.2.1/bin'
exec -a "$0" "/nix/store/j5jvvi3sbpydji910xkb0xwyby078kwx-RStudio-1.1.463/bin/.rstudio-wrapped"  "${extraFlagsArray[@]}" "$@"

But they are being set correctly when built with nix-build:

$ cat result/bin/rstudio 
#! /nix/store/vs6d2fjkl4kb3jb7rwibsd76k9v2n4xy-bash-4.4-p23/bin/bash -e
export R_PROFILE_USER='/nix/store/slidksdja1p10im345m3mbkj8dsc54cb-RStudio-1.1.463-wrapper/fix_libs.R'
export QT_PLUGIN_PATH='/nix/store/kq10gqm6fx1r8k5402bkabc094n92flg-qtbase-5.12.0-bin/lib/qt-5.12/plugins'${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH
exec "/nix/store/j5jvvi3sbpydji910xkb0xwyby078kwx-RStudio-1.1.463/bin/rstudio"  "${extraFlagsArray[@]}" "$@"

According to the Nixpkgs documentation, using nix-shell with the rstudioWrapper should work correctly.

Using the stable version of Nixpkgs, both nix-shell and nix-build allow RStudio to start correctly.

Steps to reproduce

Use the example shell.nix from the Nixpkgs RStudio documentation with nix-shell on the master branch of Nixpkgs:

$ cat shell.nix 
{ pkgs ? import ../nixpkgs {}
}:

pkgs.rstudioWrapper.override {
  packages = with pkgs.rPackages; [ dplyr ggplot2 reshape2 ];
}

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.14.94, NixOS, 18.09.1972.5d9024da9b9 (Jellyfish)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.1.3
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
@knedlsepp
Copy link
Member

Could probably be fixed via: #54525

@stale
Copy link

stale bot commented Jun 3, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2020
@jbedo
Copy link
Contributor

jbedo commented Sep 7, 2021

Resolved by #74381.

@jbedo jbedo closed this as completed Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

3 participants