cyx-6 commented on code in PR #254:
URL: https://github.com/apache/tvm-ffi/pull/254#discussion_r2995321245


##########
addons/tvm-ffi-orcjit/scripts/install_llvm.ps1:
##########
@@ -0,0 +1,98 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Install LLVM from conda-forge using micromamba (Windows).
+# Usage: powershell -ExecutionPolicy Bypass -File tools/install_llvm.ps1 
[version]
+#   version defaults to LLVM_VERSION env var, then 22.1.0
+
+param(
+    [string]$Version = ""
+)
+
+$ErrorActionPreference = "Stop"
+Set-StrictMode -Version Latest
+
+if (-not $Version) {
+    $Version = if ($env:LLVM_VERSION) { $env:LLVM_VERSION } else { "22.1.0" }
+}
+$Prefix = if ($env:LLVM_PREFIX) { $env:LLVM_PREFIX } else { "C:\opt\llvm" }
+
+Write-Host "Installing LLVM $Version to $Prefix"
+
+# Install micromamba from GitHub releases (micro.mamba.pm cert expired as of 
2026-03)
+$MicromambaExe = "$env:TEMP\micromamba.exe"
+
+if (-not (Test-Path $MicromambaExe)) {
+    Write-Host "Downloading micromamba from GitHub releases..."
+    $maxRetries = 3
+    for ($attempt = 1; $attempt -le $maxRetries; $attempt++) {
+        try {
+            & curl.exe -sSL -o $MicromambaExe 
"https://github.com/mamba-org/micromamba-releases/releases/latest/download/micromamba-win-64.exe";
+            if ($LASTEXITCODE -ne 0) { throw "curl failed with exit code 
$LASTEXITCODE" }
+            break
+        } catch {
+            Write-Host "Attempt $attempt/$maxRetries failed: $_"
+            if ($attempt -eq $maxRetries) { throw }
+            Start-Sleep -Seconds 5
+        }
+    }
+}
+Write-Host "Using micromamba: $MicromambaExe"
+
+# Install LLVM and zlib. No clangdev or compiler-rt on Windows — test objects
+# use C-only strategy compiled with the system compiler (MSVC), and liborc_rt
+# is not used (Windows ORC JIT skips COFFPlatform).
+& $MicromambaExe create -p $Prefix -c conda-forge `
+    "llvmdev=$Version" `
+    zlib `
+    -y
+if ($LASTEXITCODE -ne 0) { throw "micromamba create failed" }
+
+# Build static zstd from source.

Review Comment:
   scripts removed in new workflow



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to