@@ -125,11 +125,70 @@ jobs:
125125 - name : Install LLVM Tools (Windows)
126126 if : matrix.os == 'windows-latest'
127127 run : |
128+ Write-Host "==== Installing LLVM with Chocolatey ===="
128129 choco install llvm
129- echo "C:/Program Files/LLVM/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
130- # Verify installation
131- Get-Command llc.exe -ErrorAction SilentlyContinue | Out-String
132- & "C:/Program Files/LLVM/bin/llc.exe" --version
130+
131+ Write-Host "==== Checking Environment ===="
132+ Write-Host "Current PATH: $env:Path"
133+ Write-Host "Chocolatey binaries: $(Get-ChildItem -Path 'C:\ProgramData\chocolatey\bin' -ErrorAction SilentlyContinue | ForEach-Object { $_.Name })"
134+
135+ # Find the LLVM installation
136+ Write-Host "==== Locating LLVM Installation ===="
137+ Write-Host "Checking if llc.exe is in PATH..."
138+ $llcCmd = Get-Command llc -ErrorAction SilentlyContinue
139+ if ($llcCmd) {
140+ $llvmPath = $llcCmd.Source
141+ Write-Host "Found llc.exe in PATH at: $llvmPath"
142+ } else {
143+ Write-Host "llc.exe not found in PATH, checking common locations..."
144+ $possiblePaths = @(
145+ "C:\Program Files\LLVM\bin\llc.exe",
146+ "C:\Program Files (x86)\LLVM\bin\llc.exe",
147+ "C:\ProgramData\chocolatey\bin\llc.exe",
148+ "C:\ProgramData\chocolatey\lib\llvm\tools\LLVM\bin\llc.exe"
149+ )
150+ foreach ($path in $possiblePaths) {
151+ Write-Host "Checking $path..."
152+ if (Test-Path $path) {
153+ $llvmPath = $path
154+ Write-Host "Found llc.exe at: $path"
155+ break
156+ } else {
157+ Write-Host "$path does not exist"
158+ }
159+ }
160+ }
161+
162+ if (-not $llvmPath) {
163+ Write-Host "==== LLVM Search: Broad Scan ===="
164+ Write-Host "llc.exe not found in common locations. Searching Chocolatey directories..."
165+ Get-ChildItem -Path "C:\ProgramData\chocolatey" -Filter "llc.exe" -Recurse -ErrorAction SilentlyContinue | ForEach-Object { Write-Host "Found at: $($_.FullName)" }
166+
167+ Write-Host "Searching Program Files..."
168+ Get-ChildItem -Path "C:\Program Files" -Filter "llc.exe" -Recurse -ErrorAction SilentlyContinue | ForEach-Object { Write-Host "Found at: $($_.FullName)" }
169+
170+ # Find any LLVM directories
171+ Write-Host "==== Looking for LLVM directories ===="
172+ Get-ChildItem -Path "C:\" -Directory -Filter "*LLVM*" -Recurse -ErrorAction SilentlyContinue | ForEach-Object { Write-Host "LLVM directory: $($_.FullName)" }
173+
174+ throw "Could not locate llc.exe. Please check the logs for LLVM installation details."
175+ }
176+
177+ Write-Host "==== LLVM Configuration ===="
178+ $llvmBinDir = Split-Path -Parent $llvmPath
179+ Write-Host "LLVM bin directory: $llvmBinDir"
180+ Write-Host "Files in LLVM bin directory: $(Get-ChildItem -Path $llvmBinDir -ErrorAction SilentlyContinue | ForEach-Object { $_.Name })"
181+
182+ Write-Host "Adding LLVM bin directory to PATH: $llvmBinDir"
183+ echo $llvmBinDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
184+ $env:Path += ";$llvmBinDir"
185+
186+ # Verify by running llc
187+ Write-Host "==== Verifying LLVM Installation ===="
188+ Write-Host "Running: & $llvmPath --version"
189+ & $llvmPath --version
190+
191+ Write-Host "==== LLVM Installation Complete ===="
133192
134193 - name : Compile tests
135194 run : cargo test --no-run
0 commit comments