Make the build output the WiX compilation log if it failed.#4831
Make the build output the WiX compilation log if it failed.#4831adityapatwardhan merged 2 commits intoPowerShell:masterfrom
Conversation
Before it was not outputting it not at all because the build output is an array that was piped directly to 'Write-Verbose' instead of converting it to a string using 'Out-String' Because the WiX log is usually quite verbose (around 250 lines), the log is only shown if there must have been a compilation error due to the missing MSI
|
@bergmeister, |
build.psm1
Outdated
| { | ||
| $WiXHeatLog | Out-String | Write-Verbose | ||
| $WiXCandleLog | Out-String | Write-Verbose | ||
| $WiXLightLog | Out-String | Write-Verbose |
There was a problem hiding this comment.
I think you probably need Write-Verbose -Verbose, otherwise, the verbose message won't be written out unless New-MSIPackage is called with -Verbose.
There was a problem hiding this comment.
Ok. I fixed it. But why is the build script no being called using the -Verbose option from the top level? As long as advanced functions are used, the $VerbosePreference would be propagated through.
There was a problem hiding this comment.
-Verbose is not specified when calling Invoke-AppveyorFinish and also not specified when calling Start-PSPackage, as well as when calling New-MSIPackage. Maybe it should be specified at the very top call.
But for this change, we'd better add -Verbose anyway because even if -Verbose is not specified when calling New-MSIPackage, it's still desired to write out the logs when no MSI was produced.
…d as suggested in review.
|
Our logs are already very long. If we are on AppVeyor and not local, it may be better to add these logs as artifacts and reference them, If local we can just reference the logs. I filed an issue for this: |
TravisEz13
left a comment
There was a problem hiding this comment.
It's an improvement. But these should be made into artifacts.
|
@TravisEz13 : That's why the WiX log (around 250 lines) gets only output in the case of a failure to not pollute normal green builds. |
|
unless the logs are very short, 1-5 line, an artifact would be better. The logs are very long and become difficult to find details in. |
Although PR #4795 fixed the main issue of #4760 (to make the build red if there is a
WiXcompilation error), it did not fix the problem that currently theWiXlog is not outputted at all and therefore one cannot see the compilation error in the log. This PR fixes this and outputs theWiXlog only if noMSIcould be produced because theWiXlog is quite verbose (around 250 lines) and would be unnecessary noise in a green build.The reason why the log is currently not displayed in the log is because the resulting object is piped directly to
Write-Verbosebut is of type array and therefore needs to be converted to a string usingOut-Stringbeforehand.