Skip to content

refactor(rolldown_dev): move dev example to break publish cycle#9465

Merged
Boshen merged 1 commit into
mainfrom
refactor/break-dev-publish-cycle
May 20, 2026
Merged

refactor(rolldown_dev): move dev example to break publish cycle#9465
Boshen merged 1 commit into
mainfrom
refactor/break-dev-publish-cycle

Conversation

@Boshen

@Boshen Boshen commented May 19, 2026

Copy link
Copy Markdown
Member

Summary

Moves crates/rolldown/examples/dev.rscrates/rolldown_dev/examples/dev.rs and removes rolldown_dev from rolldown's [dev-dependencies]. This breaks a circular dependency that would deadlock publishing to crates.io.

The cycle

  • rolldown_dev/Cargo.toml: rolldown = { workspace = true, ... }normal dep
  • rolldown/Cargo.toml: rolldown_dev = { path = "../rolldown_dev" }dev-dep, used only by examples/dev.rs

Both crates depend on each other. There is no valid topological order: cargo publish -p rolldown requires rolldown_dev to already exist on crates.io (or be strippable), and cargo publish -p rolldown_dev requires rolldown to already exist on crates.io.

Why it has worked so far

Cargo silently strips path-only dev-dependencies that have no version requirement from the uploaded manifest. So rolldown 0.1.0 did publish on 2025-10-17 even though rolldown_dev was never on crates.io.

That behavior is fragile:

  1. The day someone writes rolldown_dev = { path = "../rolldown_dev", version = "0.1.0" } (matching the workspace style used everywhere else), the strip stops happening and the cycle becomes a hard publish failure.
  2. Any release-ordering tool that walks cargo metadata sees the cycle and refuses to compute an order unless it special-cases DependencyKind::Development.
  3. It locks us into "no version on this dev-dep, forever" as an invisible rule.

The example logically belongs to rolldown_dev (it demonstrates DevEngine/BundlerConfigrolldown_dev's public API), so moving it is the natural fix, not a workaround.

Changes

  • crates/rolldown_dev/examples/dev.rs: moved here; comment updated to cargo run -p rolldown_dev --example dev.
  • crates/rolldown/Cargo.toml: drop rolldown_dev dev-dep.
  • crates/rolldown_dev/Cargo.toml: add rolldown_workspace as a dev-dep (needed by the example).
  • Cargo.lock: regenerated.

Note on the second cycle

There is an identical cycle between rolldown and rolldown_testing (also a path-only dev-dep without version). That one is harder to remove because many crates' tests use rolldown_testing. It is left as-is — it will keep working under the same path-only-strip rule, and the fix is the same shape if it ever needs to be done.

…lish cycle

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4f96a5ad3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rolldown_dev/examples/dev.rs
@codspeed-hq

codspeed-hq Bot commented May 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing refactor/break-dev-publish-cycle (a4f96a5) with main (0f811f4)2

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (036a9aa) during the generation of this report, so 0f811f4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@netlify

netlify Bot commented May 19, 2026

Copy link
Copy Markdown

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit a4f96a5
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6a0c6daab882f20008c408cf

@Boshen Boshen merged commit 381a058 into main May 20, 2026
75 of 78 checks passed
@Boshen Boshen deleted the refactor/break-dev-publish-cycle branch May 20, 2026 01:34
@rolldown-guard rolldown-guard Bot mentioned this pull request May 20, 2026
shulaoda added a commit that referenced this pull request May 20, 2026
## [1.0.2] - 2026-05-20

### 🚀 Features

- devtools: emit package size in PackageGraphReady (#9434) by @IWANABETHATGUY
- devtools: classify package dependency types (#9427) by @IWANABETHATGUY
- devtools: map packages to modules and chunks (#9426) by @IWANABETHATGUY
- devtools: mark used packages (#9423) by @IWANABETHATGUY
- devtools: make duplicate packages discoverable (#9422) by @IWANABETHATGUY
- devtools: emit package metadata (#9421) by @IWANABETHATGUY
- update oxc to 0.132.0 (#9449) by @shulaoda
- update oxc to 0.131.0 (#9424) by @shulaoda
- allow checks.* to escalate emissions to hard errors (#9388) by @IWANABETHATGUY
- dev: support watcher options `include` and `exclude` (#9395) by @h-a-n-a
- emit warnings for invalid pure annotations (#9381) by @Kyujenius

### 🐛 Bug Fixes

- hash: keep chunk file names stable when an unrelated entry is added (#9444) by @hyf0
- call `codeSplitting.groups[].name` in deterministic order (#9457) by @sapphi-red
- dev/lazy: make `resolve_id` idempotent when the resolved id is already a lazy entry (#9439) by @h-a-n-a
- chunk-optimization: publish absorbed dynamic-entry namespace cross-chunk (#9448) by @IWANABETHATGUY
- treeshake: propagate pure annotation through compound exprs (#9431) by @Dunqing
- finalizer: skip redundant init call when barrel executes in same chunk (#9354) by @IWANABETHATGUY
- linking: initialize wrapped ESM re-export owners (#9353) by @IWANABETHATGUY
- do not inherit __toESM across chunks for named-only external imports (#9333) (#9415) by @IWANABETHATGUY
- watcher: don't write output or emit events after close() (#9328) by @situ2001
- chunk-optimization: avoid unsafe dynamic-only merges (#9398) by @IWANABETHATGUY
- cjs: rename CJS-wrapped locals that would shadow chunk-scope names (#9392) by @hyf0
- dev/lazy: watch lazy modules added in rebuilds (#9391) by @h-a-n-a

### 🚜 Refactor

- rolldown_dev: move dev example to break publish cycle (#9465) by @Boshen
- binding: drop unsafe napi string helper, hoist transform ArcStr (#9456) by @hyf0
- ecmascript_utils: split rewrite_ident_reference off JsxExt trait (#9417) by @IWANABETHATGUY
- use `ThreadsafeFunction::call_async_catch` (#9390) by @sapphi-red

### 📚 Documentation

- devtools: document @rolldown/debug usage and package graph consumption (#9435) by @IWANABETHATGUY
- replace `Inter` with system font stack in OG template SVG (#9240) by @yvbopeng
- remove `output.comments` warning as all issues have been resolved (#9393) by @sapphi-red
- in-depth: clarify @__PURE__ scope and document positions (#9389) by @Kyujenius
- readme: remove release candidate notice (#9387) by @shulaoda

### ⚡ Performance

- vite-resolve: cache importer existence checks (#9443) by @Brooooooklyn
- binding: reduce plugin string clones (#9436) by @Brooooooklyn

### 🧪 Testing

- enable `legal_comments_inline` test (#9394) by @sapphi-red

### ⚙️ Miscellaneous Tasks

- bump pnpm to v11.1.2 (#9447) by @Boshen
- deps: update rust crates (#9461) by @renovate[bot]
- deps: update rollup submodule for tests to v4.60.4 (#9453) by @rolldown-guard[bot]
- deps: update test262 submodule for tests (#9454) by @rolldown-guard[bot]
- deps: update npm packages (#9430) by @renovate[bot]
- deps: update github actions (#9429) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.25.1 (#9452) by @renovate[bot]
- deps: update rust crates (#9428) by @renovate[bot]
- revert allow checks.* to escalate emissions to hard errors (#9388) (#9438) by @IWANABETHATGUY
- update mimalloc-safe to 0.1.61 (#9413) by @shulaoda
- deny `todo`, `unimplemented`, and `print_stderr` clippy lints (#9412) by @Boshen
- deps: update mimalloc-safe to 0.1.60 (#9410) by @shulaoda
- remove `pip install setuptools` workaround for node-gyp on macOS (#9370) by @sapphi-red
- renovate: disable automerge to require manual approval (#9386) by @shulaoda
- deps: update napi (#9385) by @renovate[bot]

### ❤️ New Contributors

* @yvbopeng made their first contribution in [#9240](#9240)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
Boshen added a commit that referenced this pull request May 21, 2026
#9465 moved the dev example into rolldown_dev/examples/ after this
branch had already dropped tokio from rolldown_dev. CI caught the
`#[tokio::main]` left in the example because rolldown_dev's
clippy lint now compiles cleanly. Drive the example with
pollster::block_on instead — pollster is already a workspace dep
of rolldown_dev for the coordinator-spawn pattern in Phase 4d.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Boshen added a commit that referenced this pull request May 23, 2026
#9465 moved the dev example into rolldown_dev/examples/ after this
branch had already dropped tokio from rolldown_dev. CI caught the
`#[tokio::main]` left in the example because rolldown_dev's
clippy lint now compiles cleanly. Drive the example with
pollster::block_on instead — pollster is already a workspace dep
of rolldown_dev for the coordinator-spawn pattern in Phase 4d.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
V1OL3TF0X pushed a commit to V1OL3TF0X/rolldown that referenced this pull request May 25, 2026
…down#9465)

## Summary

Moves `crates/rolldown/examples/dev.rs` →
`crates/rolldown_dev/examples/dev.rs` and removes `rolldown_dev` from
`rolldown`'s `[dev-dependencies]`. This breaks a circular dependency
that would deadlock publishing to crates.io.

## The cycle

- `rolldown_dev/Cargo.toml`: `rolldown = { workspace = true, ... }` —
**normal dep**
- `rolldown/Cargo.toml`: `rolldown_dev = { path = "../rolldown_dev" }` —
**dev-dep, used only by `examples/dev.rs`**

Both crates depend on each other. There is no valid topological order:
`cargo publish -p rolldown` requires `rolldown_dev` to already exist on
crates.io (or be strippable), and `cargo publish -p rolldown_dev`
requires `rolldown` to already exist on crates.io.

## Why it has worked so far

Cargo silently strips path-only dev-dependencies that have no `version`
requirement from the uploaded manifest. So `rolldown 0.1.0` did publish
on 2025-10-17 even though `rolldown_dev` was never on crates.io.

That behavior is fragile:

1. The day someone writes `rolldown_dev = { path = "../rolldown_dev",
version = "0.1.0" }` (matching the workspace style used everywhere
else), the strip stops happening and the cycle becomes a hard publish
failure.
2. Any release-ordering tool that walks `cargo metadata` sees the cycle
and refuses to compute an order unless it special-cases
`DependencyKind::Development`.
3. It locks us into "no version on this dev-dep, forever" as an
invisible rule.

The example logically belongs to `rolldown_dev` (it demonstrates
`DevEngine`/`BundlerConfig` — `rolldown_dev`'s public API), so moving it
is the natural fix, not a workaround.

## Changes

- `crates/rolldown_dev/examples/dev.rs`: moved here; comment updated to
`cargo run -p rolldown_dev --example dev`.
- `crates/rolldown/Cargo.toml`: drop `rolldown_dev` dev-dep.
- `crates/rolldown_dev/Cargo.toml`: add `rolldown_workspace` as a
dev-dep (needed by the example).
- `Cargo.lock`: regenerated.

## Note on the second cycle

There is an identical cycle between `rolldown` and `rolldown_testing`
(also a path-only dev-dep without version). That one is harder to remove
because many crates' tests use `rolldown_testing`. It is left as-is — it
will keep working under the same path-only-strip rule, and the fix is
the same shape if it ever needs to be done.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
V1OL3TF0X pushed a commit to V1OL3TF0X/rolldown that referenced this pull request May 25, 2026
## [1.0.2] - 2026-05-20

### 🚀 Features

- devtools: emit package size in PackageGraphReady (rolldown#9434) by @IWANABETHATGUY
- devtools: classify package dependency types (rolldown#9427) by @IWANABETHATGUY
- devtools: map packages to modules and chunks (rolldown#9426) by @IWANABETHATGUY
- devtools: mark used packages (rolldown#9423) by @IWANABETHATGUY
- devtools: make duplicate packages discoverable (rolldown#9422) by @IWANABETHATGUY
- devtools: emit package metadata (rolldown#9421) by @IWANABETHATGUY
- update oxc to 0.132.0 (rolldown#9449) by @shulaoda
- update oxc to 0.131.0 (rolldown#9424) by @shulaoda
- allow checks.* to escalate emissions to hard errors (rolldown#9388) by @IWANABETHATGUY
- dev: support watcher options `include` and `exclude` (rolldown#9395) by @h-a-n-a
- emit warnings for invalid pure annotations (rolldown#9381) by @Kyujenius

### 🐛 Bug Fixes

- hash: keep chunk file names stable when an unrelated entry is added (rolldown#9444) by @hyf0
- call `codeSplitting.groups[].name` in deterministic order (rolldown#9457) by @sapphi-red
- dev/lazy: make `resolve_id` idempotent when the resolved id is already a lazy entry (rolldown#9439) by @h-a-n-a
- chunk-optimization: publish absorbed dynamic-entry namespace cross-chunk (rolldown#9448) by @IWANABETHATGUY
- treeshake: propagate pure annotation through compound exprs (rolldown#9431) by @Dunqing
- finalizer: skip redundant init call when barrel executes in same chunk (rolldown#9354) by @IWANABETHATGUY
- linking: initialize wrapped ESM re-export owners (rolldown#9353) by @IWANABETHATGUY
- do not inherit __toESM across chunks for named-only external imports (rolldown#9333) (rolldown#9415) by @IWANABETHATGUY
- watcher: don't write output or emit events after close() (rolldown#9328) by @situ2001
- chunk-optimization: avoid unsafe dynamic-only merges (rolldown#9398) by @IWANABETHATGUY
- cjs: rename CJS-wrapped locals that would shadow chunk-scope names (rolldown#9392) by @hyf0
- dev/lazy: watch lazy modules added in rebuilds (rolldown#9391) by @h-a-n-a

### 🚜 Refactor

- rolldown_dev: move dev example to break publish cycle (rolldown#9465) by @Boshen
- binding: drop unsafe napi string helper, hoist transform ArcStr (rolldown#9456) by @hyf0
- ecmascript_utils: split rewrite_ident_reference off JsxExt trait (rolldown#9417) by @IWANABETHATGUY
- use `ThreadsafeFunction::call_async_catch` (rolldown#9390) by @sapphi-red

### 📚 Documentation

- devtools: document @rolldown/debug usage and package graph consumption (rolldown#9435) by @IWANABETHATGUY
- replace `Inter` with system font stack in OG template SVG (rolldown#9240) by @yvbopeng
- remove `output.comments` warning as all issues have been resolved (rolldown#9393) by @sapphi-red
- in-depth: clarify @__PURE__ scope and document positions (rolldown#9389) by @Kyujenius
- readme: remove release candidate notice (rolldown#9387) by @shulaoda

### ⚡ Performance

- vite-resolve: cache importer existence checks (rolldown#9443) by @Brooooooklyn
- binding: reduce plugin string clones (rolldown#9436) by @Brooooooklyn

### 🧪 Testing

- enable `legal_comments_inline` test (rolldown#9394) by @sapphi-red

### ⚙️ Miscellaneous Tasks

- bump pnpm to v11.1.2 (rolldown#9447) by @Boshen
- deps: update rust crates (rolldown#9461) by @renovate[bot]
- deps: update rollup submodule for tests to v4.60.4 (rolldown#9453) by @rolldown-guard[bot]
- deps: update test262 submodule for tests (rolldown#9454) by @rolldown-guard[bot]
- deps: update npm packages (rolldown#9430) by @renovate[bot]
- deps: update github actions (rolldown#9429) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.25.1 (rolldown#9452) by @renovate[bot]
- deps: update rust crates (rolldown#9428) by @renovate[bot]
- revert allow checks.* to escalate emissions to hard errors (rolldown#9388) (rolldown#9438) by @IWANABETHATGUY
- update mimalloc-safe to 0.1.61 (rolldown#9413) by @shulaoda
- deny `todo`, `unimplemented`, and `print_stderr` clippy lints (rolldown#9412) by @Boshen
- deps: update mimalloc-safe to 0.1.60 (rolldown#9410) by @shulaoda
- remove `pip install setuptools` workaround for node-gyp on macOS (rolldown#9370) by @sapphi-red
- renovate: disable automerge to require manual approval (rolldown#9386) by @shulaoda
- deps: update napi (rolldown#9385) by @renovate[bot]

### ❤️ New Contributors

* @yvbopeng made their first contribution in [rolldown#9240](rolldown#9240)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
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.

3 participants