another shot at redirecting stderr
This commit is contained in:
parent
84737cb49b
commit
1a2f1e2108
3 changed files with 26 additions and 11 deletions
|
@ -27,7 +27,7 @@ function Invoke-CmdScript {
|
|||
[String] $scriptName
|
||||
)
|
||||
$cmdLine = """$scriptName"" $args & set"
|
||||
& $Env:SystemRoot\system32\cmd.exe /c $cmdLine 2>&1 |
|
||||
& $Env:SystemRoot\system32\cmd.exe /c $cmdLine |
|
||||
select-string '^([^=]*)=(.*)$' | foreach-object {
|
||||
$varName = $_.Matches[0].Groups[1].Value
|
||||
$varValue = $_.Matches[0].Groups[2].Value
|
||||
|
@ -43,7 +43,7 @@ function Invoke-Call {
|
|||
[scriptblock]$ScriptBlock,
|
||||
[string]$ErrorAction = $ErrorActionPreference
|
||||
)
|
||||
& @ScriptBlock
|
||||
& @ScriptBlock 2>&1 | %{ "$_" }
|
||||
if (($lastexitcode -ne 0) -and $ErrorAction -eq "Stop") {
|
||||
Write-Error "Command $ScriptBlock exited with $lastexitcode."
|
||||
exit $lastexitcode
|
||||
|
|
|
@ -12,17 +12,27 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
. ${PSScriptRoot}\common.ps1
|
||||
|
||||
Set-PSDebug -Trace 1
|
||||
|
||||
# Wrap git commant in error handling function
|
||||
function Invoke-Git
|
||||
{
|
||||
param (
|
||||
[scriptblock]$args
|
||||
)
|
||||
Invoke-Call -ScriptBlock { git $args } -ErrorAction Stop
|
||||
}
|
||||
|
||||
if (Test-Path -PathType Container "llvm-project"){
|
||||
Set-Location llvm-project
|
||||
Write-Output "performing git pull..."
|
||||
git checkout master 2>&1 | %{ "$_" }
|
||||
git reset --hard 2>&1 | %{ "$_" }
|
||||
git clean -fdx 2>&1 | %{ "$_" }
|
||||
git pull 2>&1 | %{ "$_" }
|
||||
Invoke-Git checkout master
|
||||
Invoke-Git reset
|
||||
Invoke-Git clean -fdx
|
||||
Invoke-Git pull
|
||||
# TODO: in case of errors: delete folder and clone
|
||||
} else {
|
||||
Write-Output "performing git clone..."
|
||||
git clone -q --depth 1 https://github.com/llvm/llvm-project 2>&1 | %{ "$_" }
|
||||
}
|
||||
Invoke-Git clone -q --depth 1 https://github.com/llvm/llvm-project
|
|
@ -20,9 +20,14 @@ Push-Location build
|
|||
|
||||
Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
|
||||
|
||||
# Invoke-Call -ScriptBlock {
|
||||
cmake ..\llvm -G Ninja -DCMAKE_BUILD_TYPE=Release -D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -D LLVM_ENABLE_ASSERTIONS=ON -DLLVM_LIT_ARGS="-v --xunit-xml-output test-results.xml" -D LLVM_ENABLE_DIA_SDK=OFF --trace 2>&1 | %{ "$_" }
|
||||
#} -ErrorAction Stop
|
||||
Invoke-Call -ScriptBlock {
|
||||
cmake ..\llvm -G Ninja -DCMAKE_BUILD_TYPE=Release `
|
||||
-D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra" `
|
||||
-D LLVM_ENABLE_ASSERTIONS=ON `
|
||||
-DLLVM_LIT_ARGS="-v --xunit-xml-output test-results.xml" `
|
||||
-D LLVM_ENABLE_DIA_SDK=OFF `
|
||||
--trace
|
||||
} -ErrorAction Stop
|
||||
|
||||
# LLVM_ENABLE_DIA_SDK=OFF is a workaround to make the tests pass.
|
||||
# see https://bugs.llvm.org/show_bug.cgi?id=44151
|
||||
|
|
Loading…
Reference in a new issue