ci(windows): make provision.ps1 self-sufficient (dedicated user, parser-bug fix); refresh stale workflow comments
build-windows / build-windows-x64 (push) Successful in 1h20m4s
build-windows / build-windows-x64 (push) Successful in 1h20m4s
This commit is contained in:
@@ -87,9 +87,10 @@ jobs:
|
||||
- name: Ensure Rust toolchain configured for runner user
|
||||
shell: pwsh
|
||||
run: |
|
||||
# provision.ps1 ran rustup as an admin user; act_runner runs as LocalSystem
|
||||
# which has its own (empty) $RUSTUP_HOME. Bootstrap the default toolchain
|
||||
# for LocalSystem on first run -- subsequent runs are no-ops.
|
||||
# provision.ps1 installs rust machine-wide (CARGO_HOME=C:\cargo,
|
||||
# RUSTUP_HOME=C:\rustup) so this is normally a no-op verification.
|
||||
# Kept as a guardrail in case the runner was provisioned with an
|
||||
# older script or by hand.
|
||||
rustup --version
|
||||
rustup toolchain install $env:RUST_VERSION --profile minimal --component rustfmt
|
||||
if ($LASTEXITCODE -ne 0) { throw "rustup toolchain install failed ($LASTEXITCODE)" }
|
||||
@@ -102,9 +103,9 @@ jobs:
|
||||
- name: Install flutter_rust_bridge codegen tools
|
||||
shell: pwsh
|
||||
run: |
|
||||
# Pin the install destination with --root so we don't have to guess at
|
||||
# the runner's $USERPROFILE (act_runner runs as LocalSystem on this host,
|
||||
# which makes $USERPROFILE a non-obvious system path).
|
||||
# Pin the install destination with --root so the resulting binaries land
|
||||
# in a deterministic, machine-wide path regardless of which user the
|
||||
# runner service is configured to run as.
|
||||
$tools = 'C:\cargo-tools'
|
||||
New-Item -ItemType Directory -Force -Path "$tools\bin" | Out-Null
|
||||
|
||||
@@ -257,14 +258,13 @@ jobs:
|
||||
fi
|
||||
fi
|
||||
|
||||
# The monolithic `python build.py` invocation that the upstream GitHub
|
||||
# workflow uses runs cargo and `flutter build windows` back-to-back. On this
|
||||
# self-hosted runner, *something* during the ~14min cargo build wipes out
|
||||
# flutter/windows, which then makes the subsequent flutter build fail with
|
||||
# "source directory does not exist" -- even though the diagnostic step
|
||||
# immediately above confirms the dir is fully present at that moment.
|
||||
# Splitting the build into discrete steps lets us restore flutter/windows
|
||||
# right before flutter needs it, after cargo has finished.
|
||||
# The upstream GitHub workflow runs `python build.py` which chains cargo +
|
||||
# `flutter build windows` in one step. We split that here so we can:
|
||||
# - get a checkpoint between cargo and flutter (~14 min apart)
|
||||
# - restore flutter/windows from git index if anything has clobbered it
|
||||
# (early in our self-hosted bring-up, flutter/windows occasionally
|
||||
# vanished during the cargo phase under LocalSystem; the restore is
|
||||
# defensive and a no-op once the runner is on a normal user)
|
||||
|
||||
- name: Cargo build (virtual_display dylib + main lib)
|
||||
shell: pwsh
|
||||
@@ -282,10 +282,9 @@ jobs:
|
||||
throw "target\release\librustdesk.dll missing after cargo build"
|
||||
}
|
||||
|
||||
# Restore + build are intentionally one step. flutter/windows has been
|
||||
# observed to disappear between steps on this runner (cause unidentified --
|
||||
# likely Windows Defender quarantine, possibly act_runner workspace handling).
|
||||
# Keeping them atomic eliminates any window of opportunity for that to happen.
|
||||
# Restore + build are intentionally one step. Closes any potential window
|
||||
# for flutter/windows to vanish between a separate restore step and the
|
||||
# build, regardless of root cause.
|
||||
- name: Flutter build windows (with last-second restore)
|
||||
shell: pwsh
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user