[Rd] Building Packages on Windows using .Rbuildignore (PR#7379)

murdoch at stats.uwo.ca murdoch at stats.uwo.ca
Fri Nov 19 22:22:02 CET 2004

On Thu, 18 Nov 2004 16:36:03 +0100 (CET), murdoch at stats.uwo.ca wrote :

>>The reason that the processing is different according to whether one
>>uses .Rbuildignore or not is that 
>>  R CMD build 
>>takes the .Rbuildignore file into account but 
>>  R CMD install
>>  R CMD check
>>  R CMD build --binary 
>>do not take .Rbuildignore into account.  
>Okay, now I understand.  I think I'd call the last of those a bug, and
>it would seem to me that the install and check scripts should also
>respect this directive.   I've now copied this to the r-bugs list.
>(This was reported for Windows; I don't know if it applies to other
>platforms as well.)

I've taken a look at the source now, and it appears that the intention
is that R CMD check should respect the .Rbuildignore file, but (on my
system) it's looking for it in the wrong place:  it looks in the
parent of the package directory, not in the main package directory.
That is, if I have a package in subdirectory test, then 

Rcmd build test

looks for test/.Rbuildignore as it should, but 

Rcmd check test

looks for .Rbuildignore.  The problem is in these lines of code:

    my $exclude_file = ".Rbuildignore";
    ## This is a bit tricky for bundles where the build ignore pattern
    ## file is in the top-level bundle dir.
    $exclude_file = &file_path(dirname($pkgdir), $exclude_file);

In my test, $pkgdir was "d:/stuff/R/test", and $exclude_file ended up
as "d:/stuff/R/.Rbuildignore".

Could someone on Unix confirm this behaviour?  I think the fix should
be to change the last line to 

    $exclude_file = &file_path($pkgdir, $exclude_file);

but I don't want to mess things up on other platforms.

Even with this change, Rcmd check is still going to install the files
it's supposed to ignore, because it uses Rcmd INSTALL, and there's no
.Rbuildignore support there.

Duncan Murdoch

More information about the R-devel mailing list