Skip to content

Commit

Permalink
Added new WLB_BUILD_TRACE var for better trace logging, fixed powersh…
Browse files Browse the repository at this point in the history
…ell dir in path
  • Loading branch information
mitchcapper committed Jan 12, 2025
1 parent 0df9893 commit 3142508
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/do_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ env:
MSYS2_ARG_CONV_EXCL: "*"
MSYS2_PATH_TYPE: inherit
WLB_BASE_FOLDER: "d:/WLB"
WLB_BUILD_TRACE: ${{ github.runner.debug && 1 || 0 }}
MSYSTEM: UCRT64
BLD_CONFIG_LOG_COPY_LOGS_TO_INFODIR: 1 #copy logs to the info dir in final build, only happens for debug builds
MSYS_PATH: d:/msys64
Expand Down Expand Up @@ -143,11 +144,15 @@ jobs:
with:
msystem: ucrt64
location: d:\
install: pkg-config make gperf rsync autoconf wget gettext-devel automake autogen texinfo git bison python autoconf-archive libtool flex patch
install: pkg-config make gperf rsync autoconf wget gettext-devel automake autogen texinfo git bison python autoconf-archive libtool flex patch unzip

- name: Save ENV
run: "Get-ChildItem env: | Select-Object -Property Name, Value | ConvertTo-Json | Out-File -FilePath d:/env.json -Encoding ASCII"

- name: Trace Print ENV
if: ${{ env.WLB_BUILD_TRACE }}
run: "Get-ChildItem env: | Select-Object -Property Name, Value"

- name: Unpack / Move Artifacts
id: artifact_unpack
if: ${{ inputs.RequiredDeps != '' && inputs.BuildPkg != 'script' }}
Expand Down Expand Up @@ -180,11 +185,11 @@ jobs:
run: ${{env.WLB_SCRIPT_FOLDER}}/vs_msys_shell_launch.ps1 "${{env.WLB_SCRIPT_FOLDER}}/${{env.SCRIPT}}"

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

- name: Failure Artifact Upload
if: ${{ failure() && (runner.debug) }}
if: ${{ failure() && (env.WLB_BUILD_TRACE) }}
uses: actions/upload-artifact@v4
with:
name: FAILURE-${{env.BUILD_PKG}}${{matrix.Configuration=='Debug' && '-Debug' || ''}}
Expand Down
10 changes: 8 additions & 2 deletions vs_msys_shell_launch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ if (! $env:VS_ENV_INITIALIZED) {
}
}

$pathAdd="${env:SystemRoot};${env:SystemRoot}/system32;${env:SystemRoot}/Wbem;${env:SystemRoot}/WindowsPowerShell/v1.0${pwshPath}"
$pathAdd="${env:SystemRoot};${env:SystemRoot}/system32;${env:SystemRoot}/Wbem;${env:SystemRoot}/system32/WindowsPowerShell/v1.0${pwshPath}"
if ( $env:WLB_PATH_ADD ){
$pathAdd="$env:WLB_PATH_ADD;$pathAdd"
}
$path_after=$path_after.replace($path_before,$pathAdd)
$path_after=$path_after.replace($path_before,$pathAdd).replace(";;",";").Trim(';').replace("//","/").replace("\\","\")
$env:PATH=$path_after
if ( $env:WLB_BUILD_TRACE ) {
Write-Host "Stripped path to:"
$env:PATH.Split(";") | ForEach-Object { Write-Host "`t$_" }
}


}
}
. "$($env:WLB_SCRIPT_FOLDER)/msys_shell.ps1" "$StartScript"

0 comments on commit 3142508

Please sign in to comment.