Commit Graph
132 Commits
Author SHA1 Message Date
lucannez64 5059119151 fix: redact Riot tokens and make session cleanup preserve process identity
Signed-off-by: lucannez64 <[email protected]>
2026-10-26 18:05:26 +01:00
lucannez64 aa5beb39d3 Merge commit 'refs/review/mint-150' into fix/mint-review-integration
Signed-off-by: lucannez64 <[email protected]>

# Conflicts:
#	.github/workflows/source-check.yml
2026-10-26 18:02:48 +01:00
lucannez64 2142b54d94 Merge commit 'refs/review/mint-148' into fix/mint-review-integration 2026-10-26 18:02:11 +01:00
lucannez64 dd11b7a91b Merge commit 'refs/review/mint-147' into fix/mint-review-integration 2026-10-26 18:02:11 +01:00
lucannez64 c1f6a3fd12 Merge commit 'refs/review/mint-133' into fix/mint-review-integration 2026-10-26 18:02:10 +01:00
zero 6b8cf67ca4 fix(launcher): escalate after a forwarded signal and keep a failed cleanup failed
- a forwarded SIGINT/SIGTERM/SIGHUP now leaves the polling loop, so the
  five-second TERM grace and the SIGKILL fallback actually run; a loader that
  ignores SIGTERM no longer blocks the supervisor forever
- surviving guest processes now return a non-zero status instead of 0
- an invalid RCLOL_STOP_AFTER_CLIENT_SECONDS warns and disables the idle stop
  instead of aborting the launch with a traceback

Adds a regression test that sends SIGTERM to a loader and a descendant that
both ignore it, and asserts the process group is killed.

Signed-off-by: zero <zero@localhost>
2026-10-25 14:25:29 -06:00
MintMachineHQ 6a00849048 fix(preflight): require Vulkan 1.3 and timeline semaphores on the same device
vulkan_devices() flattened every apiVersion and check_vulkan() accepted any
timelineSemaphore = true, so a host with an old fast device and a new device
without timeline semaphores could pass without a usable device. Each GPUn
block is now one record, and one device must report both.

The full dump supplies the features and --summary the versions, matched by
GPU index. A dump without feature sections still gets the version check, and a
summary that lists no device is a required failure.

Adds three tests: a second device satisfies both, requirements are not
combined across devices, and no reported device.
2026-10-25 14:17:28 -06:00
MintMachineHQ c19c9ad47e fix(preflight): report a broken vulkaninfo, bound llvm-config and isolate tests
- an installed vulkaninfo that errors or times out is now a required failure
  with an actionable line; a missing one still only warns
- llvm_tools runs llvm-config with a 30 second timeout and reports it instead
  of hanging the preflight or the build
- RCLOL_PREFLIGHT_SOURCE overrides the prepared checkout, so the tests never
  scan (or fail on) a real build/darling-src

Adds four tests: missing vs broken vulkaninfo, and the two timeout paths.
2026-10-25 14:13:02 -06:00
MintMachineHQ fa18b2d04f feat(setup): check host versions before the build and the runtime install
setup failures reported in #137, #138 and #143 happened only after the long
fetch/build or at Riot startup. scripts/preflight.py now runs from
scripts/build.sh (before configure.py, so an old interpreter gets this message
and not a traceback) and from scripts/install-runtime.sh, and checks the host
once:

- python 3.10+, cmake 3.20+ (the bundled indium CMakeLists requires it),
  git-lfs 2.13+, kernel 5.14+ and LLVM 16+ exit nonzero with one actionable
  line each. RCLOL_SKIP_PREFLIGHT=1 bypasses the gate.
- llvm-objdump and llvm-nm are required, and unresolved names are explained.
- Vulkan 1.3 and timeline semaphores are required when vulkaninfo is
  installed; they only warn when it is not, because a missing tool does not
  mean a missing driver.
- the X display is probed with xdpyinfo in the environment Darling inherits.
  It only warns: a build does not need a display.
- a prepared build/darling-src is scanned for small .dylib/.a/.so/.o files
  that still contain Git LFS pointer text, which links but crashes the guest.
- --json prints the same report for the diagnostic tools.

The installers no longer call hashlib.file_digest (Python 3.11+), so Ubuntu
22.04's Python 3.10 works instead of failing after the overlays are built
(#137). A streaming tools/file_digest.py replaces it.

LLVM command line tools are resolved by tools/llvm_tools.py: an unversioned
name on PATH first, then the highest llvm-<tool>-<N>, then llvm-config
--bindir. Debian/Ubuntu install llvm-objdump and llvm-nm only under
/usr/lib/llvm-<N>/bin, which broke the runtime validation (#138). Six tools
now use it. The LLVM 16 floor also stops the LLVM 15 runtime abort from #139
before anything is built.

Two test helpers used APIs added after Python 3.10; they are shimmed so the
same suite runs on 3.10, 3.11 and 3.14.

Adds tests/test_preflight.py (24 tests, fake host tools only).
2026-10-25 13:58:25 -06:00
zero 2f594b568d fix(setup): repair a moved checkout instead of keeping stale paths
Moving the checkout to another path or account left three kinds of stale
state behind (issue #142):

- configure.py kept the previous home's default prefix. A saved prefix that
  was exactly <previous home>/.darling now follows the current host home; a
  user-chosen prefix is kept, and one inside the previous home is reported
  with the --prefix escape hatch.
- build/runtime/build was an absolute symlink, so it dangled after a move and
  the "not link.exists()" guard treated the dangling entry as absent. It is
  now a relative link and an absolute or dangling leftover is replaced. A
  real directory at that path is reported and left untouched.
- A CMake cache generated for another source directory made the build fail
  with permission errors against the old path. configure.py now reports the
  cache and the exact directory to remove, and never deletes it itself.

Patches are rendered at prepare.py time, so the report also points at the
re-render path. Documents the moved-checkout steps and the opt-in RenderDoc
diagnostic, which still expects files no setup script creates.

Adds 7 tests to tests/test_setup_portability.py.

Signed-off-by: zero <zero@localhost>
2026-10-25 13:26:54 -06:00
zero 97ff3df51d fix(launcher): supervise the guest session and clean up after it
The Riot Client does not exit when its window closes, and a loader that dies
first leaves launchd/mldr and the client tree holding memory until the runtime
is restarted by hand. run-riot-client.sh now execs a small supervisor instead
of the guest loader:

- SIGINT/SIGTERM/SIGHUP are forwarded to the guest process group, the loader
  gets a grace period, and darling shutdown runs before any leftover guest
  process is stopped.
- Leftovers are stopped only when they carry this prefix's __mldr_sockpath and
  the same uid, deepest-first, SIGTERM then SIGKILL. The guest PID namespace is
  learned while the session runs; a namespace equal to the host's is refused.
- Cleanup only runs when this launcher started the runtime, so a second launch
  that attaches to an existing server leaves it running.
- RCLOL_STOP_AFTER_CLIENT_SECONDS=N adds an opt-in idle stop: it fires only
  after a managed client window was seen and is gone for N seconds with no game
  process, and never when the window state cannot be read. Off by default.
- RCLOL_CLEAN_ON_EXIT=0 keeps the previous exec-only behaviour.

Adds 23 unit tests for attribution, namespace scoping, shutdown ordering, the
attached-session guard and the idle decision.
2026-10-25 12:57:04 -06:00
lucannez64 49c262e42d Merge remote-tracking branch 'origin/main' into pr-fix-132
# Conflicts:
#	.github/workflows/source-check.yml
2026-10-25 19:32:06 +01:00
lucannez64 9ce1d0c7f2 Merge remote-tracking branch 'origin/main' into pr-fix-132 2026-10-25 19:30:57 +01:00
lucannez64 058479a053 fix(recovery): fail closed on inspection errors and report leftovers accurately
Signed-off-by: lucannez64 <[email protected]>
2026-10-25 19:30:16 +01:00
lucannez64 a65613b11e fix(ifmedia): preserve media-list requests and reject loopback
Signed-off-by: lucannez64 <[email protected]>
2026-10-25 19:30:16 +01:00
MintMachineHQ 54f301a0e0 fix(tools): address review feedback on diagnostics
- doctor: resolve the workspace/Nix runtime before the native path, honour
  multi-entry XDG_DATA_DIRS, raise the kernel minimum to 5.14, and redact
  home/prefix/workspace paths by default (--no-redact opts out). Reports are
  written mode 0600.
- crash-report: drop the whole-process table from the default bundle
  (--all-processes opts in), mask credentials in argv, strip window titles,
  validate --label, find the workspace launcher log, bound the log tail,
  describe missing logs, write the archive 0600 without owner metadata, and
  keep --json output pure JSON.
- perf-baseline: reject non-finite times and absurd frame times, count
  --last by usable match, include the last sample interval in duration,
  record only the log basename, and rename p50/p95/p99 to sample_p* to make
  clear they are ten-second samples.
- docs: correct the metric descriptions, flag names and shader-cache sign.
2026-10-25 12:28:48 -06:00
lucannez64 c38f5c29e0 fix(launchd): preserve tracked children in nested job managers
Signed-off-by: lucannez64 <[email protected]>
2026-10-25 19:13:45 +01:00
lucannez64 65d4354667 Merge remote-tracking branch 'origin/main' into pr-fix-121
# Conflicts:
#	.github/workflows/source-check.yml
#	NOTICE.md
#	README.md
#	docs/COMPLIANCE.md
#	docs/PLATFORM_IDENTITY.md
#	docs/SETUP.md
#	docs/TROUBLESHOOTING.md
#	patches/cocotron.patch
#	patches/metal--deps--indium.patch
#	tools/exec-guest.py
#	tools/run-riot-client.sh
2026-10-25 19:11:54 +01:00
MintMachineHQ 631a8afe37 recover-stale-client: do not report a reused PID as a leftover
wait_for_exit counted any live PID with the same number as a leftover, so a
reused PID produced a misleading "still present after SIGKILL" message. Compare
the original start time and use the process state only to include the original
process while it is an unreaped zombie.
2026-10-25 11:06:55 -06:00
MintMachineHQ 11f7252004 feat(tools): add host doctor, crash report and frame-pacing baseline
Turns "it does not work" into an attachable report instead of a log-less
issue. Three read-only host tools, reachable from the launcher:

- doctor.py checks GPU/driver, Vulkan ICDs, display session, memory, disk,
  overlay layer, core-dump limit, i915 panel self-refresh and prefix/runtime
  state. --json and --report produce an issue attachment; warnings do not fail.
- crash-report.py bundles the doctor checks, process table, dserver and
  launcher log tails, graphics kernel messages, display state and recent core
  dumps. Environment is never collected and home/user/host are redacted.
- perf-baseline.py parses the game's own netstats.csv into average FPS,
  p50/p95/p99 frame time, slowest-quarter FPS and hitch count, with --json and
  --append for before/after comparisons.

COMPATIBILITY.md records the verified UHD 620 row with measured numbers
(24-32 avg FPS, p99 44-98 ms) and explains how to submit another one.
2026-10-23 23:56:30 -06:00
MintMachineHQ 9291d6accd fix(launchd): reap orphaned guest zombies and harden stale-client recovery
Children whose parent dies are reparented to the guest launchd, and its job
manager only reaps PIDs it has a job record for, so every leftover mldr/CEF
process from a killed client tree stayed a zombie until shutdown. Reap zombies
that launchd owns but does not track on a 5 second timer; tracked jobs keep
their exit status for job_reap(). proc_listpids() is not implemented in Darling
yet, so the scan enumerates the guest PID namespace through /proc.

recover-stale-client now signals the stale tree deepest-first so a live parent
can still reap its own children, and prepare.py repairs interrupted checkouts
and missing Git LFS objects instead of publishing pointer text as a library.
2026-10-23 23:36:20 -06:00
lucannez64andClaude Opus 5.5 a11a144767 Merge main into fix/recover-stale-client
Resolve conflicts with #122: keep both feature docs and CI steps, and drop
this branch's copy of the close-helper block, which main now starts after
the installed-client check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 14:18:33 +02:00
Kalah 6bf8d63f55 Merge branch 'main' into feat/hide-client-in-game 2026-10-23 14:16:58 +02:00
3AvisD 9194beef2f fix(launcher): harden stale-client recovery
- fail closed when X11 omits _NET_CLIENT_LIST or WM_CLASS, and recognize the
  RiotClientServices window class;
- require stale client processes to be at least 60 seconds old;
- recheck process identity before SIGTERM and SIGKILL and recheck the window
  before signalling;
- document the age and window-detection guards.
2026-10-23 06:08:45 -06:00
3AvisD f8bb14624e fix(launcher): address in-game helper review
- restore hidden windows even when the launcher output pipe is closed;
- exit the hide watcher after ten idle minutes and start it only after the
  installed-client check;
- reject missing, malformed or invalid close-during-game preferences instead
  of silently selecting hide;
- document the preference contract and idle behavior.
2026-10-23 06:08:45 -06:00
Kalah a0b152f53c Merge branch 'main' into perf/indium-cpu-shadow 2026-10-23 13:35:33 +02:00
3AvisD 0a04d4e16c fix(launcher): remove orphaned client-in-game helpers
A launcher can exit while its long-lived close/hide helper remains. The next
run then starts another watcher, so several copies watch the same prefix.

Add an opt-in RCLOL_CLEAN_STALE_HELPERS=1 preflight that removes only helper
processes of this prefix reparented to init/systemd. Helpers of a live
launcher, other prefixes, the game, Riot/League/CEF, darlingserver and the
runtime are preserved. Unreadable or relative process data leaves a process
alone.

Validated across repeated launcher starts: the cleanup removed four, then one,
then one orphaned watcher; a subsequent dry run reported no orphaned helpers.
Zombie reaping after partial recovery is tracked separately in #124.
2026-10-22 15:50:38 -06:00
3AvisD 732e9c8881 fix(launcher): handle YAML comments and log failures
- strip inline YAML comments from preference values, including quoted values;
- keep a successfully unmapped window tracked when the success log raises
  BrokenPipeError, while still discarding a window whose unmap failed;
- cover both cases with tests.
2026-10-22 15:30:45 -06:00
3AvisD c8dd3886fc fix(launcher): recover a stale client tree without restarting Darling
Darlingserver normally stays alive after the Riot Client or game is closed.
If the client window disappears but Riot/League/CEF processes remain,
restarting via run.sh reuses a half-dead runtime and can fail to open a
window.

Add an opt-in RCLOL_RECOVER_STALE_CLIENT=1 preflight. When a darlingserver is
alive, no game is running, no managed client window is visible and stale
client processes belong to this prefix, stop only that client/CEF tree.
Preserve darlingserver, launchd/mldr, sockets and .init.pid, then continue
with the normal product launch.

The helper fails closed when X11 is unavailable, never touches a running game
or a visible client window, and does not patch client binaries, CEF or assets.
It saves the Darling bootstrap, but not Riot Client/CEF startup; a full runtime
restart remains the fallback if no window appears.
2026-10-22 15:27:33 -06:00
3AvisD 5a06f34725 fix(launcher): fail closed on automatic mode edge cases
- restrict preference reads to the lol-user-experience section;
- distinguish a failed close-preference read from a missing key;
- reject xprop's 'not found' text as a WM_CLASS value;
- track a window before unmap so an interrupting signal still restores it;
- report the tricks-mode opt-out in the hide helper's startup message;
- cover the new cases with preference, window and interruption tests.
2026-10-22 15:07:47 -06:00
3AvisD 4faa622336 feat(launcher): select client-in-game mode from preferences
Add RCLOL_CLIENT_IN_GAME_TRICKS=1 as the practical launcher switch. It reads
lol-user-experience from LCULocalPreferences.yaml:

- potatoModeEnabled false or unreadable: no action;
- closeLeagueClientDuringGame true: close the client UI;
- closeLeagueClientDuringGame false: hide the client windows.

The existing close and hide switches remain low-level options when the
automatic switch is not set. The hide helper accepts the master switch, and
the resolver plus preference cases are covered by tests and documentation.

The local .desktop entry was validated with the master switch; the installed
preferences select hide on this machine.
2026-10-22 14:56:03 -06:00
3AvisD 3c046252a7 fix(launcher): address hide-client review findings
- associate target windows with the selected prefix through the guest PID,
  X11 _NET_WM_PID, NSpid and the loader socket; fail closed when ownership is
  unknown;
- let --once run without either opt-in gate, matching the documented
  diagnostic;
- route SIGHUP through the restore handler;
- cache non-empty WM_CLASS results per window and prune stale entries;
- cover unreadable /proc, host PID mapping and prefix ownership in tests.
2026-10-22 12:32:03 -06:00
3AvisD 415aa7a949 feat(launcher): hide the League client UI while a match runs
Add an opt-in alternative to closing LeagueClientUx: hide the managed
LeagueClientUx and Riot Client X11 windows while the game process runs and
show them again when it exits. The client stays open; the game window is
never touched.

Detection is attributed to the launcher prefix through __mldr_sockpath and
fails closed when proc, ownership or window state is unreadable. The helper
requires X11/Xwayland, restores the window on end, signal or error, and is
mutually exclusive with RCLOL_CLOSE_CLIENT_IN_GAME=1.

Document the flag, compliance scope and limits. A local 30-second test on an
i5-3470/RX 550 reduced summed client/CEF CPU from 120.7% to 93.4%; this is a
CPU-bound-host measurement, not a universal FPS claim.

No client binaries, CEF, assets or anti-cheat are modified.
2026-10-22 12:15:35 -06:00
lucannez64 e00ee99522 fix(launcher): only remove launcher artifacts this project created
Match the legacy entry against this checkout's desktop-run.sh instead of any
desktop-run.sh, and delete the legacy icon files only after that entry or the
old artwork proves ownership.  Quote and escape Exec arguments as the Desktop
Entry specification requires, so a checkout path with reserved characters no
longer produces an invalid entry, and escape the Path value.

Use StartupWMClass=RiotClientServices in both entries: Darling derives WM_CLASS
from -[NSProcessInfo processName], the basename of argv[0], and the launcher
starts .../RiotClientServices.  "Riot Client" is only the bundle display name,
so the checkout entry never matched the window.  Both entries now share
Name/GenericName/Comment/Icon/Keywords/Categories and a test keeps them in
sync; Terminal stays different because the checkout entry logs to
build/desktop-launch.log while the packaged entry runs the session in a
terminal.

Also drop the stray top-level icon copies, handle dangling legacy symlinks,
name the icon for assistive technology, document the alias and menu entry, and
cover the helper with disposable-HOME tests.
2026-10-21 17:38:42 +02:00
lucannez64 4d0affe1fc fix(launcher): only remove launcher artifacts this project created
Match the legacy entry against this checkout's desktop-run.sh instead of any
desktop-run.sh, and delete the legacy icon files only after that entry or the
old artwork proves ownership.  Quote and escape Exec arguments as the Desktop
Entry specification requires, so a checkout path with reserved characters no
longer produces an invalid entry, and escape the Path value.

Use StartupWMClass=RiotClientServices in both entries: Darling derives WM_CLASS
from -[NSProcessInfo processName], the basename of argv[0], and the launcher
starts .../RiotClientServices.  "Riot Client" is only the bundle display name,
so the checkout entry never matched the window.  Both entries now share
Name/GenericName/Comment/Icon/Keywords/Categories and a test keeps them in
sync; Terminal stays different because the checkout entry logs to
build/desktop-launch.log while the packaged entry runs the session in a
terminal.

Also drop the stray top-level icon copies, handle dangling legacy symlinks,
name the icon for assistive technology, document the alias and menu entry, and
cover the helper with disposable-HOME tests.
2026-10-21 17:38:42 +02:00
ekisu e46890adb4 perf(indium): cache buffer address keys in CPU memory 2026-10-20 15:47:20 -03:00
lucannez64 c686798ddb test(nix): run font compatibility regressions in CI 2026-10-20 13:57:05 +02:00
lucannez64 bdbf1e9a37 test(nix): run font compatibility regressions in CI 2026-10-20 13:57:05 +02:00
Nicolai Bruns eb962b8c9f docs(tests): document fontconfig regression helpers 2026-10-20 13:43:22 +02:00
Nicolai Bruns 699b96ffc8 docs(tests): document fontconfig regression helpers 2026-10-20 13:43:22 +02:00
Nicolai Bruns a089a23072 fix(nix): harden fontconfig compatibility across host setups 2026-10-20 13:31:02 +02:00
Nicolai Bruns 6a96869db8 fix(nix): harden fontconfig compatibility across host setups 2026-10-20 13:31:02 +02:00
nbandlucannez64 0d8da88894 fix: preserve ambiguous guest processes during prefix cleanup (#111)
* fix: preserve ambiguous guest processes during prefix cleanup

* fix: warn only for matching runtime cleanup candidates

---------

Co-authored-by: lucannez64 <[email protected]>
2026-10-20 13:02:29 +02:00
nbandlucannez64 ec85cfb96b fix: preserve ambiguous guest processes during prefix cleanup (#111)
* fix: preserve ambiguous guest processes during prefix cleanup

* fix: warn only for matching runtime cleanup candidates

---------

Co-authored-by: lucannez64 <[email protected]>
2026-10-20 13:02:29 +02:00
nbandKalah 0a9a75e820 fix(appkit): add NSSavePanel tag-name compatibility (#112)
Co-authored-by: Kalah <[email protected]>
2026-10-20 12:24:10 +02:00
nbandKalah bbfa4c61b0 fix(appkit): add NSSavePanel tag-name compatibility (#112)
Co-authored-by: Kalah <[email protected]>
2026-10-20 12:24:10 +02:00
lucannez64 e47f05f424 Use the host DNS resolver in Darling 2026-10-19 18:11:49 +02:00
lucannez64 306c6c5bf8 Use the host DNS resolver in Darling 2026-10-19 18:11:49 +02:00
lucannez64 ff8a985057 Merge current main into the tested VSync and VRR fixes 2026-10-19 12:59:58 +02:00
lucannez64 71efcdf5f6 Merge current main into the tested VSync and VRR fixes 2026-10-19 12:59:58 +02:00