Gabriel Becker
2021-May-04 21:10 UTC
[Rd] Testing R build when using --without-recommended-packages?
Hi Henrik, A couple of things. Firstly, so far asI have ever heard, it's valid that a package have hard dependencies in its tests for packages listed only in Suggests. In fact, that is one of the stated purposes of Suggests. An argument could be made, I suppose, that the base packages should be under stricter guidelines, but stats isn't violating the letter or intention of Suggests by doing this. Secondly, I don't have time to dig through the make files/administration docs, but I do know that R CMD check has --no-stop-on-error, so you can either separately or as part of make check, use that option for stats (and elsewhere as needed?) and just know that the stats tests that depend on MASS are "false positive" (or, more accurately, missing value) test results, rather than real positives, and go from there. You could also "patch" the tests as part of your build process. Somewhere I worked had to do that for parts of the internet tests that were unable to get through the firewall. Best, ~G On Tue, May 4, 2021 at 1:04 PM Henrik Bengtsson <henrik.bengtsson at gmail.com> wrote:> Two questions to R Core: > > 1. Is R designed so that 'recommended' packages are optional, or > should that be considered uncharted territories? > > 2. Can such an R build/installation be validated using existing check > methods? > > > -- > > Dirk, it's not clear to me whether you know for sure, or you draw > conclusions based your long experience and reading. I think it's very > important that others don't find this thread later on and read your > comments as if they're the "truth" (unless they are). I haven't > re-read it from start to finish, but there are passages in 'R > Installation and Administration' suggesting you can build and install > R without 'recommended' packages. For example, post-installation, > Section 'Testing an Installation' suggests you can run (after making > sure `make install-tests`): > > cd tests > ../bin/R CMD make check > > but they fail the same way. The passage continuous "... and other > useful targets are test-BasePackages and test-Recommended to run tests > of the standard and recommended packages (if installed) respectively." > (*). So, to me that hints at 'recommended' packages are optional just > as they're "Priority: recommended". Further down, there's also a > mentioning of: > > $ R_LIBS_USER="" R --vanilla > > Sys.setenv(LC_COLLATE = "C", LC_TIME = "C", LANGUAGE = "en") > > tools::testInstalledPackages(scope = "base") > > which also produces errors when 'recommended' packages are missing, > e.g. "Failed with error: 'there is no package called 'nlme'". > > (*) BTW, '../bin/R CMD make test-BasePackages' gives "make: *** No > rule to make target 'test-BasePackages'. Stop." > > Thanks, > > /Henrik > > On Tue, May 4, 2021 at 12:22 PM Dirk Eddelbuettel <edd at debian.org> wrote: > > > > > > On 4 May 2021 at 11:25, Henrik Bengtsson wrote: > > | FWIW, > > | > > | $ ./configure --help > > | ... > > | --with-recommended-packages > > | use/install recommended R packages [yes] > > > > Of course. But look at the verb in your Subject: no optionality _in > testing_ there. > > > > You obviously need to be able to build R itself to then build the > recommended > > packages you need for testing. > > > > Dirk > > > > -- > > https://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >[[alternative HTML version deleted]]
Ben Bolker
2021-May-04 21:22 UTC
[Rd] Testing R build when using --without-recommended-packages?
Sorry if this has been pointed out already, but some relevant text from https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Suggested-packages > Note that someone wanting to run the examples/tests/vignettes may not have a suggested package available (and it may not even be possible to install it for that platform). The recommendation used to be to make their use conditional via if(require("pkgname")): this is OK if that conditioning is done in examples/tests/vignettes, although using if(requireNamespace("pkgname")) is preferred, if possible. ... > Some people have assumed that a ?recommended? package in ?Suggests? can safely be used unconditionally, but this is not so. (R can be installed without recommended packages, and which packages are ?recommended? may change.) On 5/4/21 5:10 PM, Gabriel Becker wrote:> Hi Henrik, > > A couple of things. Firstly, so far asI have ever heard, it's valid that a > package have hard dependencies in its tests for packages listed only in > Suggests. In fact, that is one of the stated purposes of Suggests. An > argument could be made, I suppose, that the base packages should be under > stricter guidelines, but stats isn't violating the letter or intention of > Suggests by doing this. > > > Secondly, I don't have time to dig through the make files/administration > docs, but I do know that R CMD check has --no-stop-on-error, so you can > either separately or as part of make check, use that option for stats (and > elsewhere as needed?) and just know that the stats tests that depend on > MASS are "false positive" (or, more accurately, missing value) test > results, rather than real positives, and go from there. > > You could also "patch" the tests as part of your build process. Somewhere I > worked had to do that for parts of the internet tests that were unable to > get through the firewall. > > Best, > ~G > > > > On Tue, May 4, 2021 at 1:04 PM Henrik Bengtsson <henrik.bengtsson at gmail.com> > wrote: > >> Two questions to R Core: >> >> 1. Is R designed so that 'recommended' packages are optional, or >> should that be considered uncharted territories? >> >> 2. Can such an R build/installation be validated using existing check >> methods? >> >> >> -- >> >> Dirk, it's not clear to me whether you know for sure, or you draw >> conclusions based your long experience and reading. I think it's very >> important that others don't find this thread later on and read your >> comments as if they're the "truth" (unless they are). I haven't >> re-read it from start to finish, but there are passages in 'R >> Installation and Administration' suggesting you can build and install >> R without 'recommended' packages. For example, post-installation, >> Section 'Testing an Installation' suggests you can run (after making >> sure `make install-tests`): >> >> cd tests >> ../bin/R CMD make check >> >> but they fail the same way. The passage continuous "... and other >> useful targets are test-BasePackages and test-Recommended to run tests >> of the standard and recommended packages (if installed) respectively." >> (*). So, to me that hints at 'recommended' packages are optional just >> as they're "Priority: recommended". Further down, there's also a >> mentioning of: >> >> $ R_LIBS_USER="" R --vanilla >>> Sys.setenv(LC_COLLATE = "C", LC_TIME = "C", LANGUAGE = "en") >>> tools::testInstalledPackages(scope = "base") >> >> which also produces errors when 'recommended' packages are missing, >> e.g. "Failed with error: 'there is no package called 'nlme'". >> >> (*) BTW, '../bin/R CMD make test-BasePackages' gives "make: *** No >> rule to make target 'test-BasePackages'. Stop." >> >> Thanks, >> >> /Henrik >> >> On Tue, May 4, 2021 at 12:22 PM Dirk Eddelbuettel <edd at debian.org> wrote: >>> >>> >>> On 4 May 2021 at 11:25, Henrik Bengtsson wrote: >>> | FWIW, >>> | >>> | $ ./configure --help >>> | ... >>> | --with-recommended-packages >>> | use/install recommended R packages [yes] >>> >>> Of course. But look at the verb in your Subject: no optionality _in >> testing_ there. >>> >>> You obviously need to be able to build R itself to then build the >> recommended >>> packages you need for testing. >>> >>> Dirk >>> >>> -- >>> https://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org >> >> ______________________________________________ >> R-devel at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
Dirk Eddelbuettel
2021-May-04 21:38 UTC
[Rd] Testing R build when using --without-recommended-packages?
On 4 May 2021 at 14:10, Gabriel Becker wrote: | A couple of things. Firstly, so far asI have ever heard, it's valid that a | package have hard dependencies in its tests for packages listed only in | Suggests. In fact, that is one of the stated purposes of Suggests. An | argument could be made, I suppose, that the base packages should be under | stricter guidelines, but stats isn't violating the letter or intention of | Suggests by doing this. Like Ben, I also take the other side here and point you e.g. to the extended discussion between Duncan and myself on r-package-devel (look for the thread with Subject: "winUCRT failures"). Optional packages need testing for presence before they are used, and we are slowly moving in that direction. Repeating "but that's not what we used to do" is of limited interest as things do sometimes change for the better. Dirk -- https://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org