Skip to content

Navigation Menu

Sign in
Sign up

fix: preserve runtime discovery and seed layout across SDKs - #210

Open
f0rr0 wants to merge 3 commits into
main from
f0rr0/fix-installed-native-sdk-bootstrap
Open

fix: preserve runtime discovery and seed layout across SDKs #210
f0rr0 wants to merge 3 commits into
main from
f0rr0/fix-installed-native-sdk-bootstrap

Conversation

@f0rr0

@f0rr0 f0rr0 commented Sep 8, 2026
edited
Loading

Copy link
Copy Markdown
Owner

Summary

Fresh installs can fail before their first query because runtime discovery misses packaged resources, package tools omit empty PostgreSQL directories, or copied PGDATA permissions are too broad.

  • Share Rust resource discovery with the native library loader and move exported-macro error construction into a public, hidden SDK helper.
  • Carry native seed directory inventories as regular files through Cargo/npm packaging and recreate the recorded directories during materialization. Reject incomplete producer layouts and unsafe paths.
  • Run split WASIX initdb for new memory/directory databases when no seed is supplied. Reject incomplete seed archive/manifest pairs and preserve existing roots.
  • Validate native and WASIX seeds against the same PostgreSQL directory contract. Include that contract in WASIX build/test cache inputs.
  • Normalize newly published PGDATA to owner-only access in native TypeScript, Kotlin Android, and WASIX Rust; reuse the WASIX restore permission helper. Native Rust and Swift already do this.

Cross-SDK tracing confirms native Node/Bun/Deno share initialization, server-side WASIX TypeScript delegates to WASIX Rust through N-API, and React Native delegates to Swift/Kotlin. Browser WASIX retains explicit archive directories in its virtual filesystem. Swift and Android already reconstruct required empty directories. Native mobile producers use the shared native seed validator. Packaged Swift/Android libraries use platform linking/loading; the exported-macro visibility defect is specific to Rust.

Existing regression tests cover external macro visibility, library lookup, package directory transport/restoration, and publication permissions. One focused WASIX producer test rejects a missing pg_notify. No new dependencies. A single additional runtime smoke test covers memory/directory initialization and durable rows after reopening; it was executed with and without seed artifacts.

Release Intent

  • Package/API/runtime change: PR title uses fix:.
  • Docs/CI/repository-only change: no release intended.
  • Source/input/runtime asset change: shared seed validation and packaging updated. No source pins changed.

Verification

  • moon run dev-tools:doctor — not run.

  • SDK contracts; native Rust/TypeScript compile, unit, and package tasks; TypeScript typecheck; Rust/JS formatting and JS lint.

  • Native Rust/build-helper Clippy; xtask Clippy and all 45 tests.

  • Release unit suite, focused Cargo archive/consumer checks, native seed validator tests, and release graph tests.

  • WASIX Rust: 194 unit tests, compile, and package; WASIX TypeScript: 338 unit tests.

  • Swift: 94 unit tests and C bridge checks on Linux.

  • Kotlin Android: 50 runtime-resource tests, static checks/compilation, and Maven package task.

  • Disposable Linux consumers using freshly packed native Cargo/npm artifacts and real 0.2.0 release binaries: both returned 42 and reopened in a second process without library/resource discovery overrides; npm PGDATA was 0700.

  • WASIX patch-stack check.

  • Full WASIX portable/AOT rebuild: attempted, but source acquisition stalled at the pinned libiconv URL; an independent request returned HTTP 502. Stopped the retrying fetch. No freshly rebuilt WASIX binaries claimed.

  • WASIX seed-free initialization prerequisite: removed both seed archives/manifests from a disposable 0.2.0 portable asset tree, compiled the current binding against the released portable/AOT runtime, and passed memory/directory creation plus reopen with durable row 42. The same test passed with seeds present.

  • Missing archive with a present seed manifest rejected during the Cargo asset build.

  • Current WASIX Rust product compile/package, 194 unit tests, 8 public API tests, doctests, SDK contracts, and formatting. Unit task groups passed separately; concurrent execution produced a doctest import failure.

The optional-download rollout remains incomplete. Native mobile has no seed-free initialization API, browser WASIX needs its initdb path, and default payloads still include seeds (the N-API build also embeds ICU data). The architecture document records the agreed package contract and prerequisites. No optional seed packages or release targets are advertised by this PR.

Used repository-pinned Moon 2.5.4. Android-device, iOS, macOS, and Windows installed-package execution was not run.

vercel Bot commented Sep 8, 2026
edited
Loading

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
oliphaunt-docs Ready Ready Preview Sep 8, 2026 11:33pm UTC

@f0rr0 f0rr0 changed the title (削除) fix: restore installed native SDK bootstrap (削除ここまで) (追記) fix: preserve runtime discovery and seed layout across SDKs (追記ここまで) Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /