Skip to content

chore(rust): use cargo-shear to toggle Cargo.toml [lib] test = bool#8622

Merged
Boshen merged 1 commit intomainfrom
03-10-chorec_rust_use_cargo-shear_to_toggle_cargo.toml_lib_test_bool
Mar 10, 2026
Merged

chore(rust): use cargo-shear to toggle Cargo.toml [lib] test = bool#8622
Boshen merged 1 commit intomainfrom
03-10-chorec_rust_use_cargo-shear_to_toggle_cargo.toml_lib_test_bool

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Mar 10, 2026

Summary

  • Use cargo-shear to set [lib] test = false on crates that have no tests, and test = true on crates that do.
  • This skips building empty test harnesses, reducing cargo test wall time by ~45% (24s → 13s).
  • Add just shear command for toggling.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 10, 2026 14:03
@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 8c1f03b
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69b024da089ece0008cc241e

@Boshen Boshen force-pushed the 03-10-chorec_rust_use_cargo-shear_to_toggle_cargo.toml_lib_test_bool branch from ca360a3 to 8c1f03b Compare March 10, 2026 14:04
Copy link

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

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: ca360a3db2

ℹ️ 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".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates workspace manifests and tooling to support using cargo-shear (pinned to v1.10.0) alongside consistent Cargo target settings, primarily around [lib] test = false (and related [lib] flags) across multiple crates.

Changes:

  • Pin cargo-shear to 1.10.0 in local setup (justfile) and CI workflows.
  • Add/adjust [lib] test = false across many crates (and adjust some existing [lib] doctest/test flags).
  • Minor manifest/module cleanup (e.g., empty module file content removal).

Reviewed changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tasks/generator/Cargo.toml Add [lib] test = false for the generator crate.
justfile Pin cargo-shear installation to cargo-shear@1.10.0.
crates/rolldown_utils/Cargo.toml Remove [lib] doctest = false (leaves empty [lib] table).
crates/rolldown_testing/Cargo.toml Remove [lib] test = false (keeps doctest = false).
crates/rolldown_std_utils/Cargo.toml Remove [lib] doctest = false.
crates/rolldown_resolver/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_web_worker_post/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_wasm_fallback/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_transform/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_resolve/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_reporter/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_react_refresh_wrapper/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_module_preload_polyfill/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_manifest/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_load_fallback/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_import_glob/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_html_inline_proxy/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_html/Cargo.toml Remove [lib] doctest = false.
crates/rolldown_plugin_vite_css_post/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_css/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_build_import_analysis/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_asset_import_meta_url/Cargo.toml Remove [lib] doctest = false.
crates/rolldown_plugin_vite_asset/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_vite_alias/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_oxc_runtime/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_lazy_compilation/Cargo.toml Add [lib] test = false and doctest = false.
crates/rolldown_plugin_isolated_declaration/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_hmr/Cargo.toml Add [lib] test = false and doctest = false.
crates/rolldown_plugin_esm_external_require/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_data_url/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_copy_module/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_chunk_import_map/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_bundle_analyzer/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_plugin_asset_module/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_fs_watcher/Cargo.toml Add [lib] test = false and doctest = false.
crates/rolldown_ecmascript/Cargo.toml Remove [lib] doctest = false.
crates/rolldown_devtools_action/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_devtools/Cargo.toml Replace [lib] doctest = false with [lib] test = false.
crates/rolldown_dev_common/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_dev/Cargo.toml Add [lib] test = false (keeps doctest = false).
crates/rolldown_common/src/asset/mod.rs Remove empty file content (file becomes empty).
crates/rolldown_common/Cargo.toml Remove [lib] doctest = false.
crates/rolldown/Cargo.toml Remove [lib] doctest = false (leaves empty [lib] table).
.github/workflows/copilot-setup-steps.yml Pin cargo-shear tool install to 1.10.0 for Copilot setup.
.github/workflows/autofix.yml Bump cargo-shear in autofix workflow to 1.10.0.

@Boshen Boshen marked this pull request as draft March 10, 2026 14:12
@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2026

Benchmarks Rust

  • target: main(fa807c2)
  • pr: 03-10-chorec_rust_use_cargo-shear_to_toggle_cargo.toml_lib_test_bool(8c1f03b)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.05     86.3±2.18ms        ? ?/sec    1.00     82.6±2.76ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.02     94.0±2.07ms        ? ?/sec    1.00     92.6±2.45ms        ? ?/sec
bundle/bundle@rome_ts                                        1.07    181.5±4.33ms        ? ?/sec    1.00    170.1±5.82ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.03    195.5±4.85ms        ? ?/sec    1.00    189.8±5.78ms        ? ?/sec
bundle/bundle@threejs                                        1.09     83.0±5.21ms        ? ?/sec    1.00     75.9±3.51ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.06     87.7±2.95ms        ? ?/sec    1.00     83.1±3.20ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00   790.4±10.12ms        ? ?/sec    1.00    791.3±8.97ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    897.6±8.04ms        ? ?/sec    1.02    911.1±8.46ms        ? ?/sec
scan/scan@rome_ts                                            1.01     81.5±2.53ms        ? ?/sec    1.00     80.5±2.09ms        ? ?/sec
scan/scan@threejs                                            1.00     28.0±0.46ms        ? ?/sec    1.01     28.1±0.51ms        ? ?/sec
scan/scan@threejs10x                                         1.00    270.6±4.63ms        ? ?/sec    1.00    270.5±4.05ms        ? ?/sec

@Boshen Boshen marked this pull request as ready for review March 10, 2026 14:29
@Boshen Boshen merged commit d88eb83 into main Mar 10, 2026
41 checks passed
@Boshen Boshen deleted the 03-10-chorec_rust_use_cargo-shear_to_toggle_cargo.toml_lib_test_bool branch March 10, 2026 14:35
Copy link

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

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: 8c1f03b34e

ℹ️ 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 on lines 13 to 14
[lib]
doctest = false

Choose a reason for hiding this comment

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

P2 Badge Restore doctest disablement for vite asset import-meta crate

Removing doctest = false from this manifest re-enables doctests, but the existing example in src/utils.rs (strip_query(...) at lines 104-108) is not written as a public API snippet and cannot be resolved from a doctest crate, while src/lib.rs keeps utils private (mod utils;). As a result, cargo test -p rolldown_plugin_vite_asset_import_meta_url --doc will fail until those docs are rewritten (or doctests are disabled again).

Useful? React with 👍 / 👎.

Comment on lines 14 to 15
[lib]
doctest = false

Choose a reason for hiding this comment

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

P2 Badge Keep doctests disabled until concat_string docs are fixed

This change enables doctests for rolldown_utils, but src/concat_string.rs has a Rust example that imports extern crate concat_string; (lines 20-21), and this package does not provide or depend on a crate by that name. With doctests enabled, that example becomes a compile error in cargo test -p rolldown_utils --doc, so the manifest should keep doctests off until the snippet is updated to valid rolldown_utils usage.

Useful? React with 👍 / 👎.

This was referenced Mar 11, 2026
shulaoda added a commit that referenced this pull request Mar 11, 2026
## [1.0.0-rc.9] - 2026-03-11

### 💥 BREAKING CHANGES

- rename exported BindingMagicString to RolldownMagicString (#8626) by @IWANABETHATGUY

### 🚀 Features

- rolldown: add isRolldownMagicString property for reliable native detection (#8614) by @IWANABETHATGUY
- cli: align object type with rollup (#8598) by @h-a-n-a

### 🐛 Bug Fixes

- rust: circular inter-chunk imports when external dynamic imports exist (#8596) by @Dunqing
- update minify default docs from `false` to `'dce-only'` (#8620) by @shulaoda

### 💼 Other

- fix early exit in script build-node (#8617) by @h-a-n-a

### 🚜 Refactor

- binding: remove outdated TODO comment in MagicString to_string() (#8613) by @IWANABETHATGUY

### 📚 Documentation

- add viteplus alpha announcement banner (#8615) by @mdong1909
- update VitePress theme to 4.8.2 for narrow-screen layout regression (#8612) by @Copilot

### ⚡ Performance

- merge 4 integration test binaries into 1 (#8610) by @Boshen

### 🧪 Testing

- replace heavy filename_with_hash test with targeted hash fixtures (#8597) by @Boshen

### ⚙️ Miscellaneous Tasks

- ci: remove redundant `--no-run` build step from cargo-test (#8623) by @Boshen
- rust: use `cargo-shear` to toggle Cargo.toml [lib] test = bool (#8622) by @Boshen
- deps: update test262 submodule for tests (#8611) by @sapphi-red
- skip macOS CI jobs on pull requests (#8608) by @Copilot
- add rust cache to repo validation job (#8607) by @Boshen
- skip running empty bin test targets (#8605) by @Boshen
- skip building examples in cargo-test to reduce build time (#8603) by @Boshen
- switch plain workflow checkouts to taiki-e action (#8601) by @Boshen
- skip Windows CI jobs on PRs (#8600) by @Boshen
- remove unused asset module (#8594) by @shulaoda

### ◀️ Revert

- "docs: add viteplus alpha announcement banner (#8615)" (#8616) by @shulaoda

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