[Bioc-devel] How to recreate R CMD BUILD environment in interactive session?

Martin Morgan martin.morgan at roswellpark.org
Mon Oct 23 15:57:40 CEST 2017


On 10/23/2017 09:47 AM, Martin Morgan wrote:
> On 10/23/2017 09:26 AM, Elizabeth Purdom wrote:
>> Hello,
>>
>> I am updating an existing package and I am getting an error in running 
>> my vignette (and a similar error in an example in help pages) but ONLY 
>> when I run R CMD BUILD. I can’t recreate the error in any session 
>> where I can debug and figure out what is happening. So my question is 
>> how can I recreate the exact environment of R CMD BUILD that runs the 
>> vignette but in an interactive session so that I can figure out what 
>> is going on?
>>
>> I have tried reproducing the error in other environments:
>>
>> * Running R —vanilla interactively and trying the code manually
>> * running purl on my vignette to get pure R code and running just the 
>> R code with R CMD BATCH —vanilla
> 
> hint on the specific package and / or error message?
> 
> My approach would be to install the package, Stangle / purl the 
> vignette, and R -f vignette.R, then trim the vignette to a fast 
> reproducible case. But it sounds like you're doing that...

A little bit more helpfully, at least on Linux R CMD build evaluates the 
script R_HOME/bin/build, which launches R as

echo 'tools:::.build_packages()' | R_DEFAULT_PACKAGES= LC_COLLATE=C 
"${R_HOME}/bin/R" --no-restore --slave --args ${args}

It's actually very tedious to figure out how the R process that builds 
the vignette is launched.

Martin

> 
> Martin
> 
>> * Running R —vanilla interactively and compiling the vignette
>>
>> But all of the above runs the code without any error.
>>
>> Furthermore, for some reason TravisCI can build the package without 
>> problem nor does it hit any error in R CMD CHECK with TravisCI so for 
>> a long time I assumed it was some local file or environment on my 
>> machine and forgot about it. But now that I have pushed the changes to 
>> Bioconductor, they are getting the same error about the vignette not 
>> building.
>>
>> By the way, I can’t slowly take back my commands to see what broke it, 
>> because the change was a dramatic one involving redefining my S4 
>> class, so a large number of things had to be adapted before any code 
>> would work and there’s no way to slowly roll that back.
>>
>> Most of the posts I have seen about debugging discrepancies between R 
>> CMD BUILD (or equivalently R CMD CHECK) seem to be about namespace 
>> issues with other packages. Of course I can’t be sure since I have a 
>> pretty terse error from R CMD BUILD, but the error that is given is my 
>> own error (it’s a check I wrote as part of the validity check when I 
>> updated the class) so it seems unclear how it would be a namespace error.
>>
>> Thanks for any suggestions,
>> Elizabeth Purdom
>> _______________________________________________
>> Bioc-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
> 
> 
> This email message may contain legally privileged and/or...{{dropped:2}}
> 
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel


This email message may contain legally privileged and/or...{{dropped:2}}



More information about the Bioc-devel mailing list