Repository navigation
Unified installer: bundle GUI, CLI, and daemon into a single install - #1455
Conversation
…ll, CI job
## Completed in This Session
- [x] nodespaced --edition flag (returns "community" or "pro")
- [x] nodespaced --version flag (early-exit, same pattern)
- [x] [features] pro = [] in daemon Cargo.toml for cfg!(feature = "pro")
- [x] scripts/build-pkg.sh — signs binaries, pkgbuild + productbuild, notarytool
- [x] scripts/pkg-resources/postinstall — Pro guard, /usr/local/bin install, launchd bootstrap
- [x] scripts/pkg-resources/com.nodespace.daemon.plist — LaunchAgent, KeepAlive, /tmp logs
- [x] build:pkg:macos script registered in root package.json
- [x] build-pkg-macos matrix job in release.yml (ARM + Intel, needs Tauri jobs)
- [x] Workflow dispatch options: macos-pkg-arm, macos-pkg-intel added
- [x] notify-failure now includes build-pkg-macos in needs
- [x] Pre-existing lint fixes: HTMLInputElement global + unused log var
## Remaining Work
- [ ] Wait for test:all to complete (running in background)
- [ ] Create PR
## Current State
- Files modified: see above
- Tests status: running (140 frontend + skill + rust)
- Known issues: none; stub binaries created locally for lint pass (not committed)
- Dependencies: Apple Developer credentials in CI secrets (already present)
## Context for Next Session
Full macOS pkg installer pipeline. build-pkg.sh calls pkgbuild+productbuild, signs with
Developer ID Application + Installer certs, notarizes via notarytool. CI job runs after
Tauri builds the .app. Postinstall detects Pro edition before overwriting. The
APPLE_INSTALLER_IDENTITY env var ("Developer ID Installer: Michael Libio (F4M5J7YNLS)")
needs to be added as a GitHub secret (separate from the Application cert).
## Acceptance Criteria Status
From issue #1448:
- [x] nodespaced --edition flag implemented (returns community or pro)
- [x] macOS .pkg build script with signing + notarization
- [x] Community .pkg postinstall script detects existing Pro binary
- [x] Daemon launchd service plist
- [x] release.yml updated to build and upload .pkg artifacts
- [ ] Gatekeeper verification (needs real CI run with certs)
- [ ] Tauri sidecar removal (separate cleanup, after pkg is canonical)
- [ ] Windows .msi (separate issue)
- [ ] Homebrew cask (separate issue)
Co-Authored-By: Claude <[email protected]>
Code Review SummaryThis PR implements the macOS .pkg unified installer, covering the full pipeline: Rust daemon CLI flags, shell-based pkg builder, launchd plist, postinstall script, and CI matrix job. It directly addresses the acceptance criteria for macOS from issue #1448. The implementation is well-structured, includes a sensible postinstall Pro-edition guard, and the signing/notarization flow follows Apple best practice. This is a net improvement and unblocks the macOS release path. Several issues warrant attention before merge, ranging from a correctness blocker in the CI job to security hygiene and behavioral edge cases. FindingsCritical Issues[Critical/Blocker]
The job declares This means: (a) the Fix: upload the [Critical/Blocker]
/usr/bin/osascript - <<'APPLESCRIPT' || true
...
APPLESCRIPT
if [[ $? -ne 0 ]]; thenThe Fix: remove if ! /usr/bin/osascript - <<'APPLESCRIPT'; then
echo "Installation aborted — Pro installation preserved." >&2
exit 1
fiSuggested Improvements[Improvement] Hardcoded personal Team ID and signing identity in CI YAML
APPLE_SIGNING_IDENTITY: "Developer ID Application: Michael Libio (F4M5J7YNLS)"
APPLE_INSTALLER_IDENTITY: "Developer ID Installer: Michael Libio (F4M5J7YNLS)"The team ID [Improvement]
codesign --force --deep --options runtime --timestamp \
--sign "${APP_IDENTITY}" \
"${TAURI_APP_PATH}"Apple's guidance explicitly discourages [Improvement] Logs routed to
<key>StandardOutPath</key>
<string>/tmp/nodespaced.log</string>
<key>StandardErrorPath</key>
<string>/tmp/nodespaced.log</string>
[Improvement] Pro-guard executes the existing binary at its installed path before overwriting — TOCTOU exposure
EXISTING_EDITION="$("${NODESPACED}" --edition 2>/dev/null || echo "unknown")"The postinstall script runs as root after the payload has already been extracted by the installer. At the point this check runs, the installer has not yet overwritten [Improvement]
PKG_VERSION=$(grep '^version' "${REPO_ROOT}/packages/daemon/Cargo.toml" | head -1 | sed 's/.*"\(.*\)".*/\1/')This grep will also match [Improvement]
The Nitpicks
Acceptance Criteria Coverage
Two blockers prevent merge: the CI job rebuilding unnecessarily instead of consuming upstream artifacts, and the silent Pro-guard logic hole. Both are straightforward fixes. |
malibio
left a comment
There was a problem hiding this comment.
Two blockers identified in the review comment above: (1) build-pkg-macos duplicates the full Tauri build instead of consuming upstream artifacts; (2) the Pro-guard || true makes the abort path unreachable. Both are straightforward fixes — see full findings.
- postinstall: remove `|| true` from osascript call so Abort button actually propagates non-zero exit and halts installation - postinstall: verify nodespaced code signature before executing as root; skip Pro guard if signature check fails - postinstall: create ~/Library/Logs/com.nodespace/ log directory before launchctl bootstrap so daemon can write logs on first start - plist: move StandardOut/ErrorPath from world-readable /tmp to ~/Library/Logs/com.nodespace/nodespaced.log (standard macOS location) - release.yml: upload .app bundle artifact from build-tauri-macos-arm and build-tauri (macOS Intel) unconditionally; build-pkg-macos now downloads the artifact instead of re-running a full tauri build, saving 20-30 min per matrix leg - release.yml: remove dead `tauri_job` field from build-pkg-macos matrix - release.yml: move signing identities to job-level env block in build-pkg-macos for consistency - Cargo.toml: expand comment on `pro` feature explaining its effect Co-Authored-By: Claude <[email protected]>
Review feedback addressed (commit a01dd20)Blockers fixedBLOCKER 1 — BLOCKER 2 —
Improvements appliedIMPROVEMENT 1 — Signing identities in env block ( IMPROVEMENT 2 — LaunchAgent logs to user log directory ( IMPROVEMENT 3 — Codesign verification before executing as root ( Nitpick — Skipped (with rationale)
|
Re-Review: commit a01dd20Both blockers from the prior review are fixed. One new correctness issue was introduced by the fix. Blocker VerificationBLOCKER 1 — BLOCKER 2 — New Issue Introduced by This Commit[Critical/Blocker]
All artifact upload steps in this file, including the two new ones added in this commit, use Fix: change Improvements Applied (confirmed)
SummaryThe two original blockers are properly resolved. The artifact version mismatch ( |
…nly pkg job - Remove macos-pkg-intel matrix leg — ARM-only .pkg (Intel Macs not supported) - Remove Intel .app artifact upload from build-tauri matrix job - Collapse build-pkg-macos from a matrix to a single ARM job - Fix actions/download-artifact@v4 → @v7 (must match upload @v7 across workflow) - TRIPLE is now a job-level env var (aarch64-apple-darwin), not a matrix param - workflow_dispatch option renamed macos-pkg-arm + macos-pkg-intel → macos-pkg Co-Authored-By: Claude <[email protected]>
Closes #1448