NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.32k stars 13.56k forks source link

r-modules/generic-builder.nix does not run tests, contrary to code comment #98575

Open bcdarwin opened 3 years ago

bcdarwin commented 3 years ago

Describe the bug

In pkgs/development/r-modules/generic-builder.nix we find:

  checkPhase = ''
    # noop since R CMD INSTALL tests packages
  '';

but this is not actually true; when building any package one doesn't see the output of running R CMD check <r-cmd-build-output.tar.gz>

To Reproduce

nix-build -A rPackages.lenses '\<nixpkgs>' --pure

Expected behavior

We should see the output of running R CMD check, i.e.

 ... lots of other checks ...
* checking tests ...
  Running 'testthat.R'
 OK
* checking PDF version of manual ... OK
* DONE

Status: OK

Notify maintainers

@peti

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: rPackages
cfhammill commented 3 years ago

It should be noted that R CMD INSTALL only tests that the package can be loaded, R CMD check is needed to run the actual tests and an assortment of other QC checks.

stale[bot] commented 3 years ago

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

Kupac commented 2 years ago

My understanding is that R CMD CHECK Is needed for package development to ensure that the package complies with R package requirements. R CMD INSTALL may be sufficient here, as our goal is to install packages, not to submit them to CRAN. In other words, a package that fails R CMD CHECK may still be perfectly usable.

bcdarwin commented 2 years ago

R CMD check also tests the packages, unlike R CMD INSTALL. We can of course disable extraneous or CRAN-specific checks (e.g. --no-manual, etc.).