build(sh): include BuildPointers.sol and forge fmt in build.sh - #220
build(sh): include BuildPointers.sol and forge fmt in build.sh#220thedavidmeister wants to merge 5 commits into
Conversation
Currently build.sh only regenerates the meta CBOR artifact and stops. Regenerating src/generated/ERC4626Words.pointers.sol requires a separate manual step. Add a sol-shell block that runs BuildPointers.sol and forge fmt so a single ./script/build.sh regenerates all committed artifacts (meta/ + pointers + formatting) without extra manual steps. Closes #13 Co-Authored-By: Claude <noreply@anthropic.com>
Walkthrough
ChangesUnified artifact regeneration
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
Rework note (human reject, 2026-07-04): the ask is still valid — #13 remains open and main's build.sh (post-#227) is still meta-only — but this branch predates #227's rewrite, so the first hunk targets a build.sh that no longer exists (hence CONFLICTING), and the new block uses a bare |
Take main's post-#227 build.sh verbatim as the conflict resolution base. Co-Authored-By: Claude <noreply@anthropic.com>
A single ./script/build.sh run now regenerates all committed artifacts: authoring meta CBOR, src/generated pointer constants, and formatting. The pointer + fmt block runs in the repo's own default devshell (which provides forge alongside rain), so no external rainix flake ref is needed. Co-Authored-By: Claude <noreply@anthropic.com>
|
Producer note: reworked on current main per the rework note — merge took main's post-#227 build.sh verbatim, then a single commit appends the BuildPointers.sol + forge fmt block via the repo's OWN flake default devshell (main's flake exposes no sol-shell; the default shell provides forge, so no rainix ref, pinned or bare, was introduced). Verified both build.sh steps run clean with zero regeneration diffs. One stale line in the PR body: the third bullet still says the block 'runs in the sol-shell' — it runs in the default devshell; body edit left to a human since PR-body edits are outside my allowed actions. |
Merging main brought in #258's rename of script/BuildPointers.sol to script/Build.sol. git reported the merge CLEAN because the rename is a path change that never touches build.sh's own hunk, so the appended block was left calling a file that no longer exists. Point the block at ./script/Build.sol, and update the README regeneration section, which still documented the pre-#258 two-step flow that this branch replaces with a single ./script/build.sh. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
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 `@README.md`:
- Around line 100-101: Replace the remote unpinned `nix develop
github:rainlanguage/rainix#sol-shell` commands in the README regeneration
instructions with the documented local devshell workflow, using
`script/build.sh`, command 11 shell wrapping, or equivalent `nix develop -c`
commands for `forge script` and `forge fmt`.
🪄 Autofix
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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b8490646-037e-447d-be58-86b34678b7ea
📒 Files selected for processing (2)
README.mdscript/build.sh
| nix develop github:rainlanguage/rainix#sol-shell -c forge script script/Build.sol | ||
| nix develop github:rainlanguage/rainix#sol-shell -c forge fmt |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | sed -n '1,120p'
echo "== README relevant =="
if [ -f README.md ]; then
nl -ba README.md | sed -n '80,110p'
fi
echo "== script/build.sh outline/content =="
for f in $(git ls-files | grep -E '(^|/)build\.sh$|(^|/)Build\.sol$'); do
echo "--- $f"
wc -l "$f"
sed -n '1,180p' "$f"
done
echo "== remote flake references =="
rg -n "github:rainlanguage/rainix|rainlanguage/rainix|sol-shell|nix develop|forge script|forge fmt|default-devshell|default devshell" README.md script nix .github 2>/dev/null || true
echo "== git status/diff stat =="
git status --short
git diff --stat HEAD~1..HEAD 2>/dev/null | sed -n '1,80p' || trueRepository: rainlanguage/rain.erc4626.words
Length of output: 2484
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== README relevant =="
awk 'NR>=80 && NR<=110 { printf "%d:%s\n", NR, $0 }' README.md || sed -n '80,110p' README.md
echo "== script/build.sh =="
awk 'NR>=1 && NR<=220 { printf "%d:%s\n", NR, $0 }' script/build.sh
echo "== REMOTE FLAKE REFERENCES =="
rg -n "github:rainlanguage/rainix|rainlanguage/rainix|sol-shell|nix develop|forge script|forge fmt|default-devshell|default devshell" README.md script nix .github 2>/dev/null || true
echo "== flake nix files =="
awk 'NR>=1 && NR<=260 { printf "%d:%s\n", NR, $0 }' flake.nix
echo "--- flake.lock top ---"
python3 - <<'PY'
import json
from pathlib import Path
p=Path('flake.lock')
if p.exists():
data=json.loads(p.read_text())
for k,v in data.get('nodes',{}).items():
print(k, v.get('type'), v.get('original','{}').get('ref') if isinstance(v.get('original'), dict) else v.get('original'))
PY
echo "== local devshell script commands extraction =="
python3 - <<'PY'
from pathlib import Path
for p in [Path('script/build.sh'), Path('README.md')]:
lines=p.read_text().splitlines()
print(f'-- {p} --')
for i,l in enumerate(lines,1):
if any(s in l for s in ['nix develop', 'forge script', 'forge fmt', 'github:rainlanguage/rainix', 'sol-shell']):
print(f'{i}: {l}')
PYRepository: rainlanguage/rain.erc4626.words
Length of output: 6743
🌐 Web query:
nix flake github URL revision nix develop github owner repo latest
💡 Result:
To specify a GitHub repository in a Nix flake URL, use the following syntax [1][2]: github:/(/)?(?)? In this syntax, can be a branch name, a tag, or a commit hash [1][2]. Nix treats these as interchangeable in this position for GitHub repositories [1][2]. For example: - To use a specific branch or tag: github:NixOS/nixpkgs/nixos-unstable [2] - To use a specific commit hash: github:NixOS/nixpkgs/a3a3dda3bacf61e8a39258a0ed9c924eeca8e293 [3] If you do not specify a revision or branch, Nix defaults to the repository's default branch (typically master or main) [1][3]. Recent updates to Nix have added support for specifying both a branch/tag (ref) and a commit hash (rev) simultaneously in the URL to provide both human-readable context and exact reproducibility [4]. This is formatted as: github:owner/repo/ref?rev=commit-hash [4] When working with commands like nix develop, you can override or specify these versions on the command line using --override-input [5]. For example: nix develop --override-input nixpkgs github:NixOS/nixpkgs/a3a3dda3bacf61e8a39258a0ed9c924eeca8e293 Note that while URLs in flake.nix inputs can specify these details, reproducibility is primarily handled by the flake.lock file, which locks input specifications to exact revisions [6].
Citations:
- 1: https://github.com/NixOS/nix/blob/master/src/nix/flake.md
- 2: https://nix.dev/manual/nix/2.34/command-ref/new-cli/nix3-flake.html
- 3: https://releases.nixos.org/nix/nix-2.33.3/manual/command-ref/new-cli/nix3-flake.html
- 4: feat: support both ref and rev in git archive inputs (github/gitlab/sourcehut) NixOS/nix#15898
- 5: https://discourse.nixos.org/t/update-flake-input-to-specific-revision/8952
- 6: https://releases.nixos.org/nix/nix-2.34.8/manual/command-ref/new-cli/nix3-flake.html
Replace the remote unpinned commands with the local devshell workflow.
README.md says regeneration runs in the repository default devshell, but lines 100-101 call github:rainlanguage/rainix#sol-shell without a revision. These commands resolve that flake URL at runtime and create a flake output that the local flake.nix does not provide. Use script/build.sh, command 11 shell wrapping, or the documented local commands (nix develop -c erc4626-words-prelude, nix develop -c bash ... -c 'forge script --silent ./script/Build.sol; forge fmt').
🤖 Prompt for 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.
In `@README.md` around lines 100 - 101, Replace the remote unpinned `nix develop
github:rainlanguage/rainix#sol-shell` commands in the README regeneration
instructions with the documented local devshell workflow, using
`script/build.sh`, command 11 shell wrapping, or equivalent `nix develop -c`
commands for `forge script` and `forge fmt`.
Summary
build.shonly regenerated the meta CBOR artifact;src/generated/ERC4626Words.pointers.solrequired a separate manual invocation offorge script script/BuildPointers.sol+forge fmt.build.shso a single./script/build.shregenerates all committed artifacts (meta CBOR + pointer constants + formatting) without extra manual steps.rain); the new pointer + fmt block runs in the sol-shell (needsforge).Closes #13
Co-Authored-By: Claude noreply@anthropic.com
Summary by CodeRabbit
Chores
Documentation