Skip to content

Publish the workspace crates to Unity's internal Cargo registry - #18

Merged
chris-addison merged 1 commit into
unity/hub-consolidatedfrom
unity/HUB-0000-publish-unity-registry
Oct 20, 2026
Merged

chris-addison merged 1 commit into
unity/hub-consolidatedfrom
unity/HUB-0000-publish-unity-registry

Conversation

@chris-addison

Copy link
Copy Markdown
Collaborator

Makes the workspace crates publishable to Unity's internal Cargo registry, so the Unity Hub can publish the crates it pins from its own publish-crates.yml (Unity-Technologies/unity-hub#17705). The Hub's cloud-ui crate depends on this fork, and cargo publish rejects git dependencies, so these crates have to be in the registry first. This repository runs no publish job itself. The change touches only Cargo manifests, the lockfile and config.

  • Versions: each crate keeps its upstream version with a -unity.20261019 suffix, so nothing collides with upstream gpui-ce on crates.io. Crates publish only to the unity registry, which .cargo/config.toml defines. Their dependencies on each other pin the exact version with registry = "unity".
  • wgsl-rs: now from crates.io at =0.1.0-beta.6 instead of the git pin at b2de16a, which is an ancestor of that release. The fork builds against it unchanged, and it uses this workspace's naga 30, so the second naga is gone from Cargo.lock. deny.toml no longer allows its git source.
  • Test fonts: gpui-ce-fonts stays unpublished, because it embeds font files from outside its crate. Every crate uses it only in tests, so those dev-dependencies are now path-only and cargo publish strips them.
  • Dev-dependency cycles: gpui-ce and gpui_ce_wgpu take gpui_ce_platform as a path-only dev-dependency. gpui_ce_platform depends on both, so a versioned edge back is a cycle that no publish order can satisfy.

To publish a later change, move the suffix on the affected crates.

The Hub pins these with its git rev kept, plus version and registry = "unity":

Crate Version
gpui-ce =0.2.2-unity.20261019
gpui_ce_platform =0.1.0-unity.20261019
gpui_ce_wgpu =0.1.0-unity.20261019
gpui_ce_parley =0.1.0-unity.20261019

Testing

Check Result
✅ cargo publish --workspace --dry-run, fresh clone All 23 crates package, build from their tarballs and reach upload
✅ The Hub job's command: cargo publish --no-verify --dry-run with one -p per crate All 23 crates package and reach upload
✅ cargo check --workspace --all-targets Clean
✅ cargo test -p gpui_ce_render 30 passed, including the wgsl-rs validation tests
✅ renderer_source_audit 4 passed
✅ cargo deny check sources OK

The publish dry runs ran on macOS against a local stand-in for the registry index.

Not covered: an upload to the real registry, which happens from the Hub's workflow. Windows was not compiled locally; gpui_ce_windows uses only vec2f and vec4f from wgsl-rs, the same items the macOS build compiles.

🤖 Generated with Claude Code

Unity is adding an internal Cargo registry (hub-cargo-prod-local on
unity3d.jfrog.io) so other Unity Rust apps can share Hub crates such as
the cloud-ui component library. cloud-ui depends on this fork, and
`cargo publish` rejects git dependencies, so these crates have to be in
the registry first.

- Every crate now publishes only to the `unity` registry, with a
  `-unity.20261019` prerelease suffix on its upstream version. The
  suffix keeps the fork apart from upstream gpui-ce on crates.io, and
  the workspace's own dependencies on each other pin it exactly.
- wgsl-rs comes from crates.io at =0.1.0-beta.6 instead of the git pin
  at b2de16a, which is an ancestor of that release. The fork builds
  against it unchanged, and it shares this workspace's naga 30, so the
  second naga the git pin brought along is gone from Cargo.lock.
- gpui-ce-fonts stays unpublished. It embeds fonts from outside its
  crate, and every crate uses it only in tests, so those dev-dependencies
  drop their version and `cargo publish` strips them.
- gpui-ce and gpui_ce_wgpu take gpui_ce_platform as a path-only
  dev-dependency for the same reason: platform depends on both, and a
  versioned edge back is a cycle no publish order can satisfy.
- .cargo/config.toml names the registry, so a plain checkout publishes
  with `cargo publish --workspace --registry unity --exclude perf
  --exclude gpui-ce-fonts`. This repository is public and runs no
  publish itself: the Unity Hub's CI checks out a pinned commit and
  publishes it. To ship a change, move the affected crates' suffix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chris-addison
chris-addison marked this pull request as ready for review October 20, 2026 02:46
@chris-addison
chris-addison merged commit b72b812 into unity/hub-consolidated Oct 20, 2026
15 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