ilammy/msvc-dev-cmd

msvc-dev-cmd conflicts with conda-incubator/setup-miniconda

constantinpape opened this issue · 2 comments

I have been using the mscv-dev-cmd in a couple of my github workflowss to set the VC environment variables.
This stopped working across the board a couple of weeks ago, without any changes to the workflow scripts.
So I am assuming that this is related to an upgrade of windows-latest in gh-workflows.

This is one of the relevant recipes: https://github.com/constantinpape/z5/blob/master/.github/workflows/build.yml
And here is a PR where the windows CI fails: constantinpape/z5#181. See also the full error message below.

Any ideas on how to fix this would be highly welcome.

Run ilammy/msvc-dev-cmd@v1.7.0
Found with vswhere: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
'"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd\ext\**********************************************************************"' is not recognized as an internal or external command,
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
operable program or batch file.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
'"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd\ext\**"' is not recognized as an internal or external command,
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
operable program or batch file.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
'"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd\ext\**"' is not recognized as an internal or external command,
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
operable program or batch file.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
'"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd\ext\**********************************************************************"' is not recognized as an internal or external command,
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
operable program or batch file.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\set" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\set" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\set" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\)" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\Windows" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\set" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\set" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\)" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\set" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\set" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\)" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\D:\a\z5\z5" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\C:\Program" could not be found.
Error: [ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\[vcvarsall.bat]" could not be found.
Error: [ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
Error: [ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run
Error: [ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
Error: [ERROR:VsDevCmd.bat] Where [value] is:
Error: [ERROR:VsDevCmd.bat]    1 : basic debug logging
Error: [ERROR:VsDevCmd.bat]    2 : detailed debug logging
Error: [ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended.
Error: [ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
Error: [ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1
Error: Could not setup Developer Command Prompt: invalid parameters

Uh-huh... Thanks for a report, @constantinpape!

I'm able to reproduce the issue with both windows-2016 and windows-2019 environments so that's not it. The real reason seems to be related to the conda-incubator/setup-miniconda step that your builds perform before setting up MSVC environment. That seems to conflict with something (maybe some shell defaults, or whatnot), making vcvarsall.bat output something really unexpected that msvc-dev-cmd cannot parse.

Reordering build steps seems to help. I've sent you a PR with a workaround. That should at least let you have a green build while I'm figuring our what exactly Python env breaks in MSVC scripts.

I'm able to reproduce the issue with both windows-2016 and windows-2019 environments so that's not it. The real reason seems to be related to the conda-incubator/setup-miniconda step that your builds perform before setting up MSVC environment. That seems to conflict with something (maybe some shell defaults, or whatnot), making vcvarsall.bat output something really unexpected that msvc-dev-cmd cannot parse.

Ok, good to know. I was just assuming that this was due to the latest windows build because this set up did work for me until a couple of weeks ago. But I guess some other change must have triggered the issue then.

Reordering build steps seems to help. I've sent you a PR with a workaround. That should at least let you have a green build while I'm figuring our what exactly Python env breaks in MSVC scripts.

Thanks!