Skip to content

Make test wasms build more consistently#1576

Merged
leighmcculloch merged 42 commits intomainfrom
i1465-stable-test-vectors
Sep 30, 2025
Merged

Make test wasms build more consistently#1576
leighmcculloch merged 42 commits intomainfrom
i1465-stable-test-vectors

Conversation

@leighmcculloch
Copy link
Copy Markdown
Member

@leighmcculloch leighmcculloch commented Sep 29, 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.

@leighmcculloch leighmcculloch requested a review from a team September 29, 2025 22:43
@leighmcculloch leighmcculloch marked this pull request as ready for review September 29, 2025 22:43
@leighmcculloch leighmcculloch added this pull request to the merge queue Sep 29, 2025
Merged via the queue into main with commit 194b0c5 Sep 30, 2025
34 checks passed
@leighmcculloch leighmcculloch deleted the i1465-stable-test-vectors branch September 30, 2025 00:04
github-merge-queue bot pushed a commit that referenced this pull request Sep 30, 2025
### What
Install the msrv ahead of using it as an override. Remove making
warnings declined in the Makefile. Do not rebuild test wasms when
running tests. Change the default target to just run tests.

  ### Why
  Few things I wish I had done slightly differently in #1576.

Warnings are enabled in the makefile, but that needs to be set only in
CI, and only on the msrv now that the CI uses the makefile. Right now
warnings are enabled for both msrv and latest, when they shouldn't be.
Having warnings as errors off on local is good.

The tests run by the makefile always build the test wasms, but in CI
that doesn't need to happen as the test wasms are injected as an
artifact.

The default target currently calls the check target, which no longer
exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make test wasms build more consistently so they can be used in test snapshot tests

2 participants