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

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

Open
constantinpape opened this issue Apr 26, 2021 · 2 comments
Open

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

constantinpape opened this issue Apr 26, 2021 · 2 comments

Comments

@constantinpape
Copy link

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/[email protected]
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
@ilammy
Copy link
Owner

ilammy commented Apr 29, 2021

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.

@constantinpape
Copy link
Author

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!

@ilammy ilammy changed the title msvc-dev-cmd action stopped working msvc-dev-cmd conflicts with conda-incubator/setup-miniconda May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants