[Rd] running 'make' failed during vignette creation ('R CMD build') on Windows

Hervé Pagès hpages at fhcrc.org
Thu Sep 16 08:33:58 CEST 2010


I think I found the problem. During the recent transition from
Perl-based to R-based 'R CMD check/build', the rcmdfn() function
in src/gnuwin32/front-ends/rcmdfn.c has been hacked quite a bit.
This function gets called right after the R front-end is started
and its main purpose is to process the user arguments passed to
the front-end and to fire the appropriate subprocess.
This function also calls process_Renviron() for putting the
variables defined in ${R_HOME}/etc/rcmd_environ into the
environment of the front-end process.

Problem: before revision 52153

   this code
             ...
             } else if (strcmp(p, "build") == 0) {
                 snprintf(cmd, CMD_LEN, "perl %s/bin/build.pl", RHome);
             } ...

   was *after* this line

             process_Renviron(env_path);

But starting with rev 52153, it was moved *before* the call to
process_Renviron() (and also modified to handle Rcmd build
internally). The new code looks more complicated:

     ...
     } else if (cmdarg > 0 && argc > cmdarg &&
               strcmp(argv[cmdarg], "build") == 0) {
         /* handle Rcmd build internally */
         snprintf(cmd, CMD_LEN,
                  "%s/%s/Rterm.exe -e tools:::.build_packages() 
R_DEFAULT_PACKAGES= LC_COLLATE=C --no-restore --slave --args ",
                  getRHOME(3), BINDIR);
         for (i = cmdarg + 1; i < argc; i++) {
             strcat(cmd, "nextArg");
             if (strlen(cmd) + strlen(argv[i]) > 9900) {
                 fprintf(stderr, "command line too long\n");
                 return(27);
             }
             strcat(cmd, argv[i]);
         }
         status = system(cmd);
         return(status);
     } else {
     ...

but basically, it still fires a subprocess and then the function
returns. process_Renviron() was not called so the subprocess
doesn't see those environment variables anymore.

Then the same happened to 'R CMD build' (rev 52245), and to many
other 'R CMD things': their corresponding code chunks in rcmdfn()
went moved up one by one to end up before the call to
process_Renviron(). So none of the 'R CMD' subcommands sees
the environment variables that they used to see anymore. Only
a normal 'R' command still gets them.

Cheers,
H.


On 09/15/2010 04:55 PM, Hervé Pagès wrote:
> Hi,
>
> This is a follow-up to the problem reported here:
>
> https://stat.ethz.ch/pipermail/r-devel/2010-September/058460.html
>
> After I updated R-2.12 to 2010-09-13 r52905 on the Bioc build system,
> some of the packages that have a Makefile in <pkg>/inst/doc still
> don't build on Windows. For example, 'R\bin\R.exe CMD build adSplit'
> gives:
>
> * checking for file 'adSplit/DESCRIPTION' ... OK
> * preparing 'adSplit':
> * checking DESCRIPTION meta-information ... OK
> * cleaning src
> * installing the package to re-build vignettes
> * creating vignettes ... ERROR
> Loading required package: Biobase
>
> Welcome to Bioconductor
>
> Vignettes contain introductory material. To view, type
> 'openVignette()'. To cite Bioconductor, see
> 'citation("Biobase")' and for packages 'citation(pkgname)'.
>
> Loading required package: DBI
> Loading required package: hu6800.db
> Loading required package: AnnotationDbi
> Loading required package: org.Hs.eg.db
> determining 1000 random DLD-scores with 20 probe sets each (wait for 10
> dots)
> ..........
> epstopdf splitSet.eps
> pdflatex tr_2005_02
> This is pdfTeX, Version 3.1415926-1.40.9 (MiKTeX 2.7)
> entering extended mode
> (tr_2005_02.tex
> LaTeX2e <2009/09/24>
> Babel <v3.8l> and hyphenation patterns for english, dumylang,
> nohyphenation, ge
> rman, ngerman, french, loaded.
> ("C:\Program Files\MiKTeX 2.7\tex\latex\base\report.cls"
> Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
> ("C:\Program Files\MiKTeX 2.7\tex\latex\base\size11.clo")) (compdiag.sty
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\ifpdf.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\graphics\graphicx.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\latex\graphics\keyval.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\graphics\graphics.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\latex\graphics\trig.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\00miktex\graphics.cfg")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\pdftex-def\pdftex.def")))
> ("C:\Program Files\MiKTeX 2.7\tex\latex\graphics\color.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\latex\00miktex\color.cfg"))
> ("C:\Program Files\MiKTeX 2.7\tex\latex\hyperref\hyperref.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\ltxcmds.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\kvsetkeys.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\infwarerr.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\etexcmds.sty"))
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\pdfescape.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\pdftexcmds.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\ifluatex.sty")))
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\ifvtex.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\ifxetex\ifxetex.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\oberdiek\hycolor.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\latex\oberdiek\xcolor-patch.sty"))
> ("C:\Program Files\MiKTeX 2.7\tex\latex\oberdiek\letltxmacro.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\hyperref\pd1enc.def")
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\intcalc.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\00miktex\hyperref.cfg")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\oberdiek\kvoptions.sty")
> Implicit mode ON; LaTeX internals redefined
> ("C:\Program Files\MiKTeX 2.7\tex\latex\ltxmisc\url.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\bitset.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\bigintcalc.sty"))
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\atbegshi.sty"))
> * hyperref using driver hpdftex *
> ("C:\Program Files\MiKTeX 2.7\tex\latex\hyperref\hpdftex.def"
> ("C:\Program Files\MiKTeX 2.7\tex\latex\oberdiek\atveryend.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\oberdiek\rerunfilecheck.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\generic\oberdiek\uniquecounter.sty")))
> ("C:\Program Files\MiKTeX 2.7\tex\latex\ntgclass\a4.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\geometry\geometry.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\latex\geometry\geometry.cfg"))
> ("C:\Program Files\MiKTeX 2.7\tex\latex\tools\theorem.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\latex\tools\thp.sty"))
> ("C:\Program Files\MiKTeX 2.7\tex\latex\tools\thb.sty"))
> ("C:\Program Files\MiKTeX 2.7\tex\latex\ams\math\amsmath.sty"
> For additional information on amsmath, use the `?' option.
> ("C:\Program Files\MiKTeX 2.7\tex\latex\ams\math\amstext.sty"
> ("C:\Program Files\MiKTeX 2.7\tex\latex\ams\math\amsgen.sty"))
> ("C:\Program Files\MiKTeX 2.7\tex\latex\ams\math\amsbsy.sty")
> ("C:\Program Files\MiKTeX 2.7\tex\latex\ams\math\amsopn.sty"))
>
> ! LaTeX Error: File `Sweave.sty' not found.
>
> Type X to quit or <RETURN> to proceed,
> or enter new name. (Default extension: sty)
>
> Enter file name:
> ! Emergency stop.
> <read *>
>
> l.39 \begin
> {document}
> ! ==> Fatal error occurred, no output PDF file produced!
> Transcript written on tr_2005_02.log.
> make: *** [pdf] Error 1
> Error in tools::buildVignettes(dir = ".") : running 'make' failed
> Execution halted
>
> What's different though with this updated R, it that now I get an
> error instead of a timeout. Maybe the code that fires the R subprocess
> in charge of running tools::buildVignettes() now does better error
> checking/handling, I don't know (it seems to have changed between
> the 2 versions of R).
>
> A new mystery is why the tilingArray package now does build on
> Windows (it was timing out with the previous version of R).
> I already sent the content of adSplit/inst/doc/Makefile
> in the previous thread and tilingArray does nothing different:
>
> all: findsegments costMatrix assessNorm segmentation plotAlongChrom clean
>
> findsegments: findsegments.tex
> pdflatex findsegments
> pdflatex findsegments
>
> costMatrix: costMatrix.tex
> pdflatex costMatrix
> pdflatex costMatrix
>
> assessNorm: assessNorm.tex
> cp -p ../scripts/assessNorm.pdf .
>
> segmentation: segmentation.tex
> cp -p ../scripts/segmentation.pdf .
>
> plotAlongChrom: plotAlongChrom.tex
> pdflatex plotAlongChrom
> pdflatex plotAlongChrom
> clean:
> rm -f *.out *.bbl *.log *.aux *.blg *.brf *.toc *.tex
> rm -f *.dvi *.ps findsegments-* costMatrix-* plotAlongChrom-* Rplots.pdf
>
> Another thing that is really puzzling is that if I cd to
> adSplit/inst/doc and run 'R CMD make' then it works.
>
> Any help/comment on this will be highly appreciated.
>
> Thanks,
> H.
>
>


-- 
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