Skip to content

Vignette pdfs missing from zip file after Rcmd build --binary call

3 messages · Eli Holmes, Simon Urbanek

#
Hi,

I have been building R packages for awhile on Windows, and I recently
upgraded R and all required package creation tools to 2.13.0.  I
understand that there have been changes in that the R CMD build
command no longer alters the source directory, cf comments in
http://tolstoy.newcastle.edu.au/R/e13/help/11/04/10379.html
For example, if I issue the command Rcmd build FOO, then directory FOO
is not altered in contrast to earlier R versions where vignette pdfs
would be added to the source directory FOO.

I have no problem creating the FOO.tar.gz file, and it has the
vignette pdfs in the inst/doc as usual.   The problem is the .zip file
that I create for Windows users.  In earlier versions of R, this .zip
file had the newly created vignette pdfs but now it does not.  Here is
what I see:

source FOO:
inst/doc
foo.Rnw

FOO.tar.gz   (after Rcmd build FOO)
inst/doc
foo.pdf
foo.Rnw

FOO.zip (after Rcmd build --binary FOO or R CMD install --build FOO)
inst/doc
foo.Rnw

Yes, I can manually move the pdf files from the tar.gz directory to
the zip directory, but there are many and I am liable to make
mistakes.

I suppose I could unzip the tar.gz file and then make a temporary
source file FOOtmp and run Rcmd build --binary FOOtmp, but I am hoping
there is an easier way.

Things I have tried unsuccessful
 I tried using the tar.gz file as the source
Rcmd build --binary FOO.tar.gz   (got error)
R CMD install --build FOO.tar.gz (same error)

I tried using some of the options for R CMD install:
--force-multiarch  and --merge-multiarch.  No change.

Any ideas?

Thanks!
#
On Jul 7, 2011, at 3:39 AM, Eli Holmes wrote:

            
It sort of defeats the purpose to create a tar ball and then not use it ;)
That is indeed  the usual way.
Can you be more specific as of what errors you get?  It may point to issues in the your package. Also the command is R CMD INSTALL not install.

Cheers,
Simon
#
Thanks for the reply.  In a round about way, it helped me figure out
how to solve the problem.   I had always called Rcmd build --binary
first to make a zip file for windows users and in <2.11.0 this command
added all the vignette pdfs to the source directory, and then I called
Rcmd build --no-vignettes to prepare the tar.gz file.  This made me
realize that someone on a unix machine would not build the tar.gz file
this way, and I should follow a more unix-like build sequence.

For the sake of documenting my solution, here's my responses and how
they led to my solution.  Note, I'm buildiing packages on a windows
machine.
??  I do use it.  The unix and mac users download the tar.gz file to
install the package.  I create windows binaries for windows users.
In the past, I created the zip file from the source directory not the
tar.gz built from the source directory using the command Rcmd build
--binary FOO, where FOO is the source directory.  BTW, I know the
tar.gz file build on a windows machine is not perfect for mac/unix
users; this is just for development in a small group with mac and
windows users.

I've been building packages for years with 2.11.0 and below, but
something has changed in 2.13.0 in how vignette pdfs are being
transferred to the package zip files.
Sorry I meant to capitalize 'install'.  I do call it that way.
The error I got was
Warning: invalid package 'FOO.tar.gz'
Error: ERROR: no package specified

I assumed the error had to do with a tar.gz file not being a valid
'target' for Rcmd build.  I have never seen a tar.gz file used in a
Rcmd build call before.  But your comment suggested that FOO.tar.gz
should work, and on closer inspection, I realized I had misspelled the
filename.   Once I fixed that, R CMD install --build FOO.tar.gz worked
and built the zip file.
cannot change to directory 'FOO.tar.gz'  (ok, I just won't use that)
Once I got here, I realized I could just build the zip file using 'R
CMD INSTALL --build FOO.tar.gz' as appeared to be intended.  But on
closer inspection, my tar.gz file also appeared to be missing some of
the vignette pdfs in a package that included a makefile in inst/doc.
It turned out that this file did not have the line 'texi2dvi --pdf
*.tex' to create pdfs from all the tex files after Rcmd's sweave call
before it called the makefile.  In R 2.11.0, these pdfs were being
added to the source directory by the call 'Rcmd build --binary' .   I
never ran 'Rcmd build' first so never noticed that the tar.gz file
from 'Rcmd build' would be missing vignette pdfs.

I added the line texi2dvi --pdf *.tex' to the makefile and everything
seems ok now.  So my new steps for building unix and windows packages
is the following:

Rcmd build FOO (build the tar.gz file)
R CMD INSTALL --build FOO.tar.gz  (build the windows binaries; I'm
doing this on a windows machine btw).

Again, thanks!

--Eli