Bug 7379 - Re: [Rd] Building Packages on Windows using .Rbuildignore
Summary: Re: [Rd] Building Packages on Windows using .Rbuildignore
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Installation (show other bugs)
Version: old
Hardware: All Other
: P5 normal
Assignee: Jitterbug compatibility account
URL:
Depends on:
Blocks:
 
Reported: 2004-11-18 21:35 UTC by Jitterbug compatibility account
Modified: 2004-11-19 00:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2004-11-18 21:35:12 UTC
From: Duncan Murdoch <murdoch@stats.uwo.ca>
On Thu, 18 Nov 2004 00:38:47 +0000 (UTC), Gabor Grothendieck
<ggrothendieck@myway.com> wrote :

>DIFFERENCE BETWEEN USING .RBUILDIGNORE AND NOT
>
>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.)

Just for clarification:  I can see you would use this when you have
S-PLUS code in the same directory as R code, and you don't want to
include that in an R build.  Are there other files that must be
excluded?

Duncan Murdoch

Comment 1 Jitterbug compatibility account 2004-11-18 23:24:54 UTC
From: Paul Gilbert <pgilbert@bank-banque-canada.ca>
murdoch@stats.uwo.ca wrote:

> On Thu, 18 Nov 2004 00:38:47 +0000 (UTC), Gabor Grothendieck
> <ggrothendieck@myway.com> wrote :
> 
> 
>>DIFFERENCE BETWEEN USING .RBUILDIGNORE AND NOT
>>
>>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.)
> 
> Just for clarification:  I can see you would use this when you have
> S-PLUS code in the same directory as R code, and you don't want to
> include that in an R build.  Are there other files that must be
> excluded?

I'm not sure if you meant this as a Windows question. On Unix/Linux:
CVS for sure, and if you run things in you source directly and 
occassionaly get core dumps then it is pretty import to ignore them or 
you get very large packages. (Yes it would be better to clean up.) I 
also ignore several files that get generate compiling src code, or in 
some cases files that generate things that are included (For example, I 
generate man from a mansrc directory.) My  .Rbuildignore is

^Makefile$
(^|.*/)core$
(^|.*/)run$
(^|.*/)zot$
CVS
(^|.*/)/CVS$
(^|.*/)/(^|.*/)/CVS$
TMP$
FLAGS$
mansrc$
guidesrc$
zot$
run$
inst/doc/(^|.*)\.tex$
inst/doc/(^|.*)\.R$
inst/doc/(^|.*)\.log$
inst/doc/(^|.*)\.stdout$
exec/(^|.*)\.pro
exec/getpadi
exec/putpadi
exec/objectinfo
exec/padi_simple_svc
exec/getpwuid
exec/x11arima
exec/(^|.*)server.log.(^|.*)
data/create

Paul Gilbert
> 
> Duncan Murdoch
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 

Comment 2 Jitterbug compatibility account 2004-11-19 00:32:25 UTC
From: Martin Maechler <maechler@stat.math.ethz.ch>
>>>>> "Duncan" == Duncan Murdoch <murdoch@stats.uwo.ca>
>>>>>     on Thu, 18 Nov 2004 16:36:03 +0100 (CET) writes:

    Duncan> On Thu, 18 Nov 2004 00:38:47 +0000 (UTC), Gabor
    Duncan> Grothendieck <ggrothendieck@myway.com> wrote :

    >> DIFFERENCE BETWEEN USING .RBUILDIGNORE AND NOT
    >> 
    >> 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.

    Duncan> Okay, now I understand.  I think I'd call the last
    Duncan> of those a bug, and it would seem to me that the
    Duncan> install and check scripts should also respect this
    Duncan> directive.  I've now copied this to the r-bugs list.

    Duncan> (This was reported for Windows; I don't know if it
    Duncan> applies to other platforms as well.)

Yes it does (*), but I think it is NOT a bug but a feature,
at least for "check" and "install" (*) 
and very much desired in some cases :

For instance, the package developer may want more
regression tests in <Pkg>/tests/ :

1) Have extra *.Rout.save files that are architecture
   dependent and hence not for general distribution of the
   package, but important for the package developer in order to
   assure that functionality doesn't change when the package is
   extended, reorganized, ....

2) Have more  tests/*.R  files  that take a long time to run.
   Time that the package developer wants to spend, but doesn't
   dare to put on the daily CRAN or Bioconductor test suites.

3) similarly for vignettes

4) similar issues for experimental  R/*.R files  or man/*.Rd
   files for these.

One I thing that would be quite useful and would even solve
Gabor's problem: 
The introduction of a new command line switch, say "--build-ignore",
to the commands 'R CMD check' and 'R CMD install'

--------

(*) I do agree that  "R CMD build --binary" probably really should
    follow the ".Rbuildignore" file ``directives'' if it doesn't
    currently.

Martin

Comment 3 Jitterbug compatibility account 2004-11-20 03:21:45 UTC
From: Duncan Murdoch <murdoch@stats.uwo.ca>
On Thu, 18 Nov 2004 16:36:03 +0100 (CET), murdoch@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

Comment 4 Jitterbug compatibility account 2004-11-30 14:53:00 UTC
NOTES:
 Not to do with Windows specifically,
but in R CMD build --binary
Comment 5 Jitterbug compatibility account 2004-11-30 15:51:25 UTC
Audit (from Jitterbug):
Tue Nov 30 09:51:25 2004	ripley	changed notes
Tue Nov 30 09:51:25 2004	ripley	moved from incoming to Installation