[R-package] [ci] restore R 3.6 Windows cran CI job (fixes #5036) #5479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #5036.
Replaces #5037.
Changes in this PR
build-cran-package.sh
:tar --exclude
with simplyrm
-ing the excluded files prior to re-tarring the source distribution-f
inrm
commands deleting files (not directories), for safety-v
intar
commands whose output is suppressed anyway by redirection to/dev/null
tar -C
, instead just relying on directory traversal withcd
Description
CRAN-style builds of the R package have not been tested against R 3.6 on Windows for the last 7 months. This PR restores the CI job testing that support.
I used #5037 to experiment with different approaches and to try to find a root cause for why this job started failing. I discovered that the root issue is related to conflicting versions of the
tar
utility. As described in the R documentation for?tar
(link)This only matters to
{lightgbm}
because its build script,build-cran-package.sh
, requires a workaround for R not cleaning up.o
files produced when the library is compiled to build vignettes (see #3946 (review)). That workaround requires untarring and carefully re-tarring a source distribution built byR CMD build
.This PR removes uses of less-likely-to-be-portable
tar
features in that build script, like-C
and--exclude
, to make failures like the one from #5036 less likely...in CI and for LightGBM's users.