Skip to content

Use experimental_spec_shaking_v2 for integration tests and improve WASM build failure#1846

Merged
leighmcculloch merged 7 commits into
mainfrom
spec-shaking-v2-opt-in
Apr 28, 2026
Merged

Use experimental_spec_shaking_v2 for integration tests and improve WASM build failure#1846
leighmcculloch merged 7 commits into
mainfrom
spec-shaking-v2-opt-in

Conversation

@mootz12
Copy link
Copy Markdown
Contributor

@mootz12 mootz12 commented Apr 24, 2026

What

WASM builds for experimental_spec_shaking_v2 without the expected env variable exit with status code 1 instead of panic with a message that experimental_spec_shaking_v2 requires using the CLI.

Use experimental_spec_shaking_v2 for integration tests.

Why

Closes #1845

Known limitations

None

Copilot AI review requested due to automatic review settings April 24, 2026 17:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Makes experimental_spec_shaking_v2 opt-in (no longer enabled by default) and tightens build-time enforcement so wasm builds using the feature require a supported build tool (stellar-cli / stellar contract build).

Changes:

  • Removed experimental_spec_shaking_v2 from soroban-sdk default features and updated test crates to explicitly opt in where needed.
  • Switched internal gating from cfg(spec_shaking_v2) to cfg(feature = "experimental_spec_shaking_v2"), and added a wasm-target build-time failure when the required env var isn’t present.
  • Updated spec-shaking-v2 tests/Makefile flow and regenerated tests-expanded outputs accordingly.

Reviewed changes

Copilot reviewed 72 out of 73 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/zero/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/workspace_lib/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/workspace_contract/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/udt/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/tuples/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/spec_shaking_v2/src/test.rs Removes “no env fallback to v1” test path.
tests/spec_shaking_v2/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/spec_shaking_v1/Cargo.toml Removes now-unnecessary default-features = false usage.
tests/spec_lib/Cargo.toml Removes now-unnecessary default-features = false usage.
tests/spec_import/Cargo.toml Removes now-unnecessary default-features = false usage.
tests/mutability/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/multiimpl/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/modular/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/macros/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/logging/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/invoke_contract/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/import_contract/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/generics/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/fuzz/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/events_ref/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/events/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/errors/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/empty2/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/empty/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/contracttrait_trait/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/contracttrait_path_super/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/contracttrait_path_self/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/contracttrait_path_relative/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/contracttrait_path_global/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/contracttrait_path_crate/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/contracttrait_impl_partial/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/contracttrait_impl_full/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/contract_data/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/constructor/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/bn254/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/bls/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/auth/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/associated_type_contracttrait/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/associated_type_chained/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/associated_type/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/alloc/Cargo.toml Keeps alloc and explicitly opts into experimental_spec_shaking_v2.
tests/add_u64/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/add_u128/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/add_i128/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests/account/Cargo.toml Explicitly opts test crate into experimental_spec_shaking_v2.
tests-expanded/test_workspace_lib_tests.rs Regenerated expanded output including marker trait impls.
tests-expanded/test_udt_tests.rs Regenerated expanded output including marker trait impls.
tests-expanded/test_spec_shaking_v2_tests.rs Regenerated expanded output reflecting new spec-shaking behavior/tests.
tests-expanded/test_events_tests.rs Regenerated expanded output including marker calls for events.
tests-expanded/test_events_ref_tests.rs Regenerated expanded output including marker calls for ref events.
tests-expanded/test_errors_tests.rs Regenerated expanded output including marker trait impls.
tests-expanded/test_contracttrait_trait_tests.rs Regenerated expanded output including marker trait impls.
tests-expanded/test_constructor_tests.rs Regenerated expanded output including marker trait impls.
tests-expanded/test_bn254_tests.rs Regenerated expanded output including marker trait impls.
tests-expanded/test_bls_tests.rs Regenerated expanded output including marker trait impls.
tests-expanded/test_auth_tests.rs Regenerated expanded output including marker trait impls.
tests-expanded/test_account_tests.rs Regenerated expanded output including marker trait impls.
soroban-sdk/src/try_from_val_for_contract_fn.rs Gates marker behavior on the cargo feature instead of a custom cfg.
soroban-sdk/src/lib.rs Gates spec-shaking metadata/module exports on the cargo feature.
soroban-sdk/src/into_val_for_contract_fn.rs Gates marker behavior on the cargo feature instead of a custom cfg.
soroban-sdk/src/_features.rs Updates feature docs to reflect opt-in and new build requirements.
soroban-sdk/build.rs Enforces wasm build-time requirement for CLI support when feature is enabled.
soroban-sdk/Cargo.toml Removes experimental_spec_shaking_v2 from default features.
soroban-sdk-macros/src/lib.rs Makes macro behavior depend on the cargo feature (drops env-var-at-expansion gating).
soroban-sdk-macros/src/derive_struct_tuple.rs Generates marker impls when the cargo feature is enabled.
soroban-sdk-macros/src/derive_struct.rs Generates marker impls when the cargo feature is enabled.
soroban-sdk-macros/src/derive_event.rs Generates marker impls/calls when the cargo feature is enabled.
soroban-sdk-macros/src/derive_error_enum_int.rs Generates marker impls when the cargo feature is enabled.
soroban-sdk-macros/src/derive_enum_int.rs Generates marker impls when the cargo feature is enabled.
soroban-sdk-macros/src/derive_enum.rs Generates marker impls when the cargo feature is enabled.
Makefile Simplifies wasm build flow; removes “no-env fallback” build/test step.
.github/workflows/test-with-soroban-examples.yml Adds matrix to test with and without the feature enabled; adjusts artifact naming.
.github/workflows/test-with-openzeppelin-stellar-contracts.yml Adds matrix to test with and without the feature enabled; adjusts artifact naming.

Comment thread soroban-sdk/build.rs Outdated
Comment thread soroban-sdk/src/_features.rs Outdated
Comment thread tests/udt/Cargo.toml Outdated
@mootz12 mootz12 requested a review from leighmcculloch April 24, 2026 18:53
@leighmcculloch
Copy link
Copy Markdown
Member

Is this an exact revert of the PRs we need to unwind? Because of the complexity, it'd be helpful if we could do the exact reverts, then any other changes separated. I couldn't tell from the commit names.

@leighmcculloch
Copy link
Copy Markdown
Member

leighmcculloch commented Apr 27, 2026

Is this an exact revert of the PRs we need to unwind?

I did a plain revert of #1831 and #1812 and that resulted in the following change, which seems smaller than this PR:

Can we merge #1850, and then rebase this PR, and the additional changes needed in this PR we can add and it'll be clearer what they are.

@mootz12 mootz12 changed the title Remove experimental_spec_shaking_v2 from default feature list Use experimental_spec_shaking_v2 for integration tests and improve WASM build failure Apr 27, 2026
@leighmcculloch leighmcculloch added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit 4c4831e Apr 28, 2026
198 checks passed
@leighmcculloch leighmcculloch deleted the spec-shaking-v2-opt-in branch April 28, 2026 02:03
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.

spec shaking v2: Revert to feature flag for protocol 26

3 participants