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

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

Merged
merged 2 commits into from
May 26, 2021
Merged

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

merged 2 commits into from
May 26, 2021

Conversation

pzhlkj6612
Copy link
Contributor

@pzhlkj6612 pzhlkj6612 commented May 26, 2021

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) <job_name>
     [ERROR:vcvarsall.bat] Invalid argument found : A


(X) <job_name>
     Could not setup Developer Command Prompt: invalid parameters


After

(X) <job_name>
     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) <job_name>
     [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) <job_name>
     [ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***


(X) <job_name>
     [ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run


(X) <job_name>
     [ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.


(X) <job_name>
     [ERROR:VsDevCmd.bat] Where [value] is:


(X) <job_name>
     [ERROR:VsDevCmd.bat] 1 : basic debug logging


(X) <job_name>
     [ERROR:VsDevCmd.bat] 2 : detailed debug logging


(X) <job_name>
     [ERROR:VsDevCmd.bat] 3 : trace level logging. Redirection of output to a file when using this level is recommended.


(X) <job_name>
     [ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3


(X) <job_name>
     [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) <job_name>
     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) <job_name>
     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
...

Printing them line by line will generate a bunch of error messages on
  the summary page of GitHub Actions workflow. I think it's a bit
  annoying.

Note that this change will also affect the format of the final output
  error message, but no information will be lost.
@ilammy ilammy self-requested a review May 26, 2021 11:58
Copy link
Owner

@ilammy ilammy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

The change needs some rebasing on the latest master, but otherwise looks good.

@pzhlkj6612
Copy link
Contributor Author

Oh no, I did a wrong conflict resolution.

@pzhlkj6612 pzhlkj6612 marked this pull request as draft May 26, 2021 13:00
@pzhlkj6612 pzhlkj6612 marked this pull request as ready for review May 26, 2021 13:10
@pzhlkj6612
Copy link
Contributor Author

pzhlkj6612 commented May 26, 2021

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.

@pzhlkj6612 pzhlkj6612 requested a review from ilammy May 26, 2021 13:17
@ilammy
Copy link
Owner

ilammy commented May 26, 2021

@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!

@ilammy ilammy merged commit 985d494 into ilammy:master May 26, 2021
@pzhlkj6612 pzhlkj6612 deleted the print-vsvars-error-message-at-once-10 branch May 26, 2021 13:34
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

Successfully merging this pull request may close these issues.

2 participants