ilammy / msvc-dev-cmd

GitHub Action to setup Developer Command Prompt for Microsoft Visual C++
MIT License
329 stars 44 forks source link

Print the error message from the environment configuration scripts at once #41

Closed pzhlkj6612 closed 3 years ago

pzhlkj6612 commented 3 years ago

Here are two examples to show the difference before and after this change.

Example 1 ## Parameters - sdk: A - arch: x64 ## Comparison of GHA summary ### Before > (X) >      [ERROR:vcvarsall.bat] Invalid argument found : A > > --- > > (X) >      Could not setup Developer Command Prompt: invalid parameters > > --- > ### After > (X) >      Could not setup Developer Command Prompt: invalid parameters [ERROR:vcvarsall.bat] Invalid argument found : A > > --- > ## Comparison of GHA log ### Before ``` ... Error: [ERROR:vcvarsall.bat] Invalid argument found : A Error: Could not setup Developer Command Prompt: invalid parameters ... ``` ### After ``` ... Error: Could not setup Developer Command Prompt: invalid parameters [ERROR:vcvarsall.bat] Invalid argument found : A ... ```
Example 2 ## Parameters - sdk: 10.0.10240.0 - arch: x64 ## Comparison of GHA summary ### Before > (X) >      [ERROR:winsdk.bat] Windows SDK 10.0.10240.0 : 'C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um' not found or was incomplete > > --- > > (X) >      [ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. *** > > --- > > (X) >      [ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run > > --- > > (X) >      [ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details. > > --- > > (X) >      [ERROR:VsDevCmd.bat] Where [value] is: > > --- > > (X) >      [ERROR:VsDevCmd.bat] 1 : basic debug logging > > --- > > (X) >      [ERROR:VsDevCmd.bat] 2 : detailed debug logging > > --- > > (X) >      [ERROR:VsDevCmd.bat] 3 : trace level logging. Redirection of output to a file when using this level is recommended. > > --- > > (X) >      [ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3 > > --- > > (X) >      [ERROR:VsDevCmd.bat] vsdevcmd.bat > vsdevcmd.trace.txt 2>&1 > > --- > As you can see, they are too many. And I have no idea why "Could not setup Developer Command Prompt: invalid parameters" is not here. ### After > (X) >      Could not setup Developer Command Prompt: invalid parameters [ERROR:winsdk.bat] Windows SDK 10.0.10240.0 : 'C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um' not found or was incomplete [ERROR... > >      show more > > --- > > (X) >      Could not setup Developer Command Prompt: invalid parameters >      [ERROR:winsdk.bat] Windows SDK 10.0.10240.0 : 'C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um' not found or was incomplete >      [ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. *** >      [ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run >      [ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details. >      [ERROR:VsDevCmd.bat] Where [value] is: >      [ERROR:VsDevCmd.bat] 1 : basic debug logging >      [ERROR:VsDevCmd.bat] 2 : detailed debug logging >      [ERROR:VsDevCmd.bat] 3 : trace level logging. Redirection of output to a file when using this level is recommended. >      [ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3 >      [ERROR:VsDevCmd.bat] vsdevcmd.bat > vsdevcmd.trace.txt 2>&1 > >      show less > > --- > ## Comparison of GHA log ### Before ``` ... Error: [ERROR:winsdk.bat] Windows SDK 10.0.10240.0 : 'C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um' not found or was incomplete 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 ... ``` ### After ``` ... Error: Could not setup Developer Command Prompt: invalid parameters [ERROR:winsdk.bat] Windows SDK 10.0.10240.0 : 'C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um' not found or was incomplete [ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. *** [ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run [ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details. [ERROR:VsDevCmd.bat] Where [value] is: [ERROR:VsDevCmd.bat] 1 : basic debug logging [ERROR:VsDevCmd.bat] 2 : detailed debug logging [ERROR:VsDevCmd.bat] 3 : trace level logging. Redirection of output to a file when using this level is recommended. [ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3 [ERROR:VsDevCmd.bat] vsdevcmd.bat > vsdevcmd.trace.txt 2>&1 ... ```
pzhlkj6612 commented 3 years ago

Oh no, I did a wrong conflict resolution.

pzhlkj6612 commented 3 years ago

Thank you for editing the text content. It should be collapsed by default.

And I'm sorry I didn't make the progress smooth, please squash all the commits into one commit to avoid an ugly history.

ilammy commented 3 years ago

@pzhlkj6612, no worries. As long as it applies cleanly, it's good.

I more or less default to squash-merging anyway unless there is a particular reason to do otherwise.

Thank you for your contributions!