@@ -98,3 +98,37 @@ RUN powershell -Command \
9898 Add-Type -AssemblyName System.IO.Compression.FileSystem ; \
9999 [System.IO.Compression.ZipFile]::ExtractToDirectory(' actions-runner-win.zip', $PWD) ;\
100100 rm actions-runner-win.zip
101+
102+ # Download and extract Clang compiler.
103+ # Create directories, download, extract, and clean up all in one layer
104+ RUN powershell -Command \
105+ # --- Setup directories --- \
106+ Write-Host "Creating directories..."; \
107+ New-Item -Path "C:\t emp-download" -ItemType "Directory" -Force ; \
108+ New-Item -Path "C:\x z-utils" -ItemType "Directory" -Force ; \
109+ New-Item -Path "C:\c lang" -ItemType "Directory" -Force ; \
110+ # --- 1. Download and extract xz --- \
111+ Set-Location C:\t emp-download ; \
112+ Write-Host "Downloading xz-utils..."; \
113+ Invoke-WebRequest -Uri "http://github.com/tukaani-project/xz/releases/download/v5.8.1/xz-5.8.1-windows.zip" -OutFile "xz.zip"; \
114+ Write-Host "Extracting xz-utils..."; \
115+ Add-Type -AssemblyName "System.IO.Compression.FileSystem"; \
116+ [System.IO.Compression.ZipFile]::ExtractToDirectory(' C:\t emp-download\x z.zip', ' C:\x z-utils'); \
117+ # --- 2. Download and decompress Clang --- \
118+ Write-Host "Downloading Clang..."; \
119+ Invoke-WebRequest -Uri "http://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" ; \
120+ Write-Host "Decompressing clang.tar.xz using C:\x z-utils\b in_x86-64\x z.exe"; \
121+ C:\x z-utils\b in_x86-64\x z.exe -d -qq clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz ; \
122+ # --- 3. Extract clang --- \
123+ Write-Host "Extracting clang.tar to C:\c lang ..."; \
124+ C:\W indows\S ystem32\t ar.exe -xf clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar -C C:\c lang ; \
125+ # --- 4. Clean up --- \
126+ Write-Host "Cleaning up..." ; \
127+ Set-Location C:\ ; \
128+ Remove-Item C:\t emp-download -Recurse -Force; \
129+ Remove-Item C:\x z-utils -Recurse -Force; \
130+ Write-Host "Download and extraction complete." ;
131+
132+ RUN powershell -Command \
133+ Set-Location C:\c lang ; \
134+ Rename-Item -Path "C:\c lang\c lang+llvm-21.1.2-x86_64-pc-windows-msvc" -NewName "C:\c lang\c lang-msvc" ;
0 commit comments