Skip to content

Publish the shared crates to crates.io at the weft release version - #71

Merged
easel merged 1 commit into
mainfrom
claude/publish-shared-crates
Nov 16, 2026
Merged

easel merged 1 commit into
mainfrom
claude/publish-shared-crates

Conversation

@easel

@easel easel commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Publish weft-model, weft-expr, weft-backend and weft-postgresql-emit to crates.io so other compilers (Fireweed) depend on published crates instead of git. Follows #70.

Versioning

  • One version everywhere. The four crates drop their own versions and inherit the Cargo workspace version. That version becomes the release version (0.4.58), so the tag, the umf-weft wheel and the crates all match. weft-python inherits it too.
  • Exact pins. [workspace.dependencies] pins the four crates at =0.4.58 for each other.
  • Compile responses are unchanged. compilerVersion used to come from the old workspace version. It is now the constant weft_core::COMPILER_VERSION with the same value, weft/0.1.0.

Release and CI

  • Release check. scripts/check-release-version.py checks the workspace version against the tag. With --shared-crates, which already runs in CI, it also checks that each crate inherits the version, sets publish = ["crates-io"] and is pinned at exactly that version.
  • New CI job crates. Packages and builds the four crates as crates.io would, without uploading:
    cargo +1.97.1 publish --dry-run --locked -p weft-model -p weft-expr -p weft-backend -p weft-postgresql-emit
    
    It uses cargo 1.97.1 because cargo 1.90 hits an internal error (no hash listed for weft-backend) verifying a batch of crates that depend on each other. The rust job still builds them on the pinned 1.90.
  • New release job crates. After the wheels pass, it publishes the four crates in dependency order, alongside the PyPI upload.
  • AGENTS.md release steps list the new version fields to bump.

Other changes

  • Schema moved. The compiled-in UMF 0.10 schema moves to crates/weft-model/schema/, so the published crate carries it. scripts/upstream/bundle-umf010-schema.py reproduces it byte for byte. The sdist includes it, and a wheel built from the sdist works.
  • Inventory. The module-boundary inventory no longer records version requirements of in-repo path dependencies, so a release bump does not touch it. External version pins are still recorded.

Before the first publish

  • Add the token. Create a crates-io environment with a CARGO_REGISTRY_TOKEN secret. Trusted publishing can replace it once the crates exist.
  • Two weft-model build settings don't travel with the crate. The weft-model README documents both:
    • the ahash no-rng patch;
    • the wasm32 getrandom_backend cfg.
  • Tests don't ship working. A few unit tests read fixtures from outside their crate. The published library builds, but cargo test on a downloaded crate fails.
  • Partial releases are possible. PyPI and crates.io publish as separate jobs, so one can succeed while the other fails.

Checked locally (same tree as this commit)

  • cargo test --workspace --locked: 1,137 tests pass.
  • Nightly candidate job: 1,171 tests pass.
  • Builds: the qualified, engine-temporal and WASM feature builds compile.
  • Repo checks: specs:check, modules:check, tests/module-boundaries/check.py, the tree-size check and both modes of the release-version check pass.
  • Python: the wheel builds, and every installed-wheel check and native/wheel agreement check in CI's python job passes.
  • Fixture generators produce no drift.
  • maturin sdist, then a wheel built from that sdist, succeeds.
  • The cargo +1.97.1 publish --dry-run above succeeds.

Not exercised: an actual upload to crates.io.

🤖 Generated with Claude Code

The four shared crates (weft-model, weft-expr, weft-backend,
weft-postgresql-emit) drop their own versions: they inherit the Cargo
workspace version, which becomes the release version (0.4.58), and are
pinned at exactly that version in [workspace.dependencies]. weft-python
inherits it too. compilerVersion in compile responses stays weft/0.1.0
(weft_core::COMPILER_VERSION), so responses do not change.

- check-release-version.py checks the workspace version against the tag;
  --shared-crates checks inheritance, publish = ["crates-io"] and the pins.
- CI packages and builds the four crates as crates.io would
  (cargo +1.97.1 publish --dry-run; cargo 1.90 hits an internal error
  verifying a batch of interdependent crates). The release workflow
  publishes them after the wheels pass, with CARGO_REGISTRY_TOKEN.
- The bundled UMF 0.10 schema moves into crates/weft-model/schema so the
  crate carries it; the generator reproduces it byte for byte.
- The module-boundary inventory no longer records version requirements of
  workspace path dependencies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@easel
easel merged commit ca631ad into main Nov 16, 2026
10 checks passed
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