From bf70999c4e15e086a752990ff2b91cf94c1f2759 Mon Sep 17 00:00:00 2001 From: Gator96100 Date: Mon, 5 Oct 2020 22:06:03 +0200 Subject: [PATCH] Can't use receive-job withing jobs --- appveyor.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9d1da7ef0..c8e1f6ee6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -53,7 +53,9 @@ clone_script: Write-Host "[ OK ]" -ForegroundColor Green } - $env:WSLInstalljob = Start-Job -Name WSLInstall -ScriptBlock { + $env:wsl_install_running = true + + $WSLjob = Start-Job -Name WSLInstall -ScriptBlock { Function WSLExec($Text, $Cmd) { Write-Host "$Text" wsl -- bash -c $Cmd @@ -68,6 +70,7 @@ clone_script: WSLExec "WSL install..." "sudo apt-get -y install --reinstall --no-install-recommends git ca-certificates build-essential pkg-config libreadline-dev gcc-arm-none-eabi libnewlib-dev libbz2-dev qtbase5-dev cmake 1>/dev/null" WSLExec "WSL QT fix..." "sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5" Add-AppveyorMessage -Message "WSL setup took $(([System.Environment]::TickCount-$WSLInstallTime) / 1000) sec" -Category Information + $env:wsl_install_running = false } $env:PSInstallTime=[System.Environment]::TickCount @@ -154,7 +157,7 @@ install: } Start-Sleep -s 5 - Receive-Job -Job $env:WSLInstalljob -ErrorAction SilentlyContinue + Receive-Job -Name WSLInstall -ErrorAction SilentlyContinue } #Receive-Job -Wait -Name PSInstall } @@ -235,7 +238,13 @@ build_script: } #WSL: wait for installation to finish - Receive-Job -Job $env:WSLInstalljob -ErrorAction SilentlyContinue + if($env:wsl_install_running){ + Write-Host "Waiting for WSL installation to finish..." + while($env:wsl_install_running) { + Start-Sleep -s 1 + } + Write-Host "$Name [ OK ]" -ForegroundColor Green + } #Windows Subsystem for Linux (WSL) Write-Host "---------- WSL make ----------" -ForegroundColor Yellow @@ -321,6 +330,8 @@ build_script: ExecCheck "PS cmake Tests" + Receive-Job -Wait -Name WSLInstall -ErrorAction SilentlyContinue + Receive-Job -Wait -Job $WSLjob