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

WIP: [ci] fix R 3.6 Windows build (fixes #5036) #5037

Closed
wants to merge 28 commits into from

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Feb 28, 2022

Attempting to investigate #5036.

First, I'm pushing a commit just re-running all the R CI to see if the same error shows up.

After that, I'll start investigating to try to find the root cause of new failures, like making logs more verbose.
This might be a slow process involving a lot of just printing this to logs, since https://github.com/nelsonjchen/reverse-rdp-windows-github-actions is no longer available.

@jameslamb
Copy link
Collaborator Author

I see the same error on https://github.com/microsoft/LightGBM/runs/5353387904?check_suite_focus=true as reported in #5036.

Pushed e93cb85, adding more logs to try to understand what happened.

@jameslamb jameslamb mentioned this pull request Feb 28, 2022
@jameslamb
Copy link
Collaborator Author

I think that we have tar issues again with Windows builds. See the third item in #3946 (review) for context.

In the logs for the most recent build (link), I see the following

removing object files created by vignettes
untarring lightgbm_3.3.2.99.tar.gz
done untarring lightgbm_3.3.2.99.tar.gz
re-tarring lightgbm_3.3.2.99.tar.gz
Running R CMD check
* using log directory 'C:/tmp-r-cmd-check/lightgbm.Rcheck'

Note that the line "Done creating lightgbm_3.3.2.99.tar.gz" from that section of build-cran-package.sh is not shown.

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}"

I just pushed 2c0e362 to try printing the locations of tar, gzip, and gunzip.

That commit also reverts e93cb85... I realize now that e93cb85 wouldn't have helped anyway, since it only affects CMake-based builds and the problem is related to CRAN builds.

@jameslamb
Copy link
Collaborator Author

try printing the locations of tar, gzip, and gunzip.

For the failing R 3.6 CRAN build (link), I see

--- location of tar ---
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     tar.exe                                            0.0.0.0    C:\Rtools\bin\tar.exe
--- location of gzip ---
Application     gzip.exe                                           0.0.0.0    C:\msys64\usr\bin\gzip.exe
--- location of gunzip ---
Application     gunzip                                             0.0.0.0    C:\msys64\usr\bin\gunzip

For the succeeding R 4.x CRAN build (link), I see that all three utilities are coming from Rtools

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     tar.exe                                            0.0.0.0    C:\rtools40\usr\bin\tar.exe
--- location of gzip ---
Application     gzip.exe                                           0.0.0.0    C:\rtools40\usr\bin\gzip.exe
--- location of gunzip ---
Application     gunzip                                             0.0.0.0    C:\rtools40\usr\bin\gunzip

I wonder if the root issue is some combination of:

  • mixing different builds of those tools can cause problems
  • some recent change to the windows-latest environment in GitHub actions remove C:\msys64\usr\bin\tar.exe

I found that some other utilities provided by the MSYS2 distribution used in these images are available at C:\msys64\mingw64\bin.

https://github.com/actions/virtual-environments/blob/3b5c4ebd39ce3d5812e130938bb066f67d90b54e/images/win/scripts/Installers/Install-Msys2.ps1#L75-L76

I just pushed 3e1d5f8, to see if adding that to PATH helps.

@jameslamb
Copy link
Collaborator Author

I tried just using the tools bundled with Rtools35 (by ensuring that Rtools paths are at the beginning of PATH) and unfortunately there is not a gunzip there.

(failing R 3.6 CRAN build link)

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     tar.exe                                            0.0.0.0    C:\Rtools\bin\tar.exe
--- location of gzip ---
Application     gzip.exe                                           0.0.0.0    C:\Rtools\bin\gzip.exe
--- location of gunzip ---
Get-Command: D:\a\LightGBM\LightGBM\.ci\test_r_package_windows.ps1:180
Line |
 180 |      Get-Command gunzip
     |      ~~~~~~~~~~~~~~~~~~
     | The term 'gunzip' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

There is one in newer versions of RTools.

(successful R4.X CRAN build link)

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     tar.exe                                            0.0.0.0    C:\rtools40\usr\bin\tar.exe
--- location of gzip ---
Application     gzip.exe                                           0.0.0.0    C:\rtools40\usr\bin\gzip.exe
--- location of gunzip ---
Application     gunzip                                             0.0.0.0    C:\rtools40\usr\bin\gunzip

@jameslamb
Copy link
Collaborator Author

Ok I was able to get a few more logs from the failing line. (build link)

re-tarring lightgbm_3.3.2.99.tar.gz
lightgbm/
tar (child)lightgbm/build/
lightgbm/build/vignette.rds
lightgbm/cleanup
lightgbm/configure
: gzip: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: lightgbm_3.3.2.99.tar.gz: Cannot write: Broken pipe
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Running R CMD check

That error message is what I'd expect to see if gzip wasn't installed at all, but I can tell from the logs of Get-Command that it is!

I just pushed ab59cfb adding -z to the original tar command (based on this very old Stack Overflow answer, https://stackoverflow.com/questions/9749466/cant-untar-a-complete-directory-using-tar-cvpzf#comment12404275_9749491), but that did not work.

I'm traveling right now and will be away for the next 8 hours or so, sorry I'm not able to devote more time to this right now.

@jameslamb jameslamb changed the title WIP: testing R Windows CI WIP: [ci] fix R 3.6 Windows build (fixes #5036) Apr 13, 2022
@guolinke
Copy link
Collaborator

Hi, @jameslamb is the CI job normal now?

@jameslamb
Copy link
Collaborator Author

is the CI job normal now?

@guolinke I will come back to this draft PR once LightGBM's CI is fixed (#5362 (comment)). I had been prioritizing other things, like getting R 4.2 support added (#5274).

@jameslamb
Copy link
Collaborator Author

to make things easier for reviewers, I'm closing this PR with lots of debugging commits and comments. It is replaced by #5479.

@jameslamb jameslamb closed this Sep 10, 2022
@jameslamb jameslamb deleted the fix/r-windows-ci branch September 10, 2022 16:48
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants