mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
There is currently [a bug in UV](https://github.com/astral-sh/uv/issues/12906) that results in it using the x64 flavor of Python when running on Arm64 Windows. This then causes all Python scripts to believe they are on an x64 device and so Server installs the wrong dependencies and builds for the wrong architecture. Testing: Local on my Arm64 Windows device Contributes to fixing #40611 Signed-off-by: Daniel Paoliello <daniel@meta-sys.info>
32 lines
1.0 KiB
PowerShell
32 lines
1.0 KiB
PowerShell
$workdir = $PSScriptRoot
|
|
$arguments = $args
|
|
$expanded = $false
|
|
if ($arguments.Count -gt 0) {
|
|
$expandedArgs = @()
|
|
foreach ($arg in $arguments) {
|
|
if ($arg -match '[\*\?\[\]]') {
|
|
$expandedItems = Get-Item -Path $arg -ErrorAction SilentlyContinue
|
|
if ($expandedItems) {
|
|
$expandedArgs += $expandedItems | Select-Object -ExpandProperty FullName
|
|
$expanded = $true
|
|
} else {
|
|
# Expansion fails. Use original arg.
|
|
$expandedArgs += $arg
|
|
}
|
|
} else {
|
|
$expandedArgs += $arg
|
|
}
|
|
}
|
|
$arguments = $expandedArgs
|
|
if ($expanded){
|
|
Write-Host "Expanded arguments: $arguments"
|
|
}
|
|
}
|
|
|
|
# UV defaults to x86_64 Python on Arm64, so we need to override that.
|
|
# https://github.com/astral-sh/uv/issues/12906
|
|
if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq 'Arm64') {
|
|
$env:UV_PYTHON='arm64'
|
|
}
|
|
|
|
uv run --frozen python (Join-Path $workdir "mach") @arguments |