Skip to content

fix: drop gclient from default cargo sails new dev-deps#1335

Merged
vobradovich merged 1 commit into
masterfrom
fix/scaffold-drop-gclient-default
May 4, 2026
Merged

fix: drop gclient from default cargo sails new dev-deps#1335
vobradovich merged 1 commit into
masterfrom
fix/scaffold-drop-gclient-default

Conversation

@ukint-vs
Copy link
Copy Markdown
Member

@ukint-vs ukint-vs commented May 2, 2026

Summary

  • Drop gclient from the default dev-dep feature list in cargo sails new-scaffolded projects (rs/cli/src/program_new.rs).
  • Add an opt-in note in the scaffold README pointing builders at cargo add sails-rs --dev --features gclient for live-node tests.
  • Update rs/cli/README.md to 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.3 have 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.askama only uses GtestEnv and DEFAULT_USER_ALICE from sails_rs::gtest. There is no gclient reference anywhere in the generated project. gclient is 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:

metric before after delta
Cargo.lock packages 818 697 −121
Cargo.lock lines 8928 7405 −1523
cargo tree references to gclient/subxt/gsdk many 0

Test plan

  • cargo build -p sails-cli --release
  • cargo clippy -p sails-cli --all-targets --locked -- -D warnings (clean)
  • cargo sails new <name> and confirm scaffolded [dev-dependencies] sails-rs shows features = ["gtest"] only
  • cargo tree on the scaffolded project shows no gclient / subxt / gsdk
  • Generated README contains the gclient opt-in note
  • CI green

Out of scope

This PR addresses Issue 1 from #1334 only. Issues 2 (ReflectHash boilerplate) and 3 (msg::source import) are tracked separately. There is also an unrelated StateMut/Infallible build failure on master from a version skew between the published sails-rs 1.0.0-beta.4 prelude and the post-#1331 master prelude — not addressed here.

Refs #1334

🤖 Generated with Claude Code

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>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

@vobradovich vobradovich merged commit e335aa7 into master May 4, 2026
4 checks passed
@vobradovich vobradovich deleted the fix/scaffold-drop-gclient-default branch May 4, 2026 09:57
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.

2 participants