# "vcvarsall.bat" freezes on new 1809-based Windows images

**URL:** <https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098>\
**Category:** Windows\
**Created:** [February 5, 2020, 12:26am UTC](https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098 "2020-02-05T00:26:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fniephaus](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/fniephaus/32/3766_2.png) [@fniephaus](https://travis-ci.community/u/fniephaus)\
**Post date:** [February 5, 2020, 12:26am UTC](https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098/1 "2020-02-05T00:26:16Z")

</div>

For some reason, calling `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat` seems to freeze 1809-based Windows builds.

Now on 1809: [https://travis-ci.org/hpi-swa/graalsqueak/jobs/646198232#L104](https://travis-ci.org/hpi-swa/graalsqueak/jobs/646198232#L104)  
Before on 1803: [https://travis-ci.org/hpi-swa/graalsqueak/jobs/645394730#L104](https://travis-ci.org/hpi-swa/graalsqueak/jobs/645394730#L104)

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [February 5, 2020, 4:23am UTC](https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098/2 "2020-02-05T04:23:14Z")

</div>

- Are you sure the files that you try to run actually exist?

- To debug a `.bat` file, you can replace `@echo off` at the start of it with `@echo on`.

---

<div class="post-metadata">

**Author:** ![fniephaus](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/fniephaus/32/3766_2.png) [@fniephaus](https://travis-ci.community/u/fniephaus)\
**Post date:** [February 5, 2020, 4:28pm UTC](https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098/3 "2020-02-05T16:28:36Z")

</div>

I’m afraid this doesn’t really solve the problem.  
`vcvarsall.bat` does exist, and I don’t seem to get any debug output when setting `VSCMD_DEBUG=3` (see [https://travis-ci.org/hpi-swa/graalsqueak/jobs/646488990#L64](https://travis-ci.org/hpi-swa/graalsqueak/jobs/646488990#L64))

It looks like other projects are timing out because of this as well. Here’s an example:  
[https://travis-ci.org/tcltk/tcl/jobs/646432319#L35](https://travis-ci.org/tcltk/tcl/jobs/646432319#L35)

Any idea what’s going on here?

---

<div class="post-metadata">

**Author:** ![michael-grunder](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@michael-grunder](https://travis-ci.community/u/michael-grunder)\
**Post date:** [February 5, 2020, 4:58pm UTC](https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098/4 "2020-02-05T16:58:56Z")

</div>

We’re seeing this exact error on [hiredis](https://www.github.com/redis/hiredis.git) builds (and all recent PRs).

I first noticed the failure in a PR so I started bisecting to find where it was introduced, but have now seen several previously passing builds fail in the same way.

[Link to an example failure](https://travis-ci.org/redis/hiredis/jobs/646276189)

---

<div class="post-metadata">

**Author:** ![Riateche](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/riateche/32/3792_2.png) [@Riateche](https://travis-ci.community/u/Riateche)\
**Post date:** [February 9, 2020, 1:16pm UTC](https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098/5 "2020-02-09T13:16:35Z")

</div>

Same issue for me. Builds started to hang without any relevant changes in the project. [Example job](https://travis-ci.com/rust-qt/ritual/jobs/285220110)

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [February 10, 2020, 9:27am UTC](https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098/6 "2020-02-10T09:27:20Z")

</div>

Okay, found it.

The behavior change happens when [KB4534273](https://support.microsoft.com/en-us/help/4534273/windows-10-update-kb4534273) (a recent update for 1809) is installed.

Git Bash starts formatting the single-quoted part as a single argument (as it should) and treating `/c` as a path ([as it usually does](https://travis-ci.community/t/wsl1-unix-paths-on-the-command-line-are-being-changed-in-a-strange-way/6231/2)) – which it didn’t do before for some reason. So in fact, what you see now is the correct behavior.

As such, `cmd /C '"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 && <etc>'` turns into `C:\Windows\system32\cmd.exe C:/ "\"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat\" amd64 && <etc>"` argument for `CreateProcess`.

Since Cmd, unlike Bash, expects the code on the command line to not be a single argument but multiple, one for each lexeme, you need to represent it accordingly as multiple arguments, quoting Bash special syntax as necessary (and also [prevent treating `/c` as path](https://travis-ci.community/t/wsl1-unix-paths-on-the-command-line-are-being-changed-in-a-strange-way/6231/2)):

```auto
cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' amd64 '&&' <etc>

```
