Uh oh!
There was an error while loading. Please reload this page.
Move soldeer release metadata under foundry's [external] section - #36
Conversation
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review. WalkthroughThe Foundry configuration moves release metadata from ChangesConfiguration update
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk:⚪ Minimal · up to This localized metadata change removes the obsolete Foundry warning while preserving release-version handling and build behavior; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
Uh oh!
There was an error while loading. Please reload this page.
Closes#35
Same change as the worked precedents,
rainlanguage/rain.sol.codegen#143 and
rainlanguage/rain.solmem#144.
Verified against main first
Re-measured on
e39f90b(main at branch point):foundry.tomlstill opens with a bare[package], andnix develop -c forge configstill prints, on every invocation:The repo does call rainix's autopublish:
.github/workflows/package-release.yamlis
rainix-autopublish.yaml@mainwithsoldeer-package: rain-math-binary, soversionis the next, unpublished slot (0.1.5, published latest0.1.4) andis rewritten by the release.
The issue also says to fix prose naming
[package].version. Nothing in thisrepo names it —
grep -rn '\[package\]\|package\.version'over*.md/*.toml/*.yaml/*.yml/*.nix/*.txthitsfoundry.toml:1andnothing else. So this PR is one file.
Changed
[package]→[external.package], with a comment saying what the section is.[external.*]is the section foundry reserves for another tool's config andignores (foundry-rs/foundry#5866), and it is excluded from
forge config --fix(#12723).
forge config --fixwas NOT run — mutant 2 below reproduces in thisrepo the measurement the issue gives for why its suggestion is worse.
Publishing is provably untouched
rainix-static soldeer-gateat the SHArainix-autopublish.yamlpins(
53e96a7d), run with onlyfoundry.tomldiffering:Byte-identical content hash, same
version/next, samechanged=false, bothexit 0. The reader is
read_local_versioninrainix-static/src/soldeer_gate.rs— a line scan for the first line matchingis_version_line(version, optional spaces/tabs,=), with no sectionawareness anywhere; the file at the pinned
53e96a7dis byte-identical torainix
main, and every occurrence of the stringpackagein it is a comment,an error message or a test fixture, never a parse target. The gate runs
forge soldeer push --dry-runinternally, so the dry-run also succeeds on thenew section. Autopublish's bump step
(
sed -i -E "0,/^version[[:space:]]*=.*/s//version = \"$NEXT\"/" foundry.toml)applied to the new file rewrites line 7 to
0.1.6and touches nothing else —the four added comment lines contain the word
versionbut are#-prefixed,so they do not match the
^versionanchor.foundry.tomlis also in.soldeerignorehere, so it is not even in the pushed zip.Mutation table
There is no executable line in the diff, so the mutants are of the changed TOML
region and the oracles are the tools that read it:
forge config,rainix-static soldeer-gate(what autopublish reads), and the bumpsed.Baseline first, so a "killed" is not a tool that errors on everything.
[external.package])forge configsoldeer-gateversion=0.1.5 next=0.1.6 NEW=f7307e5f…[external.package]→[package](revert)forge configFound unknown config section in foundry.toml: [package][external.package]→[profile.package](forge config --fix's suggestion)forge configFound unknown `name` config for profile `package`, same forversionversionline by two spacessoldeer-gate::error::foundry.toml has no [package].versionversion = "0.1.5"→"0.1.3"soldeer-gate::error::foundry.toml [package].version (0.1.3) is not ahead of the published revision (0.1.4)Mutants 3 and 4 are the ones that prove the rename did not detach the reader
from the value: the gate still finds that exact line under the new section
header, reports its value, and fails loudly on it. Mutants 3 and 4 both pass
forge configwith 0 warnings, and mutants 1 and 2 both pass the gate — neitheroracle alone kills all four, so neither is a rubber stamp.
Checks
Repo toolchain,
nix develop(the flake'ssol-shell):forge config: warning before, silent after; the 216-line config body isotherwise byte-identical (
diffclean).forge soldeer install+forge build: exit 0.forge test: 8 passed / 0 failed / 1 suite.forge fmt --check: exit 0.taplo fmt --check foundry.toml(the pre-commithook): exit 0.
Not done here
[package].version— thesoldeer-packageinputdescription in
rainix-autopublish.yamlandsoldeer-gate's failure messages(visible in mutants 3 and 4 above). Behaviourally correct, since the reader is
a line scan with no section awareness; it is a rainix change, not this repo's.
solc,optimizer,optimizer_runs,bytecode_hash,cbor_metadataandevm_versionsit afterthe
[soldeer]header infoundry.toml, so TOML puts them in[soldeer], not[profile.default], and forge silently ignores them.forge configonmainreports
evm_version = "osaka",optimizer = false,optimizer_runs = 200,bytecode_hash = "ipfs",cbor_metadata = true— foundry defaults, not thefile's values. Confirmed by moving
solc/evm_versionunder[profile.default]on a scratch copy, after whichforge configreportssolc = "0.8.25"/evm_version = "cancun". Identical before and after thisdiff (the config body diff is clean), so it is out of scope here and wants its
own issue.
QA
test/src/**mirror position this belongs in (the tree mirrorssrc/**bysubject and release metadata has no
src/counterpart), and a test asserting aconfig file's prose is the kind of doc-binding test that is not written here.
The discriminating check is a command, run both ways:
nix develop -c forge configprintsWarning: Found unknown config section in foundry.toml: [package]onorigin/main(e39f90b) and prints no warning on this branch.[package]and →
[profile.package], both killed byforge config;versionlineindented and
versionvalue lowered below the published revision, both killedby
rainix-static soldeer-gateat the pinned rainix SHA53e96a7d. Everymutant was run against a recorded unmutated baseline (0 warnings, gate exit 0),
and each oracle passes two of the four mutants, so neither is vacuously green.
foundry's treatment of
[external.*](feat: support external sections infoundry.tomlfoundry-rs/foundry#5866, #12723) ismeasured through
forge configat the nix-pinned toolchain;rainix-static/src/soldeer_gate.rs(read_local_version/is_version_line)and
rainix-autopublish.yaml's bumpsedat the SHA that workflow pins arewhat autopublish reads and writes, exercised directly rather than reasoned
about.
[package]to[external.package], keep theversionline unindented and first, add acomment naming the section as another tool's metadata, and fix any prose that
names
[package].version. All four covered; the prose clause is vacuous herebecause no file in the repo names it (grep evidence above). The issue's
explicit non-goals — running
forge config --fix, raising anything upstream —are not done.
Summary by CodeRabbit