cmd /C in msys2 starts interactive cmd

igagis's Avatar

igagis

30 Sep, 2019 01:55 PM

Hi,

some time ago my builds started to fail due to timeout of 1 hour. Here is the example build:

https://ci.appveyor.com/project/igagis/papki/builds/27767615

The last lines say
"
Microsoft Windows [Version 10.0.17763.737]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\build\tests\FSFile>
"
So, it looks like it has exited to cmd and awaits for user commands.

The last operation it was trying to run was to run test app under msys2.
The test uses 'cmd /C' to execute the binary, so it is also possible that /C was ignored for some reason.

On my local msys2 installation the test works fine.

This problem occurred in image "os: Visual Studio 2018", and changing to "os: Visual Studio 2019" did not help.

Br,
Ivan

  1. 1 Posted by igagis on 30 Sep, 2019 02:57 PM

    igagis's Avatar

    here is more verbose build https://ci.appveyor.com/project/igagis/papki/builds/27770003

    the last command executed in msys2 was:

    (cd ./tests/FSFile/ && cmd /C 'set PATH=../../src;%PATH% && tests.exe') || myci-error.sh "test failed"
    Microsoft Windows [Version 10.0.17763.737]
    (c) 2018 Microsoft Corporation. All rights reserved.
    C:\build\tests\FSFile>

    so it looks like as if cmd /C ignored that /C and just started the cmd

  2. Support Staff 2 Posted by Feodor Fitsner on 01 Oct, 2019 12:10 AM

    Feodor Fitsner's Avatar

    yes, and it's blocking, waiting for the input.

  3. 3 Posted by igagis on 01 Oct, 2019 03:35 AM

    igagis's Avatar

    Any idea how to fix that? Also, what has changed in appveyor images that it
    started ignoring /C parameter?

    вт, 1 окт. 2019 г., 3:10 Feodor Fitsner <[email blocked]>:

  4. Support Staff 4 Posted by Feodor Fitsner on 02 Oct, 2019 12:12 AM

    Feodor Fitsner's Avatar

    I don't think cmd is broken. Look at this test build, cmd /C dir runs just fine without blocking the build:

    However, msys could have been updated during the last image update (as it's getting installed from scratch during image update) and maybe something there became broken.

    Try logging into VM via RDP and see what's going on: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/

    Alternatively, try changing the way Windows shell commands are called from bash script, kind of cmd /c start /wait ..., or without cmd /c or there could be another way.

  5. 5 Posted by igagis on 02 Oct, 2019 10:29 AM

    igagis's Avatar

    yes, it looks like something has broken in msys2. I updated msys2 on my local installation to latest and the problem started reproducing there even with just "cmd /C dir".

  6. igagis closed this discussion on 02 Oct, 2019 10:29 AM.

  7. igagis re-opened this discussion on 02 Oct, 2019 10:58 AM

  8. 6 Posted by igagis on 02 Oct, 2019 10:58 AM

    igagis's Avatar

    and the solution was to escape /C because msys converts it to C:\

    The following command works as expected:

    cmd //C dir

  9. igagis closed this discussion on 02 Oct, 2019 10:58 AM.

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