You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find it useful to build/check package using only the changes in the git tree (committed and/or staged). Current build/check functions use all of the files in the package directory. These leads to a number of artifacts, like uncommitted files revealed at remote CI/CD stage, or R CMD build copying a lot of big and unnecessary files (see #2323 or r-lib/pkgbuild#59).
My current approach is to have a separate directory where the repository is checked out and no work is done, but it also not that great for many reasons.
The ideal solution would be a mix of what remotes::install_git and pkgbuild::build does. I'm not sure how to include staged changes, but it's not that necessary, as I can always make a commit and amend it in the process.
The text was updated successfully, but these errors were encountered:
You've linked to issues that capture the problem, which comes from base R itself. To summarize that, for some reason base R copies everything and then applies .Rbuildignore, which has lots of downsides. (BTW, you are using .Rbuildignore, yes?)
Have you tried telling pkgbuild::build() about your desired copy strategy?
This is the feature that closed r-lib/pkgbuild#59 which you link to.
In any case, within the devtools world, anything we might do around this would actually happen in pkgbuild or rcmdcheck. devtools::check() is a user-friendly wrapper around those packages.
The issues I'm referenced correspond to just one aspect of what I'm talking about. Setting copy strategy to link does resolve problem of copying large files (although only on non-Windows machines).
It does not resolve the problem of uncommitted files being copied as well. It's not uncommon for me to realize I forgot to commit a file only after the CI/CD reports failure, even though I did successfully run the check locally beforehand. Having the build/check to checkout the actual git tree, before running the R CMD build command will make sure that only committed files are used to build the package. It will involve another round of copying files, but supposedly the actual code base is usually pretty small.
Going further, devtools::test() could also benefit from this, to have a mode for the package to be run from temp directory with only committed files.
I find it useful to build/check package using only the changes in the git tree (committed and/or staged). Current build/check functions use all of the files in the package directory. These leads to a number of artifacts, like uncommitted files revealed at remote CI/CD stage, or R CMD build copying a lot of big and unnecessary files (see #2323 or r-lib/pkgbuild#59).
My current approach is to have a separate directory where the repository is checked out and no work is done, but it also not that great for many reasons.
The ideal solution would be a mix of what
remotes::install_git
andpkgbuild::build
does. I'm not sure how to include staged changes, but it's not that necessary, as I can always make a commit and amend it in the process.The text was updated successfully, but these errors were encountered: