[Rd] Lack of consistent cross-platform behaviour of tools:::buildVignettes()

Hervé Pagès hpages at fhcrc.org
Sat Sep 25 09:30:28 CEST 2010


Hi,

In current R-alpha (r52991), consistent cross-platform behavior
has been restored, thanks!
That is, on both Unix and Windows, ${R_HOME}/bin/R doesn't add
variables to the environment, but ${R_HOME}/bin/R CMD does.

Is there any reason why ${R_HOME}/bin/R couldn't add those variables
to the environment too (on both platforms of course) so the code
in the examples and vignettes that is run during R CMD check
sees the same environment as if run interactively?

The example I gave below with buildVignettes() is a situation where
it runs fine if run by 'R CMD check' but fails if run interactively.

Thanks!
H.


On 09/15/2010 09:54 PM, Hervé Pagès wrote:
> Hi,
>
> On both Unix and Windows there is a mechanism to add variables
> to the environment when R is started. I noticed that, on Unix,
> this mechanism is not used when R is started normally at the
> command line but only when it's started using the 'R CMD' syntax.
> One problem with this is some lack of consistent cross-platform
> behaviour. For example:
>
> On Linux:
>
> $ echo $TEXINPUTS
>
> $ echo "Sys.getenv('TEXINPUTS')" | R --slave
> TEXINPUTS
> ""
> But on Windows:
>
> E:\tmp>echo %TEXINPUTS%
> %TEXINPUTS%
> E:\tmp>echo Sys.getenv("TEXINPUTS") | R\bin\R.exe --slave
> TEXINPUTS
> ".;;E:/biocbld/bbs-2.7-bioc/R/share/texmf/tex/latex;"
>
> So on Linux if I cd to the inst/doc folder of a package source tree
> that has a Makefile and run
>
> echo "tools:::buildVignettes('pkgname', '.')" | R --slave
>
> it fails with error:
>
> ! LaTeX Error: File `Sweave.sty' not found.
>
> while doing the same thing on Windows works.
>
> Is there any reason for not setting the environments variables
> that are defined in ${R_HOME}/bin/Rcmd (the shell script wrapper
> for all R CMD commands) when R is started normally?
>
> Thanks,
> H.
>
> BTW, I found this (on both, Unix and Windows):
>
> $ echo "Sys.getenv('TEXINPUTS')" | R
> Fatal error: you must specify '--save', '--no-save' or '--vanilla'
>
> What about --slave? Thanks!
>
>


-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the R-devel mailing list