Skip to content

feat(release): add nightly build workflow, installers, npm alias and self-updater - #7123

Merged
M4n5ter merged 1 commit into
rust-previewfrom
feat/nightly-build-and-updater
Nov 21, 2026
Merged

M4n5ter merged 1 commit into
rust-previewfrom
feat/nightly-build-and-updater

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 21, 2026

Copy link
Copy Markdown
Member

Summary

Prepare the upcoming rust-preview → main transition with a clean, manually dispatched nightly build & delivery pipeline and channel-isolated self-updates built on nsh-updater:

  • Clean Nightly workflow (.github/workflows/nightly.yml): pure workflow_dispatch targeting 4 platforms (darwin-arm64, linux-x64-gnu, linux-arm64-gnu, win32-x64), removing the legacy workflow_run chaining, rerun bans, draft byte-comparison loops, and attestation ceremony.
  • Rolling pre-release with previous-build retention: publishes current assets exclusively to the rolling nightly pre-release (with prominent non-ASF developer build warnings + DISCLAIMER) and automatically rolls the immediately preceding build into nightly-previous, linked under a dedicated Previous Nightly section in the release notes.
  • Native installers & self-contained macOS bundle:
    • macOS (darwin-arm64): bundles maka and maka-python-worker inside Maka.app/Contents/MacOS (while preserving compatibility with sibling dev/npm layouts), signs inside-out with Developer ID when CSC_LINK is configured, notarizes and staples both the .dmg and .app, and outputs both .dmg and updater .tar.gz.
    • Windows (win32-x64): per-user Inno Setup installer (%LOCALAPPDATA%\Programs\Maka, no elevation, manages user PATH) + portable/updater .zip.
    • Linux (linux-x64-gnu, linux-arm64-gnu): .tar.gz carrying install.sh, desktop icon, and legal files, plus top-level scripts/install-nightly.sh for one-line installs; adds aarch64-unknown-linux-gnu Debian bullseye sysroot support to scripts/rust/compile-v8.mjs and exports newly built V8 archives as workflow artifacts for pinning.
    • All packages include LICENSE, NOTICE, DISCLAIMER, and THIRD_PARTY_NOTICES.txt.
  • Channel-isolated self-updater & durable Host restart (products/maka/updater, desktop shell, workbench UI, maka update):
    • Compile-time channel isolation (dev disabled; nightly strictly tracks releases/download/nightly/latest.json with mandatory Ed25519 signature verification and -nightly.* SemVer filtering; release strictly tracks GitHub latest and rejects prereleases).
    • After download, SHA-256 verification, and nsh-updater staging (codesign --verify --deep --strict on macOS), explicit user confirmation fences Host auto-reconnect, calls HostClient::retire_with_options(..., true, true) to flush durable execution state and release binary locks, atomically swaps the installation, and relaunches cleanly so active runs resume on restart.
  • npm delivery & maka-agent alias (packages/maka-agent): optional publish_npm dispatch toggle reuses the same built binaries to publish @maka-agent/cli-*, @maka-agent/cli, and the thin maka-agent alias package under @nightly.

Rollout

Before the first production dispatch of nightly.yml, configure in the nightly GitHub environment:

  1. Run node scripts/rust/nightly-manifest.mjs keygen and set MAKA_UPDATE_PUBLIC_KEY (environment variable) and MAKA_UPDATE_SIGNING_KEY (environment secret) so nightly clients verify latest.json.sig.
  2. Add NPM_TOKEN (environment secret) if using publish_npm=true.
  3. After the first 4-platform run completes, upload the exported v8-prebuilt-* artifacts to a deps-v8-* release and pin their digests in scripts/rust/v8-prebuilts.json.

Verification

  • macOS (local darwin-arm64):
    • node scripts/ci.mjs check format, licenses, notices, tooling-tests (341 passed), and run contracts (TypeScript + UI contracts) — all passed.
    • cargo test --locked -p maka-updater --lib (9 passed, including cross-language Node Ed25519 signature verification against Rust nsh_updater::verify and real .tar.gz atomic directory swap).
    • cargo test --locked -p maka-desktop-shell --bins (17 passed, including self-contained Maka.app launcher resolution).
    • End-to-end build and packaging of real binaries into self-contained Maka.app, .dmg, .tar.gz (verified with codesign --verify --deep --strict), signed latest.json, and offline npm install of maka-agent alias invoking the native maka binary.
  • Linux (omarchy x86_64):
    • node --test scripts/rust/nightly-manifest.test.mjs scripts/rust/package-nightly.test.mjs (4 passed, including offline maka-agent alias execution) and sh -n scripts/install-nightly.sh.
    • cargo test --locked -p maka-updater --lib (8 passed), cargo check --locked -p maka-desktop-shell, and cargo check --locked -p maka-cli --no-default-features.
  • Not run locally:
    • Windows compilation (direct2d.rs, wait_for_restarting_pid) and Inno Setup ISCC.exe build; real Apple Developer ID notarization on GitHub macos-latest runner. These will be exercised by CI and the first manual nightly.yml run.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Maka (Gemini) — implemented the nightly workflow, packaging/manifest scripts, maka-agent alias package, maka-updater crate, desktop/CLI/workbench updater integration, and tests.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

M4n5ter added a commit that referenced this pull request Nov 21, 2026
…e and updater

Fix all blocking, high, and medium review findings from the GPT-6.2-Astra review:
- Fix smokeTestBuiltBinaries to use `maka code --root <temp>` and assert
  `CellObservation::Completed` + text marker, running post-sign on the bundled
  macOS `Maka.app/Contents/MacOS/maka`.
- Use native ARM64 LLVM (`CLANG_BASE_PATH` + `clang_use_chrome_plugins=false`)
  instead of Chromium's Linux_x64 clang download on `ubuntu-24.04-arm`.
- Fix BSD `sed -nE` capture group syntax when extracting macOS Developer ID.
- Sign macOS hardened-runtime `maka` and `Maka.app` with
  `com.apple.security.cs.allow-jit` so V8 `MAP_JIT` works under Developer ID.
- Wait for exclusive `RootOwner::open` writer lease release in `stop_host`
  instead of treating IPC disconnect/timeout as drain completion.
- Guard `maka update` against live desktop/CLI sessions unless `--force`, and
  relaunch the updated Host via `startup::connect_root` when a Host was running.
- Move Windows Inno Setup `UninstallFilesDir` outside `{app}` so self-updates
  never delete `unins000.exe`.
- Restrict leftover cleanup to dead-PID staging dirs and verify the active
  staged dir still exists before retiring the Host.
- Enforce Ed25519 manifest signing matched against compiled
  `MAKA_UPDATE_PUBLIC_KEY` before mutating releases; fail rollover on
  incomplete downloads; pass `inputs.notes` via step env; gate npm install
  notes on actual npm publication; expose `DISCLAIMER` and per-platform
  `THIRD_PARTY_NOTICES-*.txt` as release assets.
- Distinguish `UpToDate` from unchecked `Idle` in desktop updater UI.

Generated-by: Maka (Gemini)
M4n5ter added a commit that referenced this pull request Nov 21, 2026
Address all 7 remaining issues found in the follow-up review of 056aa8a:
- Cross-compile Linux ARM64 V8 on linux/x64 (v8-linux-arm64 job) using
  Chromium's pinned Clang 23 instead of Ubuntu LLVM 19 on ubuntu-24.04-arm
  (locked Chromium GN passes -fdiagnostics-show-inlining-chain which requires
  Clang 23), then stage and verify the bundle natively on ubuntu-24.04-arm.
- Move Ed25519 signing keypair verification into prepare so missing or
  mismatched keys fail before building or publishing to npm.
- Replace always() with !cancelled() in nightly.yml release job conditions
  and distinguish explicit HTTP 404 from transient API errors when checking
  for an existing nightly release before rollover.
- Re-probe live Host state in maka update after staging, refuse updates while
  interactive sessions (such as an open desktop window) are connected, use
  atomic try_stop_idle_host (retire_with_options(false, false)) on the normal
  path, wait on closing Hosts, and clean up stale leftovers on CLI update.
- Switch desktop shell's updating fence from AtomicBool to watch::channel so
  AppKit and Linux follow() loops pause during update and cleanly resume
  Host reconnection if stop_host or finish fails.
- Gate Unix-only WAIT_LIMIT_SECS in maka-updater to eliminate Windows
  dead_code warnings.

Generated-by: Maka (Gemini)
M4n5ter added a commit that referenced this pull request Nov 21, 2026
Address all 5 findings from the round-3 review:
- Add refuse_active_sessions to Request::Retire and Client::retire_if_no_sessions
  so maka update --force atomically refuses connected desktop/CLI sessions
  under Host.access_gate while interrupting background runs when idle of sessions.
- Return RootLease (holding RootOwner) from stop_host, try_stop_host_without_sessions,
  wait_for_root_release, and try_acquire_root_lease, holding the exclusive writer
  lease across finish() so no candidate Host can start mid-swap and catching
  pre-registration starting Hosts when discovery is still absent.
- Clear desktop updating watch channel if spawn_restarted_desktop fails after
  finish(), so follow() resumes instead of hanging indefinitely.
- Require needs.prepare.result == 'success' on v8-linux-arm64 so signing keypair
  failures in prepare never trigger an ARM64 V8 cross-build.
- Check owner PID liveness for .nsh-updater-old-<pid>-* rollback backups as well
  as staged directories in remove_stale_leftovers(), preventing concurrent CLI
  checks from deleting active Windows rollback files.

Generated-by: Maka (Gemini)
…self-updater

Add a clean, manually dispatched nightly build & delivery pipeline targeting
darwin-arm64, linux-x64-gnu, linux-arm64-gnu, and win32-x64, and integrate
channel-isolated self-updates built on nsh-updater with durable Host restart
recovery.

- Add .github/workflows/nightly.yml (manual workflow_dispatch on ubuntu-latest,
  ubuntu-26.04-arm, macos-latest, and windows-latest; pre-build Ed25519 keypair
  validation; x64 cross-compiled Linux ARM64 V8 prebuilt stage when unpinned;
  rolling nightly + nightly-previous pre-releases with non-ASF developer
  warnings, DISCLAIMER, and per-platform notices; optional @nightly npm publish).
- Make Maka.app self-contained on macOS (bundling maka and maka-python-worker
  inside Contents/MacOS with Developer ID inside-out signing, allow-jit
  entitlement, post-sign V8 smoke test, DMG packaging, and notarization/stapling).
- Add per-user Windows Inno Setup packaging (UninstallFilesDir outside {app},
  no elevation, user PATH management), Linux archives with install.sh, and
  packages/maka-agent as a thin alias for @maka-agent/cli.
- Add products/maka/updater and wire channel-isolated nsh-updater checks,
  signed latest.json verification, desktop banner/settings UI, atomic session-safe
  Host retirement, RootLease + launch-lock fencing across finish_with_guard,
  SwapFence shutdown draining, and CLI `maka update`.

Generated-by: Maka (Gemini)
@M4n5ter
M4n5ter force-pushed the feat/nightly-build-and-updater branch from 141b3de to 6092e8d Compare November 21, 2026 13:01
@M4n5ter
M4n5ter merged commit 1b7c0ef into rust-preview Nov 21, 2026
12 of 14 checks passed
@M4n5ter
M4n5ter deleted the feat/nightly-build-and-updater branch November 21, 2026 13:03
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