-
Couldn't load subscription status.
- Fork 15k
[CI][Github] Install Clang in Windows container #164519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
8dc19da
dfc1898
7015843
4a58bdd
39db1d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -98,3 +98,45 @@ RUN powershell -Command \ | |||
| Add-Type -AssemblyName System.IO.Compression.FileSystem ; \ | ||||
| [System.IO.Compression.ZipFile]::ExtractToDirectory('actions-runner-win.zip', $PWD) ;\ | ||||
| rm actions-runner-win.zip | ||||
|
|
||||
| # Set the LLVM_VERSION environment variable | ||||
| RUN powershell -Command [Environment]::SetEnvironmentVariable('LLVM_VERSION', '21.1.2', 'Machine') | ||||
|
|
||||
| # Download and extract Clang compiler. | ||||
| # Create directories, download, extract, and clean up all in one layer | ||||
| RUN powershell -Command \ | ||||
| # --- Setup directories --- \ | ||||
| Write-Host "Creating directories..."; \ | ||||
cmtice marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| New-Item -Path "C:\temp-download" -ItemType "Directory" -Force ; \ | ||||
| New-Item -Path "C:\xz-utils" -ItemType "Directory" -Force ; \ | ||||
| New-Item -Path "C:\clang" -ItemType "Directory" -Force ; \ | ||||
| # --- 1. Download and extract xz --- \ | ||||
| Set-Location C:\temp-download ; \ | ||||
| Invoke-WebRequest -Uri "https://github.com/tukaani-project/xz/releases/download/v5.8.1/xz-5.8.1-windows.zip" -OutFile "xz.zip"; \ | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to verify a checksum here? Similar to what we do for sccache in the linux container:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done (I think). |
||||
| (Get-FileHash -Path "C:\temp-download\xz.zip" -Algorithm MD5).Hash -eq 'c3c69fdce3e825cc0b76123b36b0bcc2' ; \ | ||||
| Add-Type -AssemblyName "System.IO.Compression.FileSystem"; \ | ||||
| [System.IO.Compression.ZipFile]::ExtractToDirectory('C:\temp-download\xz.zip', 'C:\xz-utils'); \ | ||||
| # --- 2. Download and decompress Clang --- \ | ||||
| Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.2/clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz" -OutFile "clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz" ; \ | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we pull the version number here into an
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||
| (Get-FileHash -Path "C:\temp-download\clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz" -Algorithm MD5).Hash -eq '0ae1d3effd9ab9d323f7fa595777f0a2' ; \ | ||||
| C:\xz-utils\bin_x86-64\xz.exe -d -qq clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz ; \ | ||||
| # --- 3. Extract clang --- \ | ||||
| C:\Windows\System32\tar.exe -xf clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar -C C:\clang ; \ | ||||
| # --- 4. Clean up --- \ | ||||
| Set-Location C:\ ; \ | ||||
| Remove-Item C:\temp-download -Recurse -Force; \ | ||||
| Remove-Item C:\xz-utils -Recurse -Force; \ | ||||
| # -- 5. Shorten path to clang files & remove unnecessary files -- \ | ||||
| Set-Location C:\clang ; \ | ||||
| Rename-Item -Path "C:\clang\clang+llvm-21.1.2-x86_64-pc-windows-msvc" -NewName "C:\clang\clang-msvc" ; \ | ||||
| Set-Location C:\clang\clang-msvc ; \ | ||||
| Remove-Item -Path C:\clang\clang-msvc\libexec -Recurse -Force ; \ | ||||
| Remove-Item -Path C:\clang\clang-msvc\share -Recurse -Force ; \ | ||||
| Rename-Item -Path "C:\clang\clang-msvc\bin" -NewName "C:\clang\clang-msvc\bin-full" ; \ | ||||
| New-Item -Path "C:\clang\clang-msvc\bin" -ItemType Directory -Force ; \ | ||||
| Set-Location C:\clang\clang-msvc\bin ; \ | ||||
| Copy-Item -Path C:\clang\clang-msvc\bin-full\*.dll -Destination C:\clang\clang-msvc\bin\. ; \ | ||||
| Copy-Item -Path C:\clang\clang-msvc\bin-full\clang-cl.exe -Destination C:\clang\clang-msvc\bin\. ; \ | ||||
| Copy-Item -Path C:\clang\clang-msvc\bin-full\lld-link.exe -Destination C:\clang\clang-msvc\bin\. ; \ | ||||
| Set-Location C:\clang\clang-msvc ; \ | ||||
| Remove-Item -Path C:\clang\clang-msvc\bin-full -Recurse -Force ; | ||||
Uh oh!
There was an error while loading. Please reload this page.