Error without overflow checks#2367
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR converts overflow-checks validation from warnings to errors during stellar contract build, preventing contracts from being built without overflow-checks = true in their Cargo.toml configuration.
Changes:
- Modified
run_checks()andcheck_overflow_checks()functions to return errors instead of emitting warnings - Added new
CargoConfigurationerror variant for Cargo.toml validation failures - Updated all tests to expect errors instead of warnings and verify proper failure/success behavior
- Added
overflow-checks = trueto the root Cargo.toml's release profile - Fixed spelling: "retreiving" → "retrieving"
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cmd/soroban-cli/src/commands/contract/build.rs | Converted overflow-checks validation from warnings to errors; added CargoConfiguration error type; fixed spelling typo |
| cmd/crates/soroban-test/tests/it/build.rs | Updated test names and assertions to expect errors instead of warnings; adjusted fixture paths to copy entire workspace; added new test cases for various overflow-checks scenarios |
| Cargo.toml | Added overflow-checks = true to release profile to ensure the CLI itself is built with overflow checks enabled |
mootz12
commented
Jan 27, 2026
leighmcculloch
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Update checks for Cargo during
stellar contract buildto throw errors instead of warnings.Why
Prevent the CLI from being used to build contracts without
overflow-checks = trueKnown limitations
None