Skip to content

Commit 8842a0c

Browse files
syoyoclaude
andcommitted
Fix PowerShell error in build info step - pre-capture compiler version
The cl.exe command outputs to stderr, and using it inside a here-string with subexpression syntax was causing PowerShell errors. Now we capture the compiler and cmake versions into variables before the here-string. Fixes the "Create build info" step failure in Windows release workflows. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ee68519 commit 8842a0c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/release-windows-arm64.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ jobs:
8282
- name: Create build info
8383
shell: powershell
8484
run: |
85+
$compilerVersion = (& cl.exe 2>&1 | Select-String 'Version' | ForEach-Object { $_.Line }).Trim()
86+
$cmakeVersion = (cmake --version | Select-Object -First 1).Trim()
8587
$buildInfo = @"
8688
OpenUSD Build Information
8789
========================
@@ -100,8 +102,8 @@ jobs:
100102
101103
Platform:
102104
- OS: Windows Server 2022 ARM64
103-
- Compiler: MSVC $(& cl.exe 2>&1 | Select-String 'Version' | ForEach-Object { $_.Line })
104-
- CMake: $(cmake --version | Select-Object -First 1)
105+
- Compiler: MSVC $compilerVersion
106+
- CMake: $cmakeVersion
105107
106108
Library Size:
107109
$(if (Test-Path dist-minsizerel-ms\lib\lteusd_ms.dll) {

.github/workflows/release-windows.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ jobs:
8282
- name: Create build info
8383
shell: powershell
8484
run: |
85+
$compilerVersion = (& cl.exe 2>&1 | Select-String 'Version' | ForEach-Object { $_.Line }).Trim()
86+
$cmakeVersion = (cmake --version | Select-Object -First 1).Trim()
8587
$buildInfo = @"
8688
OpenUSD Build Information
8789
========================
@@ -100,8 +102,8 @@ jobs:
100102
101103
Platform:
102104
- OS: Windows Server 2022
103-
- Compiler: MSVC $(& cl.exe 2>&1 | Select-String 'Version' | ForEach-Object { $_.Line })
104-
- CMake: $(cmake --version | Select-Object -First 1)
105+
- Compiler: MSVC $compilerVersion
106+
- CMake: $cmakeVersion
105107
106108
Library Size:
107109
$(if (Test-Path dist-minsizerel-ms\lib\lteusd_ms.dll) {

0 commit comments

Comments
 (0)