fix: drop gclient from default cargo sails new dev-deps#1335
Merged
Conversation
The default scaffold's tests use only `gtest::*`, but the dev-deps also enable the `gclient` feature, dragging the entire substrate / subxt / sp-core / jsonrpsee tree (~120 extra crates) into every fresh project. This is unused by the shipped tests, slows cold builds, and is a frequent source of misdiagnoses for autonomous agents (see issue #1334, Issue 1). Drop `gclient` from the default dev-dep feature list and document the opt-in path (`cargo add sails-rs --dev --features gclient`) in the scaffold README. The kept `gtest` feature provides everything the default `tests/gtest.rs` uses. Refs #1334 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request makes the gclient dependency optional for integration tests by removing it from the default development dependencies in the program generator. It also updates the CLI documentation and the generated project README template with instructions on how to manually enable gclient for live-node testing. I have no feedback to provide as there were no review comments.
7 tasks
vobradovich
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gclientfrom the default dev-dep feature list incargo sails new-scaffolded projects (rs/cli/src/program_new.rs).cargo add sails-rs --dev --features gclientfor live-node tests.rs/cli/README.mdto match.Context
Issue #1334 (Issue 1) reports that fresh-scaffold builds drag in a heavy substrate / subxt / sp-core / jsonrpsee tree via
gclient, which the default tests do not use. The reporter's specific resolution-failure claim (subxt 0.44.0 doesn't exist) was inaccurate —subxt 0.44.0–0.44.3have been published since 2025-08-29 and resolve cleanly today — but the underlying complaint about scaffold weight and surface area for misdiagnosis is legitimate.The default
tests/gtest.askamaonly usesGtestEnvandDEFAULT_USER_ALICEfromsails_rs::gtest. There is nogclientreference anywhere in the generated project.gclientis dead weight unless the builder later writes off-chain RPC tests against a live node.Impact
Measured on a freshly scaffolded
cargo sails new sails-fix-check:cargo treereferences togclient/subxt/gsdkTest plan
cargo build -p sails-cli --releasecargo clippy -p sails-cli --all-targets --locked -- -D warnings(clean)cargo sails new <name>and confirm scaffolded[dev-dependencies] sails-rsshowsfeatures = ["gtest"]onlycargo treeon the scaffolded project shows nogclient/subxt/gsdkgclientopt-in noteOut of scope
This PR addresses Issue 1 from #1334 only. Issues 2 (
ReflectHashboilerplate) and 3 (msg::sourceimport) are tracked separately. There is also an unrelatedStateMut/Infalliblebuild failure on master from a version skew between the publishedsails-rs 1.0.0-beta.4prelude and the post-#1331 master prelude — not addressed here.Refs #1334
🤖 Generated with Claude Code