fix: repair platform dependency and Windows CI inputs

This commit is contained in:
Kevin Yue committed 2026-11-18 13:56:08 +08:00
1 parent b4c1dc1647
commit 345ac209fd
7 files changed
+28 -11

No files matched your search

+3 -2
View File
@@ -3,6 +3,7 @@
[CmdletBinding()]
param(
[string]$MsysRoot = 'C:\msys64',
[ValidateSet('mingw64','ucrt64')][string]$MsysSubsystem = 'mingw64',
[string]$Prefix,
[int]$Jobs = 4
)
@@ -13,7 +14,7 @@ $Prefix = [System.IO.Path]::GetFullPath($Prefix)
$bash = Join-Path $MsysRoot 'usr\bin\bash.exe'
if (!(Test-Path $bash)) { throw 'MSYS2 is required to build OpenConnect.' }
$ErrorActionPreference = 'Continue'
& $bash "$PSScriptRoot/build-openconnect-windows.sh" $repo $Prefix $Jobs
& $bash "$PSScriptRoot/build-openconnect-windows.sh" $repo $Prefix $Jobs $MsysSubsystem
$nativeExit = $LASTEXITCODE
$ErrorActionPreference = 'Stop'
if ($nativeExit -ne 0) { throw 'OpenConnect compilation failed.' }
@@ -49,7 +50,7 @@ while ($pending.Count) {
foreach ($line in $dependencies) {
if ($line -notmatch '^\s+(\S+\.dll)\s*$') { continue }
$name = $Matches[1]
$source = Join-Path "$MsysRoot\mingw64\bin" $name
$source = Join-Path "$MsysRoot\$MsysSubsystem\bin" $name
if (Test-Path $source) {
$target = Join-Path "$Prefix\bin" $name
Copy-Item $source $target -Force
+3 -2
View File
@@ -1,11 +1,12 @@
#!/usr/bin/env bash
# Build the bundled protocol library with MSYS2's native Windows compiler.
set -euo pipefail
export PATH="/mingw64/bin:/usr/bin:$PATH"
subsystem=$4
export PATH="/$subsystem/bin:/usr/bin:$PATH"
repo=$(cygpath -u "$1")
prefix=$(cygpath -u "$2")
jobs=$3
export ACLOCAL_PATH=/mingw64/share/aclocal
export ACLOCAL_PATH="/$subsystem/share/aclocal"
source_dir="$repo/crates/openconnect/deps/openconnect"
build_dir="$repo/target/openconnect-windows"
cd "$source_dir"
+3 -2
View File
@@ -1,6 +1,7 @@
[CmdletBinding()]
param([string]$MsysRoot = 'C:\msys64', [string]$Prefix = $env:OPENCONNECT_WINDOWS_PREFIX)
param([string]$MsysRoot = 'C:\msys64', [string]$Prefix = $env:OPENCONNECT_WINDOWS_PREFIX,
[ValidateSet('mingw64','ucrt64')][string]$MsysSubsystem = 'mingw64')
$repo = Split-Path $PSScriptRoot -Parent
if (!$Prefix) { $Prefix = Join-Path $repo 'target\native-windows' }
& "$MsysRoot\usr\bin\bash.exe" "$PSScriptRoot/test-openconnect-windows.sh" $repo $Prefix
& "$MsysRoot\usr\bin\bash.exe" "$PSScriptRoot/test-openconnect-windows.sh" $repo $Prefix $MsysSubsystem
if ($LASTEXITCODE -ne 0) { throw 'Native OpenConnect packet-pipe tests failed.' }
+2 -1
View File
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
# Run the native packet-pipe regression against the bundled Windows DLL.
set -euo pipefail
export PATH="/mingw64/bin:/usr/bin:$PATH"
subsystem=$3
export PATH="/$subsystem/bin:/usr/bin:$PATH"
repo=$(cygpath -u "$1")
prefix=$(cygpath -u "$2")
build_dir="$repo/target/openconnect-windows"