Skip to content

Test build: launcher for Linux ARM and the Jetson (do not merge) - #65

Merged
andersalm merged 25 commits into
test/launcher-mac-dmgfrom
test/launcher-jetson
Nov 8, 2026
Merged

andersalm merged 25 commits into
test/launcher-mac-dmgfrom
test/launcher-jetson

Conversation

@andersalm

@andersalm andersalm commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The Mac end-to-end job reported another program at localhost:8090 after Home was ready. The launcher rejected a gateway command that did not start with the proved kernel path. macOS now uses the Mac proof. Linux still signals only the update controller.

Linux Stop could signal a reused pid. The controller identity was read from proc, and then kill used the pid number. If the controller exited in that gap, the signal reached the new process.

A failed Stop kept the pidfd helper. The next Stop replaced that controller and left the helper, its FIFO directory, and its descriptors until the launcher exited.

A 60 second idle alarm armed again after SIGTERM. Stop could still be in a localhost lookup with no deadline. The alarm then killed the helper, and SIGKILL failed.

What changed

  • installedGatewayKind trusts a proved kernel path. The command must still name a gateway or home --browser.
  • Darwin reads process identity from the bundled helper.
  • Linux Stop still signals only the recorded update controller. A gateway on 127.0.0.1:8090 is not adopted.
  • Linux opens a pidfd before it reads the controller start time and exe. SIGTERM and SIGKILL reuse that pidfd. If pidfd is unavailable, Stop shows "Home could not be confirmed; stop it with Ctrl+C in its terminal" and does not signal.
  • dispose closes the pidfd helper when Stop fails and before another controller replaces it. The helper exits on that close, on FIFO end, or when the launcher process dies. It does not use an idle alarm.
  • resolveLocalhost and the health probe give up when the lookup misses the probe deadline.

Scope

  • This pull request stays a draft. Do not merge it.
  • Windows can still stop its own legacy gateway and start localhost:8090.
  • Darwin signaling is unchanged.
  • This Mac does not deliver the Linux parent-death signal. The regression records the request and compiles the helper source.

Tradeoffs

Darwin Stop adopts the proved controller. Linux Stop keeps the process handle that this window spawned. A retained Linux Home is stopped through the pidfd helper in the package.

Closing the helper on every send error would also close it between SIGTERM and SIGKILL. dispose runs when Stop gives up, or when a new controller replaces the old one.

The lookup deadline unblocks Stop. This Node build does not cancel the system lookup, so a stuck resolver can still hold the process until the operating system returns.

Blast Radius

A person who starts Home on a Mac gets the Mac ownership proof. A person on Linux still cannot stop a 127.0.0.1:8090 gateway from this launcher. Stop on Linux no longer uses kill on the controller pid number. A failed Stop no longer leaves a helper running until the launcher exits. A slow health lookup no longer kills the helper before SIGKILL.

Verification

  • Before the pidfd race fix, the race test delivered SIGTERM to pid 10 with birth 999 and exe /usr/bin/foreign. After that fix, the race, a replacement during the proc read, escalation, and a missing pidfd pass.
  • Before dispose, two failed Stops left 2 helpers, 2 FIFO directories, and 4 descriptors. After it, the send-error test and the timeout test return those counts to the baseline.
  • Before the idle-alarm removal, the helper log after SIGTERM was 2,0,60,60. The SIGKILL write failed with EPIPE. The signal log was 15. After the removal, a 61 second wait left the helper running (EXIT_DURING_WAIT null). SIGKILL returned sent. The signal log was 15,9. The alarm log was 2,0.
  • Before the lookup deadline, the health probe returns when localhost lookup does not answer timed out at 2000 ms. After the deadline, that test passed in 203 ms.
  • elastos-heavy node scripts/test.js passed 321 tests, failed 0, and skipped 3, at 43e5cbe.
  • Test run https://github.com/Elacity/elastos-launcher/actions/runs/42462540069 passed.
  • Runtime smoke run https://github.com/Elacity/elastos-launcher/actions/runs/42462540071 passed.
  • Linux ARM64 package run https://github.com/Elacity/elastos-launcher/actions/runs/42462540097 passed. That job runs scripts/build-linux-pidfd.js.

andersalm and others added 16 commits November 7, 2026 21:01
The Jetson uses glibc 2.35, and the bundled fpm binary is x86.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the Ubuntu 22.04 arm64 jobs, and poll Linux status from Node so the page CSP allows the check.

Co-authored-by: Cursor <cursoragent@cursor.com>
Version 26.16.1 already downloads fpm-1.17.0-ruby-3.4.3-linux-arm64v8, so the system fpm install is obsolete.

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

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Windows Update stays one command. The Linux test fails until that restart lands.

Co-authored-by: Cursor <cursoragent@cursor.com>
A closed window leaves Home and the tray. Update and Undo stop Home, run the command, and start Home again.

Co-authored-by: Cursor <cursoragent@cursor.com>
The update controller does not hold the listen socket. Its child does.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
A descendant socket or a reused pid was treated as this Home, so Quit and stop left a retained Home running.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Mac branch stores that record under .elastos-launcher. The Linux Electron test still opened the runtime data file, so both Linux e2e jobs failed.

Co-authored-by: Cursor <cursoragent@cursor.com>
A host pid and a process group are no longer signal targets, and a gateway on 127.0.0.1:8090 is left running.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the Mac identity check before a Darwin signal. Linux still signals only a confirmed update controller.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Windows restart of a 127.0.0.1 gateway stays tested. Linux still does not signal that gateway.

Co-authored-by: Cursor <cursoragent@cursor.com>
@andersalm andersalm closed this Nov 8, 2026
@andersalm andersalm reopened this Nov 8, 2026
andersalm and others added 8 commits November 8, 2026 01:33
Runtime smoke run 42449751731 reports a foreign program at localhost:8090 after Home is ready. installedGatewayKind returns null when the command does not start with the proved kernel path. This test fails on that result.

Co-authored-by: Cursor <cursoragent@cursor.com>
macOS proves Home with the kernel path from the bundled helper. A gateway command does not have to start with that path. Linux still signals only the recorded update controller, and it does not adopt a gateway on 127.0.0.1:8090.

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

A pid reused after the start-time and exe reads received kill by pid number. The pidfd is opened first, and TERM and KILL both use that fd. If pidfd is unavailable, Stop does not signal.

Co-authored-by: Cursor <cursoragent@cursor.com>
Repeated Stop after a send error or a timeout must return the helper, the FIFO directory, and the descriptors to the counts from before the Stop.

Co-authored-by: Cursor <cursoragent@cursor.com>
dispose closes the helper on a terminal Stop failure and before a new owner replaces it. SIGTERM and SIGKILL still share one pidfd. The helper also exits after 60 seconds without a command, which is longer than the 15 second stop grace.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
A health lookup that does not return must not hang the probe. After SIGTERM, SIGKILL must still go through the same pidfd, and the helper must still request SIGKILL when its parent dies.

Co-authored-by: Cursor <cursoragent@cursor.com>
The 60 second alarm started again after SIGTERM, so a slow lookup killed the helper and the later SIGKILL failed. The helper now stays up until close, FIFO end, or parent death. The localhost lookup uses the probe deadline.

Co-authored-by: Cursor <cursoragent@cursor.com>
@andersalm
andersalm merged commit 770360a into test/launcher-mac-dmg Nov 8, 2026
13 of 14 checks passed
@andersalm

Copy link
Copy Markdown
Collaborator Author

Combined into test/launcher-mac-dmg at c098b49; see draft #63.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant