-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Use oneAPI for Windows postcommit builds (#16355)
Getting this working was an unbelievable amount of work. I hit so many weird issues caused by dumb Windows things (case insensitivity, cmd vs bash, bugs in cmake/ninja/sccache themselves) but finally I got something that consistently passes. You can see the funniest dumb Windows issue in the comment in the CMake file change. The basic idea is to extend the Windows build workflow to allow using `icx`, add an action to setup the oneAPI environment, call it from the build action and the test action (since we need some of the shared libs on path even for testing), and fix some oneAPI-only build issues. We need to do some Powershell magic after calling the oneAPI setup bat script because the environment variables get lost since it's run in a subprocess. We also switch to `ccache` instead of `sccache`, because `sccache` doesn't support `icx` (actually neither does `ccache`, but I added it upstream [here](ccache/ccache#1533) and we are using a local build of `ccache`, it was easier to add support to `ccache`). Manually tested it to confirmed cache reads and write are working as expected. At some point we should probably investigate why some tests fail or some compiler flags are required with `icx` only and not `cl`, but let's do that as separate work because I am done with Windows for now. I already set up all Windows runners used here to work with this change. Next I'll add oneAPI builds on Linux, which I really hope is easier. --------- Signed-off-by: Sarnie, Nick <[email protected]>
- Loading branch information
Showing
7 changed files
with
112 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Windows setup oneAPI env | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup oneAPI env | ||
shell: powershell | ||
run: | | ||
$batchFilePath = "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" | ||
$githubEnvFilePath = $env:GITHUB_ENV | ||
$envBefore = Get-ChildItem Env: | ForEach-Object { "$($_.Name)=$($_.Value)" } | ||
$envVars = & cmd.exe /c "call `"$batchFilePath`" && set" | Out-String | ||
$envAfter = $envVars -split "`r`n" | Where-Object { $_ -match "^(.*?)=(.*)$" } | ||
foreach ($envVar in $envAfter) { | ||
if ($envVar -match "^(.*?)=(.*)$") { | ||
$name = $matches[1] | ||
$value = $matches[2] | ||
$envBeforeVar = $envBefore | Where-Object { $_ -like "$name=*" } | ||
if (-not $envBeforeVar -or $envBeforeVar -ne "$name=$value") { | ||
Add-Content -Path $githubEnvFilePath -Value "$name=$value" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters