Thanks for the push @jeroen@native-api I think this will fix all pure R package installations, but could still leave BiocCheck broken or any other package with executables, which is needed to check any Bioconductor package.
begin installing package ‘BiocCheck’
* installing *source* package ‘BiocCheck’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Failed to copy the script/BiocCheck or script/BiocCheckGitClone script
to /opt/R/4.0.2/lib/R/bin. If you want to be able to run 'R CMD
BiocCheck' you'll need to copy it yourself to a directory on your PATH,
making sure it is executable. See the BiocCheck vignette for more
information.
** testing if installed package can be loaded from final location
Failed to copy the script/BiocCheck or script/BiocCheckGitClone script
to /opt/R/4.0.2/lib/R/bin. If you want to be able to run 'R CMD
BiocCheck' you'll need to copy it yourself to a directory on your PATH,
making sure it is executable. See the BiocCheck vignette for more
information.
** testing if installed package keeps a record of temporary installation path
* DONE (BiocCheck)
Hi all
not sure what I do wrong, but for me it does not look fixed completely.
I have setup a test repo with a plain R package and some tests. But as already mentioned it still fails to install BiocCheck’s executable. Hence I can not run BiocCheck.
In addition, somehow it does not install nor configure bioconductor if using bioc-release.
It gets installed by this command which should not happen as it should be configured in at least bioc-release and bioc-devel or?:
R -e 'if(!requireNamespace("BiocManager")) install.packages("BiocManager")'
@richelbilderbeek thanks for the link. It looks like you just use Bioconductor packages but do not use BiocCheck to test your package. Hence you do not run into this problem.
So the copying of the executable is still a problem, also for potential other packages.
At least I found a workaround for BiocCheck.
# instead of using R CMD (fails)
R CMD BiocCheck *tar.gz
# use BiocCheck as package within R on the source directory (works)
R -e 'BiocCheck::BiocCheck(".")
The first fails as it searches for the BiocCheck executable usually installed into $R_HOME/lib/R/bin/BiocCheck which is a wrapper script to call BiocCheck::BiocCheck() within R. This is essentially the second approach which works.
This is because you override install: where this logic currently is.
@jeroen@jimhester In this light, I believe the Bioconductor and packages installation should be at the setup phase while install: proper should only contain DESCRIPTION-based parts:
Travis allows you to run sudo command, so if you really want to mess with the installation, I guess you can do:
sudo R CMD BiocCheck *tar.gz
But I think it is bad practice to modify the R installation when running checks. So if you can make it work with R -e 'BiocCheck::BiocCheck(".") that seems much better to me.
@jeroen Since R doesn’t have a per-user directory for scripts to complement R_LIBS_USER, this is a problem of not Travis but rather of R and/or r Apt package maintainers. So we have to roll with its Linux-unfriendly design decision until that changes.
I see a few options here (in the order of preference):
We can allow travis to create new files in $R_HOME/bin while disallowing messing with existing ones:
Then Rscript -e 'BiocManager::install("BiocCheck")' installs scripts successfully, as would other packages with scripts. It will complain about not being able to update a few packages in /opt.
Then its installation succeeds, and it reports a few outdated packages in /opt (without complaining about not being able to update them but still not actually updating). But installation of any other package with scripts would fail. Also any possible later attempt to manage the BiocCheck installation as travis would fail.
We can copy the scripts into $R_HOME/bin manually:
If none of the above is used, we must document that scripts are not supported, and any package that uses them, including BiocCheck, will either fail to install or will install without scripts and must be used some other way (as BiocCheck currently does).
thanks. I figured this out after looking at the code. I think your changes make more then sense. So the user still can change something in the install while using the travis logic to install R/bioc packages too.
But BiocCheck is only installed by the stock logic if there’s bioc_check: true specified – and in this case, it’s then called via Rscript by the stock logic, too.
So to “special case it so that R CMD BiocCheck works” is impossible because the filesystem cannot distinguish whether it’s BiocCheck installation trying to write to $R_HOME/bin or something else.