fix(ci): support older MinGW and Nix builds

Declare the Windows API level required by the terminal proxy so Ubuntu 22.04 MinGW exposes CancelSynchronousIo. Patch script shebangs inside the Nix sandbox, install the target-triple Rust binary through the shared staging script, and keep Nix CI resource usage bounded.
This commit is contained in:
Xuc Pan committed 2026-09-05 13:33:25 +08:00
1 parent 611383544b
commit 0d0820da7e
4 files changed
+11 -3

No files matched your search

+2 -1
View File
@@ -80,4 +80,5 @@ jobs:
- name: Evaluate and build the flake
run: |
nix flake check --no-build
nix build .#uur
CARGO_BUILD_JOBS=1 NIX_BUILD_CORES=1 \
nix build .#uur --max-jobs 1 --cores 1
+1
View File
@@ -1,4 +1,5 @@
#define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT 0x0600
#include <winsock2.h>
#include <windows.h>
+6 -1
View File
@@ -41,6 +41,10 @@ rustPlatform.buildRustPackage {
UUR_BUILD_SHELL = runtimeShell;
doCheck = false;
postPatch = ''
patchShebangs hook/build.sh capture/build.sh packaging/stage.sh
'';
postBuild = ''
UU_MINGW_CC=${windowsCC}/bin/${targetPrefix}cc \
UU_MINGW_STRIP=${windowsBinutils}/bin/${targetPrefix}strip \
@@ -51,7 +55,8 @@ rustPlatform.buildRustPackage {
installPhase = ''
runHook preInstall
./packaging/stage.sh "$out" ""
UUR_BINARY=target/${stdenv.hostPlatform.rust.rustcTarget}/release/uur \
./packaging/stage.sh "$out" ""
wrapProgram "$out/bin/uur" \
--prefix PATH : ${lib.makeBinPath [
curl
+2 -1
View File
@@ -4,8 +4,9 @@ set -euo pipefail
project_root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd -P)
destination=${1:?usage: packaging/stage.sh DESTDIR [PREFIX]}
prefix=${2-/usr}
uur_binary=${UUR_BINARY:-$project_root/target/release/uur}
install -Dm0755 "$project_root/target/release/uur" \
install -Dm0755 "$uur_binary" \
"$destination$prefix/bin/uur"
install -Dm0755 "$project_root/capture/uur-pw-capture" \
"$destination$prefix/lib/uur/uur-pw-capture"