Files
471dd56640 feat(windows): cross target, and quit ui-host with WM_QUIT instead of hard-killing it (#23)
* feat(windows): wire the view-module-runtime for x86_64-windows

Routes through logos-nix.lib.forAllTargets, widens meta.platforms, and
picks up Qt's host-tool cmake flags (empty natively).

wrapQtAppsHook is GATED rather than removed: it fails to EVALUATE for a
mingw host, and wrap-qt-apps-hook.sh would skip a PE anyway
(`isELF || isMachO || continue`) -- but removing it outright would change
native behaviour. dontWrapQtApps = true is the mandatory other half, or
qtbase's own setup hook hard-errors with "depends on qtbase, but no
wrapping behavior was specified".

Windows and native (aarch64-darwin) both evaluate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(windows): quit ui-host with WM_QUIT instead of hard-killing it

QProcess::terminate() cannot stop ui-host on Windows, so every UI-plugin
teardown paid the full 3s grace period and then TerminateProcess.

MEASURED, not inferred. terminate() on Windows is EnumWindows(WM_CLOSE) plus
PostThreadMessage(tid, WM_CLOSE) (qprocess_win.cpp:648-653). ui-host owns ZERO
windows -- it is a bare QCoreApplication linking no Qt6::Gui at all
(ui-host/main.cpp:70, CMakeLists.txt:78-86); the QQuickWidget lives in the
PARENT and ui-host only remotes the plugin object over QtRO. So the enumeration
finds nothing. A controlled zero, not a broken command: the same enumeration in
the same run found 7 windows for Basecamp, including the two never-shown QPA
observer windows a GUI process must own. The thread message IS delivered, but
Qt's dispatcher only branches on WM_QUIT (qeventdispatcher_win.cpp:545-548) --
WM_CLOSE falls through to a no-op for a thread message. terminate() returns
void, so it "succeeds" having done nothing.

A/B against the shipped ui-host.exe: replicating terminate() byte-exactly left
it ALIVE past the full 3000ms; PostThreadMessage(WM_QUIT) exited it in 8ms with
code 0. End to end through the real teardown path (graceful Basecamp quit with
package_manager_ui loaded), same harness and trigger, only the payload differing:

  shipped   ui-host exit 3905ms  code 62097 (0xF291 Qt kill)  "did not exit gracefully" present
  fixed     ui-host exit  690ms  code 0                       warning absent
  (Basecamp total 4395ms -> 1186ms)

REPLACES terminate() on Windows rather than preceding it. An earlier draft
inserted WM_QUIT above the existing terminate()+3000+kill+1000, which would have
made the worst case 6000ms -- worse than today while claiming to improve it.
Since terminate() was measured to be dead time here, keeping it buys nothing:
the ceiling stays 4000ms and the typical case is now sub-second. This also
matches logos-container-subprocess, which REPLACES its equally no-op
request_exit() rather than supplementing it.

The POSIX path is byte-identical -- the original block is preserved verbatim
inside #else; git diff shows zero removed lines.

Getting the child's main THREAD id is the one subtle part. QProcess does not
expose it, but CreateProcessArguments carries the PROCESS_INFORMATION pointer it
hands to CreateProcess. The modifier runs BEFORE CreateProcess, so dwThreadId is
not populated yet: capture the pointer there, read through it once started() has
fired, and null it immediately -- QProcess owns that allocation and frees it in
cleanup(). No CreateProcessW reimplementation and no Toolhelp32 snapshot needed.

NOT fixed here, deliberately: orphan reaping is absent on Windows. ui-host's
setsid + PR_SET_PDEATHSIG + getppid watchdog are wholly inside #ifndef _WIN32
(ui-host/main.cpp:40-68) and ViewModuleHost assigns no Job Object, so a Basecamp
crash leaks ui-host.exe. That is a real second defect, but it is an untested
process-lifetime change and does not belong bundled into a latency fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore(deps): re-pin the L1-L4 inputs to their merged revs

logos-nix (L1), logos-protocol (L2), logos-cpp-sdk (L3) and logos-qt-sdk (L4)
are all on their default branches now, so the lock can name the merged revs
instead of the pre-merge branch tips it was resolving against while those PRs
were open.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 14:49:08 -03:00

231 lines
5.6 KiB
JSON

{
"nodes": {
"logos-cpp-sdk": {
"inputs": {
"logos-lidl": "logos-lidl",
"logos-nix": [
"logos-nix"
],
"logos-protocol": "logos-protocol",
"nixpkgs": [
"logos-cpp-sdk",
"logos-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1786467089,
"narHash": "sha256-225xM64Ym9loeIOgS8W3Qc0iKHtpLbQVAaO9ppBpLQc=",
"owner": "logos-co",
"repo": "logos-cpp-sdk",
"rev": "e3744fb84ceff2dc7cb1630a1301bb93c64d7a8a",
"type": "github"
},
"original": {
"owner": "logos-co",
"repo": "logos-cpp-sdk",
"type": "github"
}
},
"logos-lidl": {
"inputs": {
"logos-nix": [
"logos-cpp-sdk",
"logos-nix"
],
"nixpkgs": [
"logos-cpp-sdk",
"logos-lidl",
"logos-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1786415321,
"narHash": "sha256-Oe98SavQSVGBIY7WIc8RQ5l+Bl4KLsdmjb+PyscfdNw=",
"owner": "logos-co",
"repo": "logos-lidl",
"rev": "ffeebf2e90fa0c65e8c486988271fe0ca029d1e1",
"type": "github"
},
"original": {
"owner": "logos-co",
"repo": "logos-lidl",
"type": "github"
}
},
"logos-lidl_2": {
"inputs": {
"logos-nix": [
"logos-qt-sdk",
"logos-nix"
],
"nixpkgs": [
"logos-qt-sdk",
"logos-lidl",
"logos-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1786415321,
"narHash": "sha256-Oe98SavQSVGBIY7WIc8RQ5l+Bl4KLsdmjb+PyscfdNw=",
"owner": "logos-co",
"repo": "logos-lidl",
"rev": "ffeebf2e90fa0c65e8c486988271fe0ca029d1e1",
"type": "github"
},
"original": {
"owner": "logos-co",
"repo": "logos-lidl",
"type": "github"
}
},
"logos-nix": {
"inputs": {
"nixpkgs": "nixpkgs",
"nixpkgs-windows": "nixpkgs-windows"
},
"locked": {
"lastModified": 1786399295,
"narHash": "sha256-Bl1A0UgsIXioZw5uEW8Jl5u7FfZcFMnpYlpsdezFwK0=",
"owner": "logos-co",
"repo": "logos-nix",
"rev": "6e0f4a7120fced10829b0b3a698ff619a11d4605",
"type": "github"
},
"original": {
"owner": "logos-co",
"repo": "logos-nix",
"type": "github"
}
},
"logos-protocol": {
"inputs": {
"logos-nix": [
"logos-cpp-sdk",
"logos-nix"
],
"nixpkgs": [
"logos-cpp-sdk",
"logos-protocol",
"logos-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1786452265,
"narHash": "sha256-yEBT+tG6jD26tcVixy3OYGO+gYmcyzrwR5uZVGqVTOs=",
"owner": "logos-co",
"repo": "logos-protocol",
"rev": "03842db5c1496f5ab29ba35ac0016b6b1f5048ba",
"type": "github"
},
"original": {
"owner": "logos-co",
"repo": "logos-protocol",
"type": "github"
}
},
"logos-protocol_2": {
"inputs": {
"logos-nix": [
"logos-nix"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1786452265,
"narHash": "sha256-yEBT+tG6jD26tcVixy3OYGO+gYmcyzrwR5uZVGqVTOs=",
"owner": "logos-co",
"repo": "logos-protocol",
"rev": "03842db5c1496f5ab29ba35ac0016b6b1f5048ba",
"type": "github"
},
"original": {
"owner": "logos-co",
"repo": "logos-protocol",
"type": "github"
}
},
"logos-qt-sdk": {
"inputs": {
"logos-cpp-sdk": [
"logos-cpp-sdk"
],
"logos-lidl": "logos-lidl_2",
"logos-nix": [
"logos-nix"
],
"logos-protocol": [
"logos-protocol"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1786469121,
"narHash": "sha256-8sM8d98dquIUOcu9YRlAnpRZ5zcTqWCZii5AyhCwi1k=",
"owner": "logos-co",
"repo": "logos-qt-sdk",
"rev": "c6be61d0ba3f1c06c1a5ff7ad6d42f3eda254877",
"type": "github"
},
"original": {
"owner": "logos-co",
"repo": "logos-qt-sdk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1759036355,
"narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-windows": {
"locked": {
"lastModified": 1782723713,
"narHash": "sha256-oPXCU/SSUokcGaJREHibG1CBX3+s/W7orDWQOZDsEeQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b5aa0fbd538984f6e3d201be0005b4463d8b09f8",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b5aa0fbd538984f6e3d201be0005b4463d8b09f8",
"type": "github"
}
},
"root": {
"inputs": {
"logos-cpp-sdk": "logos-cpp-sdk",
"logos-nix": "logos-nix",
"logos-protocol": "logos-protocol_2",
"logos-qt-sdk": "logos-qt-sdk",
"nixpkgs": [
"logos-nix",
"nixpkgs"
]
}
}
},
"root": "root",
"version": 7
}