fix
This commit is contained in:
1 file changed
+126
-22
+126
-22
@@ -440,50 +440,150 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
if (-not (Test-Path "rustdesk\flutter\windows\CMakeLists.txt")) {
|
$repo = (Resolve-Path "rustdesk").Path
|
||||||
Write-Host "flutter/windows missing, restoring from Git..."
|
$windowsDir = Join-Path $repo "flutter\windows"
|
||||||
|
$windowsCmake = Join-Path $windowsDir "CMakeLists.txt"
|
||||||
|
|
||||||
|
if (-not (Test-Path $windowsCmake)) {
|
||||||
|
Write-Host "flutter/windows missing before build, restoring from Git..."
|
||||||
|
|
||||||
git `
|
git `
|
||||||
-C rustdesk `
|
-C $repo `
|
||||||
restore `
|
restore `
|
||||||
--source=HEAD `
|
--source=HEAD `
|
||||||
-- `
|
-- `
|
||||||
flutter/windows
|
flutter/windows
|
||||||
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
throw "Unable to restore flutter/windows"
|
throw "Unable to restore flutter/windows before build"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not (Test-Path "rustdesk\flutter\windows\CMakeLists.txt")) {
|
if (-not (Test-Path $windowsCmake)) {
|
||||||
throw "flutter/windows/CMakeLists.txt is still missing"
|
throw "flutter/windows/CMakeLists.txt is missing before build"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Windows Flutter project:"
|
Write-Host "===== Windows Flutter project before Rust build ====="
|
||||||
Get-Item "rustdesk\flutter\windows\CMakeLists.txt"
|
Get-Item $windowsCmake
|
||||||
|
|
||||||
Set-Location rustdesk
|
# Reproduce the Windows part of RustDesk 1.4.9 build.py manually.
|
||||||
|
# This lets us restore flutter/windows AFTER `flutter pub get` and
|
||||||
|
# BEFORE CMake is started.
|
||||||
|
|
||||||
python `
|
Write-Host "`n===== Build virtual display dylib ====="
|
||||||
.\build.py `
|
|
||||||
--portable `
|
Push-Location (Join-Path $repo "libs\virtual_display\dylib")
|
||||||
--flutter `
|
try {
|
||||||
--skip-portable-pack `
|
cargo build --locked --release
|
||||||
--hwcodec `
|
|
||||||
--vram
|
|
||||||
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
throw "RustDesk build failed"
|
throw "virtual_display dylib build failed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
Pop-Location
|
||||||
}
|
}
|
||||||
|
|
||||||
$release = `
|
Write-Host "`n===== Build RustDesk Rust library ====="
|
||||||
".\flutter\build\windows\x64\runner\Release"
|
|
||||||
|
|
||||||
if (-not (Test-Path "$release\rustdesk.exe")) {
|
Push-Location $repo
|
||||||
|
try {
|
||||||
|
cargo build `
|
||||||
|
--locked `
|
||||||
|
--features "hwcodec,vram,flutter" `
|
||||||
|
--lib `
|
||||||
|
--release
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "RustDesk Rust library build failed"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not (Test-Path ".\target\release\librustdesk.dll")) {
|
||||||
|
throw "target\release\librustdesk.dll was not produced"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
Pop-Location
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "`n===== Flutter pub get ====="
|
||||||
|
|
||||||
|
$flutterDir = Join-Path $repo "flutter"
|
||||||
|
|
||||||
|
Push-Location $flutterDir
|
||||||
|
try {
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "flutter pub get failed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
Pop-Location
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "`n===== Restore Windows project after pub get ====="
|
||||||
|
|
||||||
|
# The failing runs showed that flutter/windows existed before
|
||||||
|
# build.py, but CMake could no longer see it after Flutter's
|
||||||
|
# dependency-resolution phase. Restore it at the last possible
|
||||||
|
# point, then build with --no-pub so Flutter does not run pub get
|
||||||
|
# again before invoking CMake.
|
||||||
|
git `
|
||||||
|
-C $repo `
|
||||||
|
restore `
|
||||||
|
--source=HEAD `
|
||||||
|
-- `
|
||||||
|
flutter/windows
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "Unable to restore flutter/windows after flutter pub get"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not (Test-Path $windowsCmake)) {
|
||||||
|
throw "flutter/windows/CMakeLists.txt is missing after restore"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Windows Flutter project immediately before CMake:"
|
||||||
|
Get-Item $windowsCmake
|
||||||
|
|
||||||
|
Write-Host "`n===== Flutter Windows release build ====="
|
||||||
|
|
||||||
|
Push-Location $flutterDir
|
||||||
|
try {
|
||||||
|
flutter build windows --release --no-pub
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "Flutter Windows build failed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
Pop-Location
|
||||||
|
}
|
||||||
|
|
||||||
|
$release = Join-Path `
|
||||||
|
$repo `
|
||||||
|
"flutter\build\windows\x64\runner\Release"
|
||||||
|
|
||||||
|
if (-not (Test-Path (Join-Path $release "rustdesk.exe"))) {
|
||||||
throw "rustdesk.exe was not produced"
|
throw "rustdesk.exe was not produced"
|
||||||
}
|
}
|
||||||
|
|
||||||
$packageDir = ".\dist\rustdesk"
|
# build.py normally copies this DLL into the Flutter Release bundle.
|
||||||
|
$virtualDisplayDll = Join-Path `
|
||||||
|
$repo `
|
||||||
|
"target\release\deps\dylib_virtual_display.dll"
|
||||||
|
|
||||||
|
if (-not (Test-Path $virtualDisplayDll)) {
|
||||||
|
throw "dylib_virtual_display.dll was not produced"
|
||||||
|
}
|
||||||
|
|
||||||
|
Copy-Item `
|
||||||
|
$virtualDisplayDll `
|
||||||
|
(Join-Path $release "dylib_virtual_display.dll") `
|
||||||
|
-Force
|
||||||
|
|
||||||
|
$packageDir = Join-Path $repo "dist\rustdesk"
|
||||||
|
|
||||||
Remove-Item `
|
Remove-Item `
|
||||||
$packageDir `
|
$packageDir `
|
||||||
@@ -502,7 +602,11 @@ jobs:
|
|||||||
-Recurse `
|
-Recurse `
|
||||||
-Force
|
-Force
|
||||||
|
|
||||||
Write-Host "RustDesk main build OK"
|
Write-Host ""
|
||||||
|
Write-Host "====================================="
|
||||||
|
Write-Host "RustDesk main Windows build completed"
|
||||||
|
Write-Host "====================================="
|
||||||
|
Write-Host "Release: $release"
|
||||||
|
|
||||||
- name: Build WindowInjection.dll
|
- name: Build WindowInjection.dll
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|||||||
Reference in new issue
Block a user