Track changes to generated code in test vectors#1572
Merged
leighmcculloch merged 30 commits intomainfrom Sep 30, 2025
Merged
Conversation
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 30, 2025
### What Remove the rssdkver (Rust SDK Version) meta entry from the builds of the test wasms in this repository. And build the test wasms once with the minimum supported rust version (msrv) and use that build for test runs. ### Why When building contracts with the soroban-sdk imported, the Rust SDK Version is embedded in a meta entry. For the test wasms in this repository this makes their builds unstable, and inconsistent. Every commit on the repository results in a slightly different build given that the revision is included and is forever changing. This makes it challenging to use the wasms in some places where the hash or the raw bytes get captured, such as test snapshots, and soon expanded generated code (#1572). The simplest way to remove this problem is to remove the meta entry just when building the local test vectors. Each version of rust can also cause differences in the wasm build, so for tests, only testing against the wasms built with the msrv keeps the wasm binaries stable for the longest period of time. This change required some refactoring of the ci process, to separate building and testing. That refactor also moved us away from using a separate set of commands in ci vs locally, now ci just runs make commands. The local Makefile is updated to build the wasms with the msrv as well for convenience.
This reverts commit e234ee1.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a job that expands the generated code of each test wasm for both host testing and wasm compilation, then verifies if the committed files are up-to-date. This allows PRs to show diffs when there are changes to generated code, making the impact of macro changes more visible.
The changes involve:
- Adding numerous expanded test files showing generated code output for both test and wasm32v1-none targets
- These files demonstrate the output from the Soroban SDK's procedural macros for various test contracts
Reviewed Changes
Copilot reviewed 43 out of 50 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests-expanded/test_udt_wasm32v1-none.rs | Generated code for UDT (User Defined Types) test compiled for wasm32v1-none target |
| tests-expanded/test_udt_tests.rs | Generated code for UDT test compiled for host testing with additional test utilities |
| tests-expanded/test_multiimpl_wasm32v1-none.rs | Generated code for multi-implementation test compiled for wasm32v1-none target |
| tests-expanded/test_multiimpl_tests.rs | Generated code for multi-implementation test compiled for host testing |
| tests-expanded/test_modular_wasm32v1-none.rs | Generated code for modular contract test compiled for wasm32v1-none target |
| tests-expanded/test_modular_tests.rs | Generated code for modular contract test compiled for host testing |
| tests-expanded/test_macros_wasm32v1-none.rs | Generated code for macro test compiled for wasm32v1-none target |
| tests-expanded/test_macros_tests.rs | Generated code for macro test compiled for host testing |
| tests-expanded/test_logging_wasm32v1-none.rs | Generated code for logging test compiled for wasm32v1-none target |
| tests-expanded/test_logging_tests.rs | Generated code for logging test compiled for host testing |
| tests-expanded/test_invoke_contract_wasm32v1-none.rs | Generated code for contract invocation test compiled for wasm32v1-none target |
| tests-expanded/test_invoke_contract_tests.rs | Generated code for contract invocation test compiled for host testing |
| tests-expanded/test_import_contract_wasm32v1-none.rs | Generated code for contract import test compiled for wasm32v1-none target |
sisuresh
approved these changes
Sep 30, 2025
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
Add a job that expands the generated code of each test wasm both when built locally for the host with tests, and when built for wasm, and verifies if the committed files are up-to-date.
Why
So that PRs show diffs when there are changes to generated code. To catch unexpected and make hyper-visible the impact of changes to macros.
There's always an argument with this type of files we're committing that it will get too noisy, too cumbersome, and that it won't be the right balance and tradeoff in maintainence cost. This is an experiment to some degree and I think we'll find out during Q4 if it pays off or not and then we can retro, because we have changes planned that'll change the generated code (e.g. #1507 #1535) and we'll see how it goes. We can decide to remove this if the tradeoff doesn't end up being right.
For #1544
Dependent on: