Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R-package] [ci] restore R 3.6 Windows cran CI job (fixes #5036) #5479

Merged
merged 1 commit into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/r_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ jobs:
###############
# CRAN builds #
###############
- os: windows-latest
task: r-package
compiler: MINGW
toolchain: MINGW
r_version: 3.6
build_type: cran
- os: windows-latest
task: r-package
compiler: MINGW
Expand Down
44 changes: 26 additions & 18 deletions build-cran-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,25 +199,33 @@ if ${BUILD_VIGNETTES} ; then

echo "untarring ${TARBALL_NAME}"
cd _tmp
tar -xvf "${TARBALL_NAME}" > /dev/null 2>&1
rm -rf "${TARBALL_NAME}"
tar -xf "${TARBALL_NAME}" > /dev/null 2>&1
rm -f "${TARBALL_NAME}"
echo "done untarring ${TARBALL_NAME}"

# Object files are left behind from compiling the library to generate vignettes.
# Approaches like using tar --exclude=*.so to exclude them are not portable
# (for example, don't work with some versions of tar on Windows).
#
# Removing them manually here removes the need to use tar --exclude.
#
# For background, see https://github.com/microsoft/LightGBM/pull/3946#pullrequestreview-799415812.
rm -f ./lightgbm/src/*.o
rm -f ./lightgbm/src/boosting/*.o
rm -f ./lightgbm/src/io/*.o
rm -f ./lightgbm/src/metric/*.o
rm -f ./lightgbm/src/network/*.o
rm -f ./lightgbm/src/objective/*.o
rm -f ./lightgbm/src/treelearner/*.o

echo "re-tarring ${TARBALL_NAME}"
tar \
-cz \
-f "${TARBALL_NAME}" \
lightgbm \
> /dev/null 2>&1
mv "${TARBALL_NAME}" ../
cd ..
echo "done untarring ${TARBALL_NAME}"

echo "re-tarring ${TARBALL_NAME}"
tar \
-czv \
-C ./_tmp \
--exclude=*.a \
--exclude=*.dll \
--exclude=*.o \
--exclude=*.so \
--exclude=*.tar.gz \
--exclude=**/conftest.c \
--exclude=**/conftest.exe \
-f "${TARBALL_NAME}" \
lightgbm \
> /dev/null 2>&1
echo "Done creating ${TARBALL_NAME}"

rm -rf ./_tmp
Expand Down