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

rstudio: use qt5's mkDerivation #74381

Merged
merged 1 commit into from Feb 9, 2020
Merged

rstudio: use qt5's mkDerivation #74381

merged 1 commit into from Feb 9, 2020

Conversation

tomcur
Copy link
Contributor

@tomcur tomcur commented Nov 27, 2019

Motivation for this change

This fixes QT5 at runtime. See tracking issue #65399.
Fixes #74298.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @ehmry @changlinli @ciil

@ciil
Copy link
Member

ciil commented Nov 27, 2019

Thanks a lot for tackling the qt5 issue. Last time I checked this change wasn't enough to fix it, but hopefully it works now. Unless somebody else does it first, I'll be looking into this more thoroughly tomorrow.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's double wrapped, one of them isn't needed

#rstudio
#! /nix/store/b34zjdmq5l8k6rwdykjx55yl9r9isl8k-bash-4.4-p23/bin/bash -e
export PATH=$PATH${PATH:+':'}'/nix/store/64w6bxpi29xm01lnis31pii17q79inaw-gnumake-4.2.1/bin'
exec -a "$0" "/nix/store/c9qkgz4c7aivbhk0bjzgsl4vsh516p02-RStudio-1.2.1335/bin/.rstudio-wrapped"  "$@"

EDIT: looking at the expression, this would imply that rstudio shells out to make... is that true?

@tomcur
Copy link
Contributor Author

tomcur commented Nov 28, 2019

@jonringer thanks, I've moved the wrapping into qtWrapperArgs: there's only one layer of wrapping now.

RStudio uses Make for build tooling. Building RStudio without gnumake in qtWrapperArgs, and then trying to use the Make build tools at runtime in RStudio, will error.

Oddly enough, when:

  1. building RStudio with qtWrapperArgs;
  2. then copying the resulting wrapper and removing the PATH export; and
  3. launching that custom wrapper while providing only bash in the path: PATH=/nix/store/fa4zygrvfq77gccqiyl9kixs05nfihk1-bash-interactive-4.4-p23/bin ./custom-rstudio-wrapper

RStudio somehow still gets gnumake in its path: if you open a terminal inside RStudio and echo $PATH, it'll show whatever you set the path to and will have gnumake appended. Something like /nix/store/fa4zygrvfq77gccqiyl9kixs05nfihk1-bash-interactive-4.4-p23/bin:/nix/store/64w6bxpi29xm01lnis31pii17q79inaw-gnumake-4.2.1/bin. I'm not sure why that is.

Copy link
Member

@ciil ciil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if you echo $PATH in the originally wrapped version leads to gnumake being appended twice. I don't see any obvious way to resolve this now and would rather (now that I finally got around to testing) see this merged sooner rather than even later.

So, tested and lgtm for what the PR set out to do.

@jonringer
Copy link
Contributor

the rstudio package launches fine, is there a need for the rstudioWrapper package anymore?

@tomcur
Copy link
Contributor Author

tomcur commented Feb 5, 2020

@jonringer rstudioWrapper is a package that is to rstudio as rWrapper is to R: it sets R_LIBS_SITE. This appears to be necessary if you want to use R packages installed with Nixpkgs (through rstudioWrapper.override = { packages = [ ... ]; }.

rstudioWrapper uses rstudio.

@veprbl veprbl merged commit c32cccc into NixOS:master Feb 9, 2020
@jonringer
Copy link
Contributor

ah, so it's to help with managing r packages. Sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RStudio "failed to start because no Qt platform plugin could be initialized"
6 participants