NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.13k stars 14.16k forks source link

Shared lib error at runtime with planor R package #99281

Closed eltix closed 3 years ago

eltix commented 4 years ago

Describe the bug A shared object 'Rcpp.so' not found error is raised at runtime when executing a R script depending on the planor package

To Reproduce Steps to reproduce the behavior:

  1. shell.nix:

    let
    nixpkgsRev = "bc260badaebf67442befe20fb443034d3a91f2b3"; # 20.09-beta
    nixpkgsSha256 = "1iysc4xyk88ngkfb403xfq5bs3zy29zfs83pn99kchxd45nbpb5q";
    
    nixpkgs = fetchTarball {
    url = "https://github.com/nixos/nixpkgs/archive/${nixpkgsRev}.tar.gz";
    sha256 = nixpkgsSha256;
    };
    pkgs = import nixpkgs {};
    stdenv = pkgs.stdenv;
    renv = pkgs.rWrapper.override{ packages = with pkgs.rPackages; [
      ggplot2
      knitr
      jsonlite
      remotes
      RcppArmadillo
      pkgs.rPackages.planor
      Rcpp
      R_utils
      ];};
    in with pkgs; {
    myProject = stdenv.mkDerivation {
    name = "factorial-design";
    version = "1";
    src = if pkgs.lib.inNixShell then null else nix;
    
    buildInputs = [
      glibcLocales
      renv
    ];
    };
    }
  2. An R script: main.R
    
    library("planor")
    library("R.utils")

ex1Key <- planor.designkey(factors=c("A","B","C","D"), nlevels=rep(3,4), model=~(A+B+C+D)^2, estimate=~A+B+C+D, nunits=3^3) print(ex1Key)

3. Run the script in the nix-shell:

Rscript main.R

4. An Error is raised:

Error: package or namespace load failed for 'planor' in library.dynam(lib, package, package.lib): shared object 'Rcpp.so' not found Execution halted

Expected behavior The expected behavior is that there is no error.

Screenshots NA

Additional context With the older nixpkgs revision 5272327b81ed355bbed5659b8d303cf2979b6953 (20.03) the script runs successfully

Notify maintainers @jabranham

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.0-48-generic, Ubuntu, 20.04.1 LTS (Focal Fossa)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.7`
 - channels(root): `"nixpkgs-19.09pre190327.54f385241e6"`
 - channels(etixier): `"unstable-20.09pre236721.840c782d507"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

jbedo commented 3 years ago

Planor was removed from CRAN and hence isn't in rPackages.