Files
craft-libs/crates/nightly
Dylan M. Taylor 1f6c3a21f8 feat(nightly): add shared craft-nightly profile isolation crate (#4270)
* feat(nightly): add shared craft-nightly profile isolation crate

* fix(nightly): preserve startup isolation and document profile migration

* feat(craft): expose craft-nightly through facade crate

* fix(nightly): reject misplaced protocol flags and use zero-access Windows metadata query
2026-11-29 10:31:11 -05:00
..

craft-nightly

Shared nightly-v1 startup and profile-root validation, for use by desktop apps and the launcher.

Rollout contract

  • Call prepare_launch before opening any application-owned settings, cache, logs, databases, or other persistent state. Propagate the selected root to helpers that access those paths. Exit on version-only queries before opening data paths; they intentionally install no global profile.
  • Stable builds retain their existing data paths; nightly builds use the selected profile root. Do not redirect stable data into a nightly profile or use a stable root as a fallback when validation fails.
  • canonical_profile_root is the default for new native nightly profiles. Existing launcher installs may have data in the launcher's paths.data/profiles/<app> directory. Before changing the launcher to the new default, preserve those profiles: continue passing the existing validated root explicitly until a separately tested, non-destructive migration can be performed. Never overwrite a populated destination or silently abandon a populated source. Direct launches and launcher launches must agree on the selected root after migration; the Flatpak sandbox uses its own XDG data scope, not a host filesystem path passed blindly into the sandbox.
  • Validate each app's actual stable paths and environment overrides, not just its package ID. Test existing stable and nightly settings, direct launch and launcher launch, overrides, literal arguments, and platform-specific storage behavior before rollout.

The validator checks the profile at startup; it is not a sandbox or a replacement for safe filesystem operations in applications. Keep launcher-side transaction and installation protections when adopting this crate. Windows uses the same safe Win32 wrapper already used by the launcher for file link identity checks.