Use experimental_spec_shaking_v2 for integration tests and improve WASM build failure#1846
Conversation
There was a problem hiding this comment.
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_v2fromsoroban-sdkdefault features and updated test crates to explicitly opt in where needed. - Switched internal gating from
cfg(spec_shaking_v2)tocfg(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-expandedoutputs 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. |
|
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. |
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. |
experimental_spec_shaking_v2 from default feature listexperimental_spec_shaking_v2 for integration tests and improve WASM build failure
What
WASM builds for
experimental_spec_shaking_v2without the expected env variable exit with status code 1 instead of panic with a message thatexperimental_spec_shaking_v2requires using the CLI.Use
experimental_spec_shaking_v2for integration tests.Why
Closes #1845
Known limitations
None