Skip to content

Commit 5a6086a

Browse files
committed
Fix Windows AdaptiveCpp CPU compiler path
1 parent 9938ff6 commit 5a6086a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/actions/setup-sycl-toolchain/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ runs:
9999
if: ${{ runner.os == 'Windows' }}
100100
shell: pwsh
101101
run: |
102+
function Get-ShortPath($Path) {
103+
$resolvedPath = (Resolve-Path $Path).Path
104+
$shortPath = & $env:ComSpec /d /c "for %I in (`"$resolvedPath`") do @echo %~sI"
105+
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($shortPath)) {
106+
throw "Failed to resolve short path for $resolvedPath"
107+
}
108+
return $shortPath.Trim()
109+
}
110+
102111
$clangCl = Get-Command clang-cl.exe -ErrorAction SilentlyContinue
103112
if (-not $clangCl -and $env:ProgramFiles) {
104113
$programFilesClang = Join-Path $env:ProgramFiles 'LLVM/bin/clang-cl.exe'
@@ -126,10 +135,11 @@ runs:
126135
if (-not (Test-Path $clangCxxPath)) {
127136
throw "clang++.exe was not found next to $clangClPath. Install the Visual Studio LLVM/Clang toolset on the Windows runner."
128137
}
138+
$clangCxxShortPath = Get-ShortPath $clangCxxPath
129139
130140
"ITLABAI_CC=$clangClPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
131141
"ITLABAI_CXX=$clangClPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
132-
"ITLABAI_ACPP_CPU_CXX=$clangCxxPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
142+
"ITLABAI_ACPP_CPU_CXX=$clangCxxShortPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
133143
"$clangBin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
134144
135145
- name: Configure Windows toolchain environment

0 commit comments

Comments
 (0)