Vendor test_fixtures ABIs so the crate publishes standalone#533
Conversation
`rainlang_test_fixtures` read its 6 alloy `sol!` ABI JSONs from the sibling `bindings` crate via `../bindings/abi/<Name>.json`. `cargo publish` packages only the crate's own directory, so those JSONs were absent from the tarball and the generated types failed to build, breaking `cargo publish` (and the autopublish that runs cargo before soldeer). The crate has external downstream consumers on crates.io, so it must stay published; `publish = false` is not an option. Vendor the ABIs the crate reads into `crates/test_fixtures/abi/` and repoint the `sol!` paths to `abi/<Name>.json`: - Move the 5 ABIs read only by `test_fixtures` out of `bindings`: TestERC20, RainlangInterpreter, RainlangStore, RainlangParser, RainlangExpressionDeployer. - Copy `Rainlang.json` (read by both crates) so each carries its own packaged copy; `bindings` keeps its copy unchanged. Update the artifact generator so regeneration writes every committed copy: `LibCopyArtifacts.committedPath` becomes `committedPaths` returning all destinations for a contract (interfaces -> bindings, Rainlang -> both, the concrete contracts + TestERC20 -> test_fixtures), and `CopyArtifacts.sol` loops over them. Grant foundry fs read-write on the new `crates/test_fixtures/abi` dir so the writer can manage it. Regenerating via `forge script CopyArtifacts.sol --ffi` produces the committed files with zero drift. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 8 minutes and 22 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ 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 |
|
Reviewed 274bce7: Makes rainlang_test_fixtures build standalone in its published tarball — vendors the 6 ABIs it reads into crates/test_fixtures/abi/, repoints the sol! paths, and routes the CopyArtifacts generator (committedPaths multi-dest) so regeneration has zero drift. cargo publish --dry-run -p rainlang_test_fixtures now passes (the exact step that was aborting the autopublish before soldeer); eval/cli still compile; copy-artifacts + rs-test green. Keeps the crate published for its downstream consumers (no publish=false). Unblocks the rainlang autopublish. |
|
Reviewed 274bce7: Approved by repo owner. Vendors test_fixtures' 6 ABIs into crates/test_fixtures/abi/ + repoints sol! paths + routes the CopyArtifacts generator (committedPaths multi-dest) — copy-artifacts regenerates them at the new path and the whole-tree git diff guards drift. cargo publish --dry-run -p rainlang_test_fixtures passes (the step that was aborting the autopublish); eval/cli compile; CI green. Keeps the crate published for downstream consumers. |
|
@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:
Review Effort: Would have taken 5-10 minutes Examples:
Medium (M)Characteristics:
Review Effort: Would have taken 15-30 minutes Examples:
Large (L)Characteristics:
Review Effort: Would have taken 45+ minutes Examples:
Additional Factors to ConsiderWhen deciding between sizes, also consider:
Notes:
|
Problem
rainlang_test_fixturescould not be published standalone. Itscrates/test_fixtures/src/lib.rshas 6alloy::sol!(...)blocks that read ABI JSON via"../bindings/abi/<Name>.json"— paths outside the crate's own directory, in the siblingbindingscrate.cargo publishpackages only the crate's own directory, so those JSON files are absent from the tarball. The generated types (ERC20,Interpreter,Store,Parser,Deployer,RainlangContract) then fail to generate, producing ~28 compile errors andfailed to verify package tarball. This silently failed thePackage Releaseautopublish: the cargo step aborts before soldeer publishes.rainlang_test_fixtureshas external downstream consumers on crates.io, so it must stay published. This PR replaces the closed #532, which wrongly usedpublish = false(that would break those consumers).Fix: vendor the ABIs into the crate
test_fixturesout ofbindingsintocrates/test_fixtures/abi/:TestERC20,RainlangInterpreter,RainlangStore,RainlangParser,RainlangExpressionDeployer.Rainlang.json(read by both crates) intocrates/test_fixtures/abi/so the crate carries its own packaged copy;bindingskeeps its copy unchanged.sol!paths inlib.rsfrom"../bindings/abi/<Name>.json"to"abi/<Name>.json".LibCopyArtifacts.committedPathbecomescommittedPaths(name) -> string[]returning all destinations for a contract (interfaces →bindings,Rainlang→ both, the concrete contracts +TestERC20→test_fixtures);CopyArtifacts.solloops over them.crates/test_fixtures/abidirectory so the writer script can manage it.No
publish = false.package-release.yamlis untouched.Verification
forge script script/CopyArtifacts.sol --ffiwrites the ABIs to the new locations with zero git drift (the moves are recorded as 100% renames; the generator and committed files agree). This is the freshness gate thecopy-artifactsCI job enforces viagit diff --exit-code.cargo publish --dry-run -p rainlang_test_fixturessucceeds.cargo test -p rainlang-eval --no-runandcargo test -p rainlang_cli --no-runcompile clean (both dev-deptest_fixtures).forge buildproduces no errors.This unblocks the rainlang autopublish (cargo → soldeer).
🤖 Generated with Claude Code