bdk-ffi icon indicating copy to clipboard operation
bdk-ffi copied to clipboard

Importing multiple swift bindings modulemap collision

Open reez opened this issue 1 year ago • 4 comments

Describe the bug
When Importing two swift frameworks generated via FFI there is a Build error.

Showing Recent Issues
duplicate output file '/include/module.modulemap' on task: ProcessXCFramework /DerivedData/Build/Products/Debug-iphonesimulator/libbdkffi.a ios simulator

Showing Recent Issues
Multiple commands produce '/Build/Products/Debug-iphonesimulator/include/module.modulemap'

Showing Recent Issues
Command: ProcessXCFramework /Build/Products/Debug-iphonesimulator/libportal.a ios simulator

Showing Recent Issues
Command: ProcessXCFramework /Build/Products/Debug-iphonesimulator/libbdkffi.a ios simulator

To Reproduce
Import bdk-swift and some other swift bindings generated the same way

Expected behavior

Build environment

  • BDK tag/commit:
  • OS+version:
  • Rust/Cargo version:
  • Rust/Cargo target:

Additional context

reez avatar Nov 04 '24 21:11 reez

Fails using bdk-swift:

Succeeds using bdk-swift:

The other swift bindings I was importing was using uniffi = { version = "0.26.1", optional = true }

reez avatar Nov 04 '24 21:11 reez

The other swift bindings I was importing was using uniffi = { version = "0.26.1", optional = true }

I tested bumping the other swift bindings I was importing from 0.26.1 to 0.28.0, to match bdk-swift beta 2+5, and the results were the same...

Fails using bdk-swift:

Succeeds using bdk-swift:

reez avatar Nov 05 '24 16:11 reez

I believe I have a fix for this by using a unique subdirectory to prevent collisions. Tested.

This will show up if someone builds their xcframework the same way bdk-ffi does (see our build-xcframework.sh), they will get errors similar to what is seen above.

reez avatar May 05 '25 20:05 reez

Closing this because I think this is solved with the referenced https://github.com/bitcoindevkit/rust-cktap/pull/36

But if anyone ever runs into this again (myself included) we can reopen this issue 👍

reez avatar Nov 06 '25 19:11 reez