Re: [R-pkg-devel] How to run R CMD CHECK with the installation directory set to read-only ?

2025-01-30 Thread Uwe Ligges



On 29.01.2025 18:13, Craig Gower-Page wrote:

Hi,

A package of ours had its test code throw an error during its R CMD
CHECK on CRAN due to it attempting to write files to the installation
directory. We were wondering how best to replicate this test on our
local machines as we are unable to see any direct options / flags /
hooks within R CMD CHECK that allows you to specify that the
installation directory should be set to read-only ?

 From the "Writing R extensions" manual there appears to be an option
that allows you to run R CMD CHECK on an installed package (I think
technically it is running on the source package but it suppresses the
installation step and uses the pre-installed version for running the
tests). Quoting the manual below:


It is possible to install a package and then check the installed package. To do 
so first install the package and keep a log of the installation:
R CMD INSTALL -l libdir pkg > pkg.log 2>&1
and then use
Rdev CMD check -l libdir --install=check:pkg.log pkg


This appears to do what we need in that we can first install the
package locally, set the directory to read-only with `chmod 500` and
then run R CMD CHECK using the arguments as specified above from the
manual.


Yes, or mount it read-only



HOWEVER - this approach appears to have a bug in that if the source
code doesn't have an explicit `Author` and `Maintainer` field then the
check will fail; that is to say it doesn't appear to be able to expand
the `Author@R` field when running in this mode.


First you build the package via R CMD build and then you can unpack it, 
voila.





So to summarise my questions are:

* Is my described use of Rdev CMD check -l libdir
--install=check:pkg.log pkg the correct way of using R CMD CHECK to
test if the installed package is writing to the installation directory
?


At least that is what CRAN does during its regular checks anyway.


* If not, what is the recommended way of using R CMD CHECK to catch
this (e.g. how to replicate how CRAN runs R CMD CHECK to catch this) ?
* If yes, is it regarded as a bug or not that R CMD CHECK on installed
packages only works for packages that have an explicit Author /
Maintainer field and not just a Author@R field?


It is fine, as described above. YOu always have to run R CMD build 
before checking as a package may also have build time actions (e.g. for 
the manuals) that oetherwise would not be executed.


Best,
Uwe Ligges




With regards to the potential bug with R CMD CHECK; I tested this on R
4.4.2 on Mac OS Sonoma and have uploaded a small test script to GitHub
that demonstrates it:
https://gist.github.com/gowerc/248f398f421750f7673019d1989cbe6f#file-simple_script-sh


Kind Regards

Craig Gower-Page

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Date of CRAN checks

2025-01-30 Thread Lluís Revilla
Dear Simon,

Thank you for clearing my misunderstanding about CRAN's checks.
Looking forward to seeing logs with a date (if possible).

This case  was initiated by teal.reporter, the error is related to pandoc
according to the logs:
Error: pandoc version 1.12.3 or higher is required and was not found (see
the help page ?rmarkdown::pandoc_available). Execution halted
The package imports rmarkdown (≥ 2.23) that requires pandoc.
In teal.reporter there isn't a specific requirement for pandoc version
1.12.3 (but it doesn't check the version available).

Other packages on that same flavor fail with problems related to pandoc,
for example datacutr, oldr or linevis, have similar errors.
They depend on packages that use pandoc and are also recently published.

Many thanks for your help,

Lluís

On Wed, 29 Jan 2025 at 20:08, Simon Urbanek 
wrote:

> Lluís,
>
> the timestamps are generated by the CRAN server when it updates webpage
> from the actual check reports so it does not reflect the date/time of the
> check itself (neither does the timestamp of the URL as it is often
> re-generated). So in short, no, there is no way to know the timestamp of
> the check. I think it may be useful, so I'll see if we can add it.
>
> That said, checks are not re-run unless you update the version of your
> package (or there is an error caused by another package whose update will
> fix it), so in most cases waiting won't fix anything. If there is a problem
> you have to report it to the corresponding CRAN maintainer so for macOS
> that would be me.
>
> Cheers,
> Simon
>
>
> > On Jan 30, 2025, at 5:10 AM, Lluís Revilla 
> wrote:
> >
> > Dear list,
> >
> > Recently after a package update I noticed an ERROR on one flavor.
> > I believe this is some problem with the r-release-macos-x86_64 flavor.
> > But I'm not sure if this is fixed on the system or not.
> > I was waiting to see if this got fixed with time (and thanks to the CRAN
> > volunteers).
> >
> > A check landing page on CRAN had a date "Last updated on 2025-01-29
> > 08:49:42 CET." then it changed to "2025-01-29 15:49:25 CET.". Because
> there
> > are some checks that are still from the old version of the package and
> the
> > failing check is still failing, I'm not sure which checks were updated.
> Is
> > this the date of the landing page of all the checks, or all the checks
> are
> > updated up to that date?
> >
> > Bioconductor provides the time with two fields: StartedAt and EndedAt for
> > each flavor (and step).
> > I hoped to find a date on the check logs. It would make it easier to know
> > when it is updated and it has the same result as previously.
> > Is there a way to know when a given check was run on CRAN?
> >
> > Best regards,
> >
> > Lluís
> >
> > PS:  The problem is shared by many packages (>50), the vignette can be
> > built but not rebuilt and it raises an error message about not finding
> > pandoc.
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >
>
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel