Hervé Pagès
2010-Sep-16 04:54 UTC
[Rd] Lack of consistent cross-platform behaviour of tools:::buildVignettes()
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
Hervé Pagès
2010-Sep-25 07:30 UTC
[Rd] Lack of consistent cross-platform behaviour of tools:::buildVignettes()
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
Possibly Parallel Threads
- R_HOME path getting munged in inst/doc/Makefile on Windows
- Question on trying to build R 2.11.1 on Tru64(aka OSF1)
- Problem with "R CMD Rd2dvi": Rd.sty not found
- R_SHARE_DIR not defined for use in tests/Makefile running under Windows
- Install packages to non-default lib on Windows