Skip to content

feat: add sol-shell devShell, drop sol-prelude and rs-prelude#130

Merged
thedavidmeister merged 6 commits into
mainfrom
2026-05-09-sol-shell
May 9, 2026
Merged

feat: add sol-shell devShell, drop sol-prelude and rs-prelude#130
thedavidmeister merged 6 commits into
mainfrom
2026-05-09-sol-shell

Conversation

@thedavidmeister
Copy link
Copy Markdown
Contributor

@thedavidmeister thedavidmeister commented May 9, 2026

Summary

Closes #127, #128.

Adds a slim devShells.sol-shell for Solidity-only consumers, and removes sol-prelude / rs-prelude since both are obsolete after the soldeer migration.

Composition refactor

Shell composition broken into named layers so default and sol-shell share their building blocks:

  • sol-build-inputs: Solidity toolchain (foundry, slither, solc, reuse, git).
  • sol-tasks: the rainix-sol-* task wrappers.
  • rs-tasks: the rainix-rs-* task wrappers.
  • rainix-tasks = sol-tasks ++ rs-tasks — convenience.
  • common-shell-inputs: dev-only tooling (gh, pre-commit + its enabledPackages).

Each shell composes from these:

  • sol-shell = sol-build-inputs ++ sol-tasks ++ common-shell-inputs.
  • default = sol-build-inputs ++ rust-build-inputs ++ node-build-inputs ++ rainix-tasks ++ subgraph-tasks ++ common-shell-inputs ++ [chromium, the-graph, goldsky, sqlite, yq-go, age, default-shell-test].
  • tauri-shell unchanged.

What sol-shell saves

For sol-only consumers (rain.solmem, rain.deploy, rain.datacontract, rain.string, rain.sol.codegen, rain.math.binary, rain.math.saturating, rain.math.fixedpoint), nix develop .#sol-shell skips:

  • chromium and its closure
  • rust toolchain (cargo-release, gmp, openssl, libusb1, pkg-config, wasm-bindgen-cli, gettext, libiconv, cargo-flamegraph)
  • nodejs_22 + jq
  • subgraph tooling (the-graph, goldsky)
  • sqlite, yq-go, age
  • default-shell-test (bats fixture)

sol-prelude / rs-prelude removed

  • sol-prelude body was forge install + forge build. forge install is a no-op for soldeer-managed repos; forge build is redundant since every rainix-sol-* task compiles on demand (forge test auto-compiles, slither drives forge build itself, reuse lint doesn't compile).
  • rs-prelude had no body, kept only for symmetry with sol-prelude. With sol-prelude gone there's nothing to mirror.

Safe across the rain ecosystem because every consumer's flake.lock pins a specific rainix SHA — they continue using the old definitions until they nix flake update.

Test plan

  • nix flake check --no-build — only pre-existing "unknown flake output" warnings, no new errors.
  • Pre-commit hooks: deadnix/nil/nixfmt/statix all pass on the final state.
  • Repo CI on this branch.

Related

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a dedicated Solidity development environment for streamlined development.
  • Refactor

    • Reorganized development shell configurations with centralized shared dependencies.
    • Removed unused prelude packages.
    • Improved macOS PATH handling in development shells.

Review Change Stack

Closes #127, #128.

devShells.sol-shell: slim shell with the Solidity toolchain, the
sol-* tasks, and minimal dev tooling (gh, pre-commit). Lets sol-only
consumers (rain.solmem, rain.deploy, rain.datacontract, rain.string,
rain.sol.codegen, rain.math.binary, rain.math.saturating,
rain.math.fixedpoint) pull a much smaller closure than the default
shell — no chromium, rust toolchain, node, subgraph deps, sqlite, age.
On a cold cache the savings are large; on a warm cache the linkage
work and store footprint still drop substantially.

Refactored shell composition into named layers:
- sol-build-inputs: Solidity toolchain (foundry, slither, solc, reuse, git).
- sol-tasks: the sol-* task wrappers.
- rs-tasks: the rs-* task wrappers.
- rainix-tasks: sol-tasks ++ rs-tasks.
- common-shell-inputs: dev-only tooling (gh, pre-commit, hooks).

Each devShell composes from these — sol-shell is sol-build-inputs +
sol-tasks + common-shell-inputs; default extends with rust + node +
rainix-tasks + subgraph + chromium etc. + common-shell-inputs.

Removed sol-prelude and rs-prelude:
- sol-prelude was forge install + forge build. forge install is a no-op
  for soldeer-managed repos; forge build is redundant because every
  rainix-sol-* task compiles on demand.
- rs-prelude had no body, only kept for symmetry with sol-prelude.

Both removals are safe across the rain ecosystem because every
consumer's flake.lock pins a specific rainix SHA — they continue using
the old definitions until they nix flake update.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this May 9, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Warning

Rate limit exceeded

@thedavidmeister has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 16 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9ee8e080-cb57-491b-9e7c-255f34d88411

📥 Commits

Reviewing files that changed from the base of the PR and between 23225f9 and de41198.

⛔ Files ignored due to path filters (31)
  • audit/2026-03-12-01/pass0/process.md is excluded by !audit/**
  • audit/2026-03-12-01/pass1/Counter.md is excluded by !audit/**
  • audit/2026-03-12-01/pass1/Counter.t.md is excluded by !audit/**
  • audit/2026-03-12-01/pass1/Deploy.md is excluded by !audit/**
  • audit/2026-03-12-01/pass1/flake.md is excluded by !audit/**
  • audit/2026-03-12-01/pass1/main.md is excluded by !audit/**
  • audit/2026-03-12-01/pass1/shellhook.test.md is excluded by !audit/**
  • audit/2026-03-12-01/pass2/Counter.md is excluded by !audit/**
  • audit/2026-03-12-01/pass2/Deploy.md is excluded by !audit/**
  • audit/2026-03-12-01/pass2/flake.md is excluded by !audit/**
  • audit/2026-03-12-01/pass2/main.md is excluded by !audit/**
  • audit/2026-03-12-01/pass3/Counter.md is excluded by !audit/**
  • audit/2026-03-12-01/pass3/Counter.t.md is excluded by !audit/**
  • audit/2026-03-12-01/pass3/Deploy.md is excluded by !audit/**
  • audit/2026-03-12-01/pass3/flake.md is excluded by !audit/**
  • audit/2026-03-12-01/pass3/main.md is excluded by !audit/**
  • audit/2026-03-12-01/pass3/shellhook.test.md is excluded by !audit/**
  • audit/2026-03-12-01/pass4/Counter.md is excluded by !audit/**
  • audit/2026-03-12-01/pass4/Counter.t.md is excluded by !audit/**
  • audit/2026-03-12-01/pass4/Deploy.md is excluded by !audit/**
  • audit/2026-03-12-01/pass4/flake.md is excluded by !audit/**
  • audit/2026-03-12-01/pass4/main.md is excluded by !audit/**
  • audit/2026-03-12-01/pass4/shellhook.test.md is excluded by !audit/**
  • audit/2026-03-12-01/pass5/Counter.md is excluded by !audit/**
  • audit/2026-03-12-01/pass5/Counter.t.md is excluded by !audit/**
  • audit/2026-03-12-01/pass5/Deploy.md is excluded by !audit/**
  • audit/2026-03-12-01/pass5/flake.md is excluded by !audit/**
  • audit/2026-03-12-01/pass5/main.md is excluded by !audit/**
  • audit/2026-03-12-01/pass5/shellhook.test.md is excluded by !audit/**
  • audit/2026-03-12-01/triage.md is excluded by !audit/**
  • test/fixture/soldeer.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • .github/workflows/check-shell.yml
  • .github/workflows/test.yml
  • .gitmodules
  • README.md
  • flake.nix
  • test/bats/devshell/sol-shell/forge.test.bats
  • test/bats/devshell/sol-shell/gh.test.bats
  • test/bats/devshell/sol-shell/reuse.test.bats
  • test/bats/devshell/sol-shell/slim.test.bats
  • test/bats/devshell/sol-shell/slither.test.bats
  • test/bats/devshell/sol-shell/sol-tasks.test.bats
  • test/bats/devshell/sol-shell/solc.test.bats
  • test/bats/task/skip-simulation.test.bats
  • test/fixture/.gitignore
  • test/fixture/REUSE.toml
  • test/fixture/foundry.toml
  • test/fixture/lib/forge-std
  • test/fixture/remappings.txt
  • test/fixture/script/Deploy.sol
  • test/fixture/test/Counter.t.sol
📝 Walkthrough

Walkthrough

This PR refactors the Nix flake to remove the deprecated rainix-sol-prelude and rainix-rs-prelude tasks (post-soldeer migration), reorganizes task definitions into sol-tasks and rs-tasks arrays, introduces centralized common-shell-inputs for shared devshell dependencies, adds a new devShells.sol-shell environment for Solidity-only development, and updates existing shell configurations with cleaner task composition and conditional platform-specific logic.

Changes

Prelude Task Removal and Dev Shell Refactoring

Layer / File(s) Summary
Remove Prelude Tasks
flake.nix
Removed rainix-sol-prelude and rainix-rs-prelude task definitions at lines 229 and 304; subsequent tasks now follow directly without prelude dependencies.
Organize Tasks and Shared Inputs
flake.nix
Introduced sol-tasks and rs-tasks arrays with rainix-tasks = sol-tasks ++ rs-tasks, and added common-shell-inputs to centralize pkgs.pre-commit and pkgs.gh for all dev shells.
Update Exported Packages
flake.nix
Removed rainix-sol-prelude and rainix-rs-prelude from the packages set; retained only remaining Sol/Rust task packages plus tauri-release-env and prettier-bundle.
Add Sol Shell and Update Default/Tauri Shells
flake.nix
Added devShells.sol-shell with Solidity-only inputs and tasks; updated devShells.default to use the new task list organization and common-shell-inputs; wrapped devShells.tauri-shell Darwin PATH workaround in a conditional expression.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Poem

🐰 The prelude scripts have served their time,
Now forge soldeer takes the climb.
With tasks refactored, clean and bright,
Sol-shell emerges, pure delight—
No more Chromium for those who code!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding sol-shell devShell and removing sol-prelude and rs-prelude, which are the primary objectives of this PR.
Linked Issues check ✅ Passed The PR removes rainix-sol-prelude (issue #127 requirement) and rs-prelude from the flake.nix, directly addressing the deprecation goal stated in the linked issues.
Out of Scope Changes check ✅ Passed The PR includes refactoring of shell composition (sol-tasks, rs-tasks, common-shell-inputs) and adding sol-shell, which are supporting changes necessary to remove the prelude scripts and provide a slim Solidity-only environment as described in objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-05-09-sol-shell

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

The flake no longer exports sol-prelude or rs-prelude attributes; the
matrix tasks compile on demand.

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

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@flake.nix`:
- Around line 346-353: The comment claiming common-shell-inputs is "shared
across every devShell" is inconsistent with tauri-shell which manually includes
pkgs.pre-commit and pre-commit.enabledPackages and omits pkgs.gh; either update
tauri-shell to include the shared array or change the comment. Fix option A:
replace the manual inclusion inside tauri-shell with a reference to
common-shell-inputs (so tauri-shell uses common-shell-inputs plus any
tauri-specific inputs) ensuring pkgs.gh is included via common-shell-inputs; Fix
option B: alter the comment above common-shell-inputs to state it is shared only
by sol-shell and default and not by tauri-shell, and keep tauri-shell's explicit
inputs; update references to pre-commit.enabledPackages and pkgs.pre-commit in
tauri-shell accordingly to match the chosen approach.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 145653da-54e4-4584-94ed-f01f22c9e04f

📥 Commits

Reviewing files that changed from the base of the PR and between 8603a22 and 23225f9.

📒 Files selected for processing (1)
  • flake.nix

Comment thread flake.nix Outdated
- forge soldeer init --clean removed test/fixture/lib/forge-std and
  generated dependencies, soldeer.lock, remappings.txt.
- Updated 2 imports (script/Deploy.sol, test/Counter.t.sol) to use the
  versioned forge-std-1.16.1/src/ prefix.
- Dropped 'lib' from libs (now empty after the cleanup).
- Removed empty .gitmodules at the rainix root.
- Added .soldeerignore, remappings.txt, soldeer.lock to fixture's
  REUSE.toml annotations.
- Added 'forge soldeer install' before the build step in
  test/bats/task/skip-simulation.test.bats so the bats setup populates
  dependencies/ before compiling the fixture.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- sol-shell-test mkTask runs 7 bats files under test/bats/devshell/sol-shell/
  (forge, slither, solc, reuse, gh, sol-tasks, plus a slim.test asserting
  chromium/cargo/node/graph/goldsky/age are NOT present). Exposed via
  packages.sol-shell-test rather than added to sol-shell.buildInputs to
  avoid adding bats + the bats fixtures into every consumer's closure.
  CI invokes via "nix develop .#sol-shell --command nix run .#sol-shell-test"
  so the bats inherit sol-shell's PATH.
- README sync: removed sol-prelude / rs-prelude entries (deleted in this
  PR), added sol-shell to the dev shells table, fixed Goldsky CLI version
  drift (8.6.6 -> 13.3.4 to match flake.nix).
- Removed audit/2026-03-12-01/ — all findings closed (FIXED, DISMISSED, or
  made moot by this PR's removal of rs-prelude). New audit pass tracked
  separately.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
thedavidmeister and others added 2 commits May 9, 2026 20:56
…mment

Fixes the rainix sol-test failure that surfaced after #130 migrated
test/fixture to soldeer — the matrix tasks need dependencies/ populated
before forge can resolve forge-std imports.

Also tightens the common-shell-inputs comment per CodeRabbit feedback:
tauri-shell does not consume common-shell-inputs (it omits gh and
inlines pre-commit). Consolidating is out of scope here.

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

The previous slim assertions failed on GitHub Actions runners because
cargo, node, and chromium are pre-installed system-wide at /usr/bin and
/usr/local/bin. Those system installs are irrelevant to the sol-shell
closure; what matters is whether nix is pulling those binaries into the
shell.

Rewrite each assertion to: if the binary resolves at all, it must NOT
resolve to a /nix/store path. A system copy on PATH is fine; a nix copy
means sol-shell's buildInputs grew.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thedavidmeister thedavidmeister merged commit 1599267 into main May 9, 2026
12 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Tip

For best results, initiate chat on the files or code changes.

SIZE=M

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.

Deprecate the sol-prelude script (post-soldeer migration)

1 participant