From 267cfb8c4b26ba54976365b8fa278b95a619e27d Mon Sep 17 00:00:00 2001 From: LoadingALIAS Date: Sun, 20 Sep 2026 16:54:08 -0400 Subject: [PATCH] build(deps): update cargo-rail to 0.29.0 --- .config/rail.toml | 31 +------- docs/cargo-rail-plan.md | 155 ---------------------------------------- mise.toml | 8 +-- 3 files changed, 3 insertions(+), 191 deletions(-) delete mode 100644 docs/cargo-rail-plan.md diff --git a/.config/rail.toml b/.config/rail.toml index fc526d80..29c05025 100644 --- a/.config/rail.toml +++ b/.config/rail.toml @@ -1,26 +1,6 @@ -# cargo-rail configuration -# Documentation: https://github.com/loadingalias/cargo-rail - -# Targets for multi-platform validation -# Include common host targets and WASM for the runtime targets = ["x86_64-unknown-linux-gnu"] [unify] -include_paths = true -include_renamed = false - -strict_version_compat = true -exact_pin_handling = "warn" -major_version_conflict = "warn" -preserve_features = [] -skip_undeclared_patterns = [ - "default", - "std", - "alloc", - "*_backend", - "*_impl", -] - # eryx-wasm-runtime: a staticlib for WASM, not a normal crate. # # eryx-macros: its dev-dependency on eryx must stay a bare path dep with no @@ -34,13 +14,4 @@ skip_undeclared_patterns = [ # does not prevent this - it still converts the member dep - so the crate has to # be excluded from unification outright. exclude = ["eryx-wasm-runtime", "eryx-macros"] -include = [] -max_backups = 3 -msrv_policy = { mode = "compute", source = "workspace" } - - -[release] -tag_prefix = "v" -tag_format = "{crate}-{prefix}{version}" -sign_tags = false -require_changelog_entries = false +msrv_policy = { source = "workspace" } diff --git a/docs/cargo-rail-plan.md b/docs/cargo-rail-plan.md deleted file mode 100644 index e7202271..00000000 --- a/docs/cargo-rail-plan.md +++ /dev/null @@ -1,155 +0,0 @@ -# Cargo-Rail and Feature Testing Plan - -**Status: ✅ IMPLEMENTED** - -## Overview - -Add two complementary tools: -1. **cargo-rail** - Graph-aware monorepo orchestration (dependency unification, dead feature pruning, affected crate detection) -2. **cargo-all-features** - Test all feature flag combinations - -## Tool Purposes - -### cargo-rail -- Unify dependencies to `[workspace.dependencies]` -- Prune dead/unused features -- Detect unused dependencies -- Compute MSRV from dependency graph -- Graph-aware CI (only test affected crates) - -### cargo-all-features -- Build/test all feature combinations for a crate -- Ensures no feature combination breaks compilation -- Configurable via `[package.metadata.cargo-all-features]` - -## Implementation Plan - -### Phase 1: Add cargo-rail - -1. **Add to mise.toml tools** - ```toml - [tools."cargo:cargo-rail"] - version = "latest" - binstall = true - ``` - -2. **Initialize cargo-rail config** - ```bash - cargo rail init # Creates .config/rail.toml - ``` - -3. **Configure `.config/rail.toml`** - ```toml - targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "wasm32-wasip1"] - - [unify] - pin_transitives = false - detect_unused = true - prune_dead_features = true - msrv = true - msrv_source = "max" - - [change-detection] - infrastructure = [".github/**", "scripts/**", "*.sh", "mise.toml"] - ``` - -4. **Add mise tasks** - ```toml - [tasks.unify] - description = "Unify workspace dependencies and prune dead features" - run = "cargo rail unify" - - [tasks.unify-check] - description = "Check for dependency drift (CI)" - run = "cargo rail unify --check" - - [tasks.affected] - description = "List affected crates" - run = "cargo rail affected" - ``` - -### Phase 2: Add cargo-all-features - -1. **Add to mise.toml tools** - ```toml - [tools."cargo:cargo-all-features"] - version = "latest" - binstall = true - ``` - -2. **Configure in eryx crate's Cargo.toml** - ```toml - [package.metadata.cargo-all-features] - # Skip combinations that require runtime to be built - skip_feature_sets = [ - ["native-extensions"], # Requires WASM runtime build - ] - # Always include these in combinations - always_include_features = [] - # Max features to combine (we only have 2, so test all) - max_combination_size = 2 - ``` - -3. **Configure in eryx-runtime crate's Cargo.toml** - ```toml - [package.metadata.cargo-all-features] - # native-extensions requires build artifacts - denylist = ["native-extensions"] - ``` - -4. **Add mise tasks** - ```toml - [tasks.check-all-features] - description = "Check all feature combinations" - run = "cargo all-features check" - - [tasks.test-all-features] - description = "Test all feature combinations" - depends = ["build-eryx-runtime"] - run = "cargo all-features test" - ``` - -### Phase 3: Update CI workflow - -1. Add `cargo rail unify --check` to CI -2. Consider using `cargo rail affected` for PR-based testing -3. Add `cargo all-features check` for feature matrix validation - -## Feature Combinations to Test - -With simplified features (2 features = 4 combinations): - -| embedded | native-extensions | Notes | -|----------|-------------------|-------| -| ❌ | ❌ | Base crate, no extras | -| ✅ | ❌ | Zero-config mode | -| ❌ | ✅ | Native extensions only (requires runtime build) | -| ✅ | ✅ | Full features (requires runtime build) | - -## Expected Benefits - -1. **cargo-rail unify** - - Auto-cleanup of workspace dependencies - - Detection of unused deps/features - - MSRV computation - -2. **cargo-all-features** - - Catch feature interaction bugs - - Ensure all combinations compile - - CI validation of feature matrix - -## Files to Modify - -1. `mise.toml` - Add tools and tasks -2. `crates/eryx/Cargo.toml` - Add cargo-all-features config -3. `crates/eryx-runtime/Cargo.toml` - Add cargo-all-features config -4. `.config/rail.toml` - New file (created by `cargo rail init`) -5. `.gitignore` - May need to ignore rail backup files - -## Verification - -After implementation: -- [x] `cargo rail unify --check` passes -- [x] `cargo check-all-features` passes (base features) -- [x] `mise run check-all-features` works -- [x] CI integration (added check-features, test-base, and examples jobs) \ No newline at end of file diff --git a/mise.toml b/mise.toml index d607de21..a589a5aa 100644 --- a/mise.toml +++ b/mise.toml @@ -9,7 +9,7 @@ version = "0.9.145" version = "1.259.0" [tools."cargo:cargo-rail"] -version = "0.28.1" +version = "0.29.0" [tools."cargo:cargo-all-features"] version = "1.12.0" @@ -85,17 +85,13 @@ description = "Run all CI checks" depends = ["fmt-check", "lint", "test"] [tasks.unify] -description = "Unify workspace dependencies and prune dead features" +description = "Preview workspace dependency unification changes" run = "cargo rail unify" [tasks.unify-check] description = "Check for dependency drift (CI)" run = "cargo rail unify --check" -[tasks.affected] -description = "List affected crates" -run = "cargo rail affected" - [tasks.check-all-features] description = "Check all feature combinations compile" run = "cargo check-all-features"