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

rPackages.pbdZMQ: fix package loading on Darwin #34766

Merged
merged 1 commit into from Feb 9, 2018

Conversation

mnacamura
Copy link
Contributor

Motivation for this change

When loading pbdZMQ on Darwin, R tries to find otool and install_name_tool dynamically; R invokes system("which otool", ...) and system("which install_name_tool", ...).
In a pure environment (nix-shell --pure), even if having these dependencies in buildInputs of pbdZMQ, they are not visible from the caller, somehow, so that it fails.
Even worse in an impure environment, R calls /usr/bin/otool. Without installation of Xcode or Command Line Tools, you'll see a popup message saying "would you like to install the tools now?"

Things done
  • Replaced each system("which ...") call by a static path to each dependency.
  • Tested it using the following script:
#!/usr/bin/env nix-shell --pure

with import <nixpkgs> {};
stdenv.mkDerivation {
  name = "darwin-r-pbdZMQ-test";
  buildInputs = [ (rWrapper.override { packages = [ rPackages.pbdZMQ ]; }) ];
  shellHook = ''
    Rscript -e 'library(pbdZMQ)'
    exit 0
  '';
}
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mnacamura mnacamura requested a review from peti as a code owner February 9, 2018 16:29
@peti peti merged commit 9861064 into NixOS:master Feb 9, 2018
@mnacamura mnacamura deleted the r-pbdZMQ-fix-darwin branch February 10, 2018 09:04
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.

None yet

3 participants