Skip to content

Commit e9a0a68

Browse files
committed
Added new WLB_BUILD_TRACE var for better trace logging, fixed powershell dir in path
1 parent 0df9893 commit e9a0a68

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.github/workflows/do_build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ env:
3636
MSYS2_ARG_CONV_EXCL: "*"
3737
MSYS2_PATH_TYPE: inherit
3838
WLB_BASE_FOLDER: "d:/WLB"
39+
WLB_BUILD_TRACE: ${{ github.runner.debug && '1' || '0' }}
3940
MSYSTEM: UCRT64
4041
BLD_CONFIG_LOG_COPY_LOGS_TO_INFODIR: 1 #copy logs to the info dir in final build, only happens for debug builds
4142
MSYS_PATH: d:/msys64
@@ -148,6 +149,10 @@ jobs:
148149
- name: Save ENV
149150
run: "Get-ChildItem env: | Select-Object -Property Name, Value | ConvertTo-Json | Out-File -FilePath d:/env.json -Encoding ASCII"
150151

152+
- name: Trace Print ENV
153+
if: ${{ env.WLB_BUILD_TRACE }}
154+
run: "Get-ChildItem env: | Select-Object -Property Name, Value"
155+
151156
- name: Unpack / Move Artifacts
152157
id: artifact_unpack
153158
if: ${{ inputs.RequiredDeps != '' && inputs.BuildPkg != 'script' }}
@@ -180,11 +185,11 @@ jobs:
180185
run: ${{env.WLB_SCRIPT_FOLDER}}/vs_msys_shell_launch.ps1 "${{env.WLB_SCRIPT_FOLDER}}/${{env.SCRIPT}}"
181186

182187
- name: Debug Session
183-
if: ${{ failure() && (vars.DEBUG_FAIL == '1') && (runner.debug) }}
188+
if: ${{ failure() && (vars.DEBUG_FAIL == '1') && (env.WLB_BUILD_TRACE) }}
184189
run: ${{env.WLB_SCRIPT_FOLDER}}/.github/debug_ssh_start.ps1
185190

186191
- name: Failure Artifact Upload
187-
if: ${{ failure() && (runner.debug) }}
192+
if: ${{ failure() && (env.WLB_BUILD_TRACE) }}
188193
uses: actions/upload-artifact@v4
189194
with:
190195
name: FAILURE-${{env.BUILD_PKG}}${{matrix.Configuration=='Debug' && '-Debug' || ''}}

vs_msys_shell_launch.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@ if (! $env:VS_ENV_INITIALIZED) {
3131
}
3232
}
3333

34-
$pathAdd="${env:SystemRoot};${env:SystemRoot}/system32;${env:SystemRoot}/Wbem;${env:SystemRoot}/WindowsPowerShell/v1.0${pwshPath}"
34+
$pathAdd="${env:SystemRoot};${env:SystemRoot}/system32;${env:SystemRoot}/Wbem;${env:SystemRoot}/system32/WindowsPowerShell/v1.0${pwshPath}"
3535
if ( $env:WLB_PATH_ADD ){
3636
$pathAdd="$env:WLB_PATH_ADD;$pathAdd"
3737
}
38-
$path_after=$path_after.replace($path_before,$pathAdd)
38+
$path_after=$path_after.replace($path_before,$pathAdd).replace(";;",";").Trim(';').replace("//","/").replace("\\","\")
3939
$env:PATH=$path_after
40+
if ( $env:WLB_BUILD_TRACE ) {
41+
Write-Host "Stripped path to:"
42+
$env:PATH.Split(";") | ForEach-Object { Write-Host "`t$_" }
43+
}
44+
45+
4046
}
4147
}
4248
. "$($env:WLB_SCRIPT_FOLDER)/msys_shell.ps1" "$StartScript"

0 commit comments

Comments
 (0)