Build freezes between commands in appveyor.yml

lars's Avatar

lars

03 Sep, 2018 08:09 PM

Thank you for providing your service to OSS! I use it since years and so far was able to fix all issues by printf debugging. However since update https://www.appveyor.com/updates/2018/08/29/ I've got an issue I couldn't catch:

For building RubyInstaller several rake tasks are executed. One of the first steps is to download and install MSYS2 pacman packages to a sandbox in the project directory. The rake command executes this step successfully, then cmd prints a final message and the control is given back to the appveyor.yml interpreter. However it doesn't execute the next command but stops and freezes until the 60 minute timeout aborts the VM: https://ci.appveyor.com/project/larskanis/rubyinstaller2-hbuor/build/job/c9xjp20ug9jjismu#L39

It seems like the pacman install does some modifications to the VM that disturbs the appveyor.yml interpreter.

When running on the previous appveyor image all runs well: https://ci.appveyor.com/project/larskanis/rubyinstaller2-hbuor/build/1.0.699/job/gvo1ou9xavwo6ib9#L39

The difference between the two runs above is this commit only: https://github.com/oneclick/rubyinstaller2/commit/7a755621bf4f7c18fc56cec77114ed489035cd76

  1. Support Staff 1 Posted by Feodor Fitsner on 03 Sep, 2018 11:22 PM

    Feodor Fitsner's Avatar

    Hi Lars,

    I guess there is gpg-agent process started during pacman update and preventing parent process from exiting. We, actually, noticed that during the last MSYS update - there is something definitely changed in pacman update code.

    We use the following script to update/install MSYS: https://gist.github.com/FeodorFitsner/a7a5fdf8f3160a8f286ad2231aadadfc

    Do you see anything wrong with that? Is there any way to disable/shutdown gpg-agent? Any help with resolving that is highly appreciated!

  2. 2 Posted by lars on 04 Sep, 2018 03:32 PM

    lars's Avatar

    Thank you Feodor! That was the right hint. gpg-agent is mandatory since
    gpg-2.1 for private key operations, so that it's now impossible to disable
    gpg-agent. I tried out a lot of options to gpg and to gpg-agent, but I
    wasn't able to find one that shutdowns gpg-agent and scdaemon after use. So
    I went further and killed the daemons by the official gpgconf command after
    execution of the rake command. This works for RubyInstaller2 like so:
    https://github.com/oneclick/rubyinstaller2/commit/6974bb8451db654c5ae69754fef47582a813a35d

    Another issue I noticed, is that there are corrupted files in the pacman
    cache. Here is a log:
    https://ci.appveyor.com/project/larskanis/rubyinstaller2-hbuor/build/1.0.716/job/dw94tq2hnb5pboeo#L582
    I work around this by removing the files in question before install:
    https://github.com/oneclick/rubyinstaller2/commit/b168fb415063b0b2eb9d4be471fe1b7774de5650
    There have been more and other corrupted files in the cache directory in
    the past. I'm uncertain where they come from. I didn't notice any corrupted
    files on my local system although I work a lot with MSYS2.

    Am Di., 4. Sep. 2018 um 01:22 Uhr schrieb Feodor Fitsner <
    [email blocked]>:

  3. Support Staff 3 Posted by Feodor Fitsner on 04 Sep, 2018 03:43 PM

    Feodor Fitsner's Avatar

    Cool, thanks for the provided solution! I guess the piece after & is what others updating pacman during the build can use to unblock it: https://github.com/oneclick/rubyinstaller2/commit/6974bb8451db654c5...

    Regarding the corrupted cache - do you think it makes sense (safe?) to delete it completely during our MSYS installation to the images? Is it just a directory that could be deleted or specific command?

  4. 4 Posted by lars on 04 Sep, 2018 07:36 PM

    lars's Avatar

    > I guess the piece after & is what others updating pacman during the build can use to unblock it

    Exactly, adding `& c:/msys64/usr/bin/gpgconf --homedir /etc/pacman.d/gnupg --kill all` to the hanging line should fix it. The downside of concatenating per "&" is that the second command overrides the exit status of the first. This is not too bad in my case, but could be for others.

    > Is it just a directory that could be deleted or specific command?

    Yes, it is safe to delete the whole cache directory by something like `rm -rf c:/msys64/var/cache/pacman/pkg` . Files missing there are downloaded from the MSYS2 repository. This still leaves the question why there are corrupt files.

  5. Support Staff 5 Posted by Feodor Fitsner on 05 Sep, 2018 05:42 PM

    Feodor Fitsner's Avatar

    Thanks, I've added a new issue to cleanup pacman cache on the next update: https://github.com/appveyor/ci/issues/2612

  6. Feodor Fitsner closed this discussion on 05 Sep, 2018 05:42 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac