Skip to content

Commit aef20fc

Browse files
Merge branch 'main' into str-to-ident-into-ident
2 parents 6fea4b2 + 7f894f4 commit aef20fc

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.github/workflows/test-with-soroban-examples.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ jobs:
4242
matrix:
4343
working-directory: ${{ fromJSON(needs.collect-examples.outputs.dirs) }}
4444
experimental_spec_shaking_v2: [true, false]
45+
# Exclude examples that depend on crates.io packages that transitively
46+
# depend on soroban-sdk (e.g. soroban-poseidon). Cargo does not provide
47+
# a way to override the version of soroban-sdk required as a transitive
48+
# dependency of another dependency where the version to override is a
49+
# different major version or does not match the semver compatibility
50+
# defined by the importer, causing two copies of soroban-sdk to be
51+
# compiled and duplicate lang item (panic_impl) errors.
52+
# https://github.com/stellar/rs-soroban-sdk/issues/1723
53+
exclude:
54+
- working-directory: privacy-pools
4555
defaults:
4656
run:
4757
working-directory: soroban-examples/${{ matrix.working-directory }}

soroban-sdk/src/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,22 @@ pub use soroban_sdk_macros::contract;
412412
/// Functions that are publicly accessible in the implementation are invocable
413413
/// by other contracts, or directly by transactions, when deployed.
414414
///
415+
/// ### Notes
416+
///
417+
/// Each public function's export name is derived from the function name alone,
418+
/// without any type prefix or namespace. This means:
419+
///
420+
/// - **Function names must be unique across all `#[contractimpl]` blocks in a
421+
/// crate.** If two impl blocks define a function with the same name, their
422+
/// Wasm exports will collide, producing build or linker errors.
423+
///
424+
/// - **Importing a crate that contains `#[contractimpl]` blocks will pull its
425+
/// exported functions into the importing crate's Wasm binary.** This is a
426+
/// limitation of Rust — any `#[export_name = "..."]` function in a dependency
427+
/// is included in the final binary. This can cause unexpected exports or name
428+
/// collisions that are hard to diagnose. For this reason it is usually
429+
/// inadvisable to import dependencies that use `#[contractimpl]`.
430+
///
415431
/// ### Examples
416432
///
417433
/// Define a contract with one function, `hello`, and call it from within a test

0 commit comments

Comments
 (0)