lightningdevkit / ldk-swift

48 stars 12 forks source link

released xcframeworks doesn't contain macOS version #24

Closed cuhte3 closed 2 years ago

cuhte3 commented 2 years ago

First of all thanks for the awesome library!

I've added universal xcframework from release page into my iOS/MacOS app but Xcode fails to build macOS target with the message:

While building for macOS, no library for this platform was found in '/User/lightningDevKit/LDK-Universal-Test/Frameworks/LDKFramework.xcframework'

If you inspect LDKFramework.xcframework there are only iOS versions

Missed versions are (?)

LDKFramework-only-macOS.xcframework has only iOS version as well

It seems like static lib wasn't build for x86_64-apple-darwin and arm-apple-darwin targets

arik-so commented 2 years ago

I'm happy to take input and suggestions regarding how to modify compile_dependency_binaries.sh to add support for default non-Catalyst Mac targets :)

cuhte3 commented 2 years ago

@arik-so I'd added additional directory for catalyst

FRAMEWORK_PROJECT_DIRECTORY_CATALYST="`pwd`/LDKFramework_Catalyst"

and build four targets for macOS

Catalyst arm64

cargo build -Z build-std=panic_abort,std --features "std" --target aarch64-apple-ios-macabi --release
cp "${C_BINDINGS_SOURCE_DIRECTORY}/target/aarch64-apple-ios-macabi/release/libldk.a" $FRAMEWORK_PROJECT_DIRECTORY_CATALYST

Catalyst x86_64

cargo build -Z build-std=panic_abort,std --features "std" --target x86_64-apple-ios-macabi --release
cp "${C_BINDINGS_SOURCE_DIRECTORY}/target/x86_64-apple-ios-macabi/release/libldk.a" $FRAMEWORK_PROJECT_DIRECTORY_CATALYST

MacOS arm64

cargo build -Z build-std=panic_abort,std --features "std" --target aarch64-apple-darwin --release
cp "${C_BINDINGS_SOURCE_DIRECTORY}/target/aarch64-apple-darwin/release/libldk.a" $FRAMEWORK_PROJECT_DIRECTORY_MAC

MacOS x86_64

cargo build -Z build-std=panic_abort,std --features "std" --target x86_64-apple-darwin --release
cp "${C_BINDINGS_SOURCE_DIRECTORY}/target/x86_64-apple-darwin/release/libldk.a" $FRAMEWORK_PROJECT_DIRECTORY_MAC

Additionally resulting libs could be merged into arm64 + x86_64 binaries

Catalyst

lipo "${C_BINDINGS_SOURCE_DIRECTORY}/target/aarch64-apple-ios-macabi/release/libldk.a" "${C_BINDINGS_SOURCE_DIRECTORY}/target/x86_64-apple-ios-macabi/release/libldk.a" -create -output libldk.a

macOS

lipo "${C_BINDINGS_SOURCE_DIRECTORY}/target/aarch64-apple-darwin/release/libldk.a" "${C_BINDINGS_SOURCE_DIRECTORY}/target/x86_64-apple-darwin/release/libldk.a" -create -output libldk.a

The macOS + iOS/iOS simulator binaries will cover most of apple platforms (unless we don't need ldk for Apple TV and Apple Watch)

arik-so commented 2 years ago

Thank you so much! I think admittedly the idea of running Lightning from an Apple TV is perhaps a bit ambitious, but who am I to say no. I'll try running your build script modifications on my machine later today.

cuhte3 commented 2 years ago

I was able to build static libs for all those architectures a while ago. Final step is to build the universal xcframeworks. The Xcode projects in the repo (LDKFramework/LDKFramework_Mac) are missing module map and plist files and doesn't build in Xcode :/ When I run build_framework.sh script I've got the error:

While archiving I've got the error:

** ARCHIVE FAILED **

The following build commands failed:
    Ld /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/InstallationBuildProductsLocation/Library/Frameworks/LDKFramework.framework/Versions/A/LDKFramework normal (in target 'LDKFramework' from project 'LDKFramework')
(1 failure)

Am using M1 mac

Any suggestions @arik-so

jurvis commented 2 years ago

@cuhte3 can you post a full gist of the build error?

also if you could post an output of nm /path/to/LDKFramework.xframework/LDKFramework and lipo -info /path/to/LDKFramework.xframework/LDKFramework that will be useful 😄

cuhte3 commented 2 years ago

So here is more info of the build error @jurvis:

CompileC /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/Objects-normal/x86_64/LDKFramework_vers.o /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/DerivedSources/LDKFramework_vers.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler (in target 'LDKFramework' from project 'LDKFramework')
    cd /Users/cuhte3/Dev/lightningDevKit/ldk-swift/xcode/LDKFramework_Mac
    export LANG\=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -target x86_64-apple-ios13.1-macabi -fmessage-length\=110 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -std\=gnu11 -fmodules -gmodules -fmodules-cache-path\=/Users/cuhte3/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/cuhte3/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -fmodule-name\=LDKFramework -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wquoted-include-in-framework-header -Werror\=deprecated-objc-isa-usage -Werror\=objc-root-class -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -iquote /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/LDKFramework-generated-files.hmap -I/Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/LDKFramework-own-target-headers.hmap -I/Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/LDKFramework-all-non-framework-target-headers.hmap -ivfsoverlay /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/all-product-headers.yaml -iquote /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/LDKFramework-project-headers.hmap -I/Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/BuildProductsPath/Release-maccatalyst/include -I/Users/cuhte3/Dev/lightningDevKit/ldk-swift/xcode/LDKFramework_Mac -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/iOSSupport/usr/include -I/Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/DerivedSources-normal/x86_64 -I/Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/DerivedSources/x86_64 -I/Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/DerivedSources -F/Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/BuildProductsPath/Release-maccatalyst -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/iOSSupport/System/Library/Frameworks -MMD -MT dependencies -MF /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/Objects-normal/x86_64/LDKFramework_vers.d --serialize-diagnostics /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/Objects-normal/x86_64/LDKFramework_vers.dia -c /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/DerivedSources/LDKFramework_vers.c -o /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/Objects-normal/x86_64/LDKFramework_vers.o

Ld /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/InstallationBuildProductsLocation/Library/Frameworks/LDKFramework.framework/Versions/A/LDKFramework normal (in target 'LDKFramework' from project 'LDKFramework')
    cd /Users/cuhte3/Dev/lightningDevKit/ldk-swift/xcode/LDKFramework_Mac
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios13.1-macabi -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -L/Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/BuildProductsPath/Release-maccatalyst -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/iOSSupport/usr/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/maccatalyst -L/Users/cuhte3/Dev/lightningDevKit/ldk-swift/xcode/LDKFramework_Mac -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/iOSSupport/usr/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/maccatalyst -F/Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/BuildProductsPath/Release-maccatalyst -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/iOSSupport/System/Library/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/iOSSupport/System/Library/Frameworks -filelist /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/Objects-normal/x86_64/LDKFramework.LinkFileList -install_name @rpath/LDKFramework.framework/Versions/A/LDKFramework -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -object_path_lto -Xlinker /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/Objects-normal/x86_64/LDKFramework_lto.o -Xlinker -final_output -Xlinker /Library/Frameworks/LDKFramework.framework/Versions/A/LDKFramework -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L/System/iOSSupport/usr/lib/swift -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/Objects-normal/x86_64/LDKFramework.swiftmodule -lldk -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/IntermediateBuildFilesPath/LDKFramework.build/Release-maccatalyst/LDKFramework.build/Objects-normal/x86_64/LDKFramework_dependency_info.dat -o /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/InstallationBuildProductsLocation/Library/Frameworks/LDKFramework.framework/Versions/A/LDKFramework
ld: warning: Could not find or use auto-linked library 'libldk.a'
Undefined symbols for architecture x86_64:
  "_CResult_InvoiceNoneZ_clone", referenced from:
      LDKFramework.Result_InvoiceNoneZ.clone() -> LDKFramework.Result_InvoiceNoneZ in Result_InvoiceNoneZ.o
  "_CResult_InvoiceNoneZ_err", referenced from:
      static LDKFramework.Result_InvoiceNoneZ.err() -> LDKFramework.Result_InvoiceNoneZ in Result_InvoiceNoneZ.o
  "_CResult_InvoiceNoneZ_free", referenced from:
      LDKFramework.Result_InvoiceNoneZ.deinit in Result_InvoiceNoneZ.o
  "_CResult_InvoiceNoneZ_is_ok", referenced from:
      static LDKFramework.Bindings.swift_CResult_InvoiceNoneZ_is_ok(o: LDKFramework.Result_InvoiceNoneZ) -> Swift.Bool in Bindings.o
     (maybe you meant: dispatch thunk of static LDKFramework.Bindings.swift_CResult_InvoiceNoneZ_is_ok(o: LDKFramework.Result_InvoiceNoneZ) -> Swift.Bool, static LDKFramework.Bindings.swift_CResult_InvoiceNoneZ_is_ok(o: LDKFramework.Result_InvoiceNoneZ) -> Swift.Bool , method descriptor for static LDKFramework.Bindings.swift_CResult_InvoiceNoneZ_is_ok(o: LDKFramework.Result_InvoiceNoneZ) -> Swift.Bool )
  "_CResult_InvoiceNoneZ_ok", referenced from:
      static LDKFramework.Result_InvoiceNoneZ.ok(o: LDKFramework.Invoice) -> LDKFramework.Result_InvoiceNoneZ in Result_InvoiceNoneZ.o
  "_CResult_ProbabilisticScoringParametersDecodeErrorZ_clone", referenced from:
      LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ.clone() -> LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ in Result_ProbabilisticScoringParametersDecodeErrorZ.o
  "_CResult_ProbabilisticScoringParametersDecodeErrorZ_err", referenced from:
      static LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ.err(e: LDKFramework.DecodeError) -> LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ in Result_ProbabilisticScoringParametersDecodeErrorZ.o
  "_CResult_ProbabilisticScoringParametersDecodeErrorZ_free", referenced from:
      LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ.deinit in Result_ProbabilisticScoringParametersDecodeErrorZ.o
  "_CResult_ProbabilisticScoringParametersDecodeErrorZ_is_ok", referenced from:
      static LDKFramework.Bindings.swift_CResult_ProbabilisticScoringParametersDecodeErrorZ_is_ok(o: LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ) -> Swift.Bool in Bindings.o
     (maybe you meant: method descriptor for static LDKFramework.Bindings.swift_CResult_ProbabilisticScoringParametersDecodeErrorZ_is_ok(o: LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ) -> Swift.Bool, static LDKFramework.Bindings.swift_CResult_ProbabilisticScoringParametersDecodeErrorZ_is_ok(o: LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ) -> Swift.Bool , dispatch thunk of static LDKFramework.Bindings.swift_CResult_ProbabilisticScoringParametersDecodeErrorZ_is_ok(o: LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ) -> Swift.Bool )
  "_CResult_ProbabilisticScoringParametersDecodeErrorZ_ok", referenced from:
      static LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ.ok(o: LDKFramework.ProbabilisticScoringParameters) -> LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ in Result_ProbabilisticScoringParametersDecodeErrorZ.o
  "_CResult_SiPrefixNoneZ_clone", referenced from:
      LDKFramework.Result_SiPrefixNoneZ.clone() -> LDKFramework.Result_SiPrefixNoneZ in Result_SiPrefixNoneZ.o
  "_CResult_SiPrefixNoneZ_err", referenced from:
      static LDKFramework.Result_SiPrefixNoneZ.err() -> LDKFramework.Result_SiPrefixNoneZ in Result_SiPrefixNoneZ.o
  "_CResult_SiPrefixNoneZ_free", referenced from:
      LDKFramework.Result_SiPrefixNoneZ.deinit in Result_SiPrefixNoneZ.o
  "_CResult_SiPrefixNoneZ_is_ok", referenced from:
      static LDKFramework.Bindings.swift_CResult_SiPrefixNoneZ_is_ok(o: LDKFramework.Result_SiPrefixNoneZ) -> Swift.Bool in Bindings.o
     (maybe you meant: dispatch thunk of static LDKFramework.Bindings.swift_CResult_SiPrefixNoneZ_is_ok(o: LDKFramework.Result_SiPrefixNoneZ) -> Swift.Bool, method descriptor for static LDKFramework.Bindings.swift_CResult_SiPrefixNoneZ_is_ok(o: LDKFramework.Result_SiPrefixNoneZ) -> Swift.Bool , static LDKFramework.Bindings.swift_CResult_SiPrefixNoneZ_is_ok(o: LDKFramework.Result_SiPrefixNoneZ) -> Swift.Bool )
  "_CResult_SiPrefixNoneZ_ok", referenced from:
      static LDKFramework.Result_SiPrefixNoneZ.ok(o: __C.LDKSiPrefix) -> LDKFramework.Result_SiPrefixNoneZ in Result_SiPrefixNoneZ.o
  "_CResult_SignedRawInvoiceNoneZ_clone", referenced from:
      LDKFramework.Result_SignedRawInvoiceNoneZ.clone() -> LDKFramework.Result_SignedRawInvoiceNoneZ in Result_SignedRawInvoiceNoneZ.o
  "_CResult_SignedRawInvoiceNoneZ_err", referenced from:
      static LDKFramework.Result_SignedRawInvoiceNoneZ.err() -> LDKFramework.Result_SignedRawInvoiceNoneZ in Result_SignedRawInvoiceNoneZ.o
  "_CResult_SignedRawInvoiceNoneZ_free", referenced from:
      LDKFramework.Result_SignedRawInvoiceNoneZ.deinit in Result_SignedRawInvoiceNoneZ.o
  "_CResult_SignedRawInvoiceNoneZ_is_ok", referenced from:
      static LDKFramework.Bindings.swift_CResult_SignedRawInvoiceNoneZ_is_ok(o: LDKFramework.Result_SignedRawInvoiceNoneZ) -> Swift.Bool in Bindings.o
     (maybe you meant: method descriptor for static LDKFramework.Bindings.swift_CResult_SignedRawInvoiceNoneZ_is_ok(o: LDKFramework.Result_SignedRawInvoiceNoneZ) -> Swift.Bool, dispatch thunk of static LDKFramework.Bindings.swift_CResult_SignedRawInvoiceNoneZ_is_ok(o: LDKFramework.Result_SignedRawInvoiceNoneZ) -> Swift.Bool , static LDKFramework.Bindings.swift_CResult_SignedRawInvoiceNoneZ_is_ok(o: LDKFramework.Result_SignedRawInvoiceNoneZ) -> Swift.Bool )
  "_CResult_SignedRawInvoiceNoneZ_ok", referenced from:
      static LDKFramework.Result_SignedRawInvoiceNoneZ.ok(o: LDKFramework.SignedRawInvoice) -> LDKFramework.Result_SignedRawInvoiceNoneZ in Result_SignedRawInvoiceNoneZ.o
  "_ProbabilisticScoringParameters_read", referenced from:
      static LDKFramework.ProbabilisticScoringParameters.read(ser: [Swift.UInt8]) -> LDKFramework.Result_ProbabilisticScoringParametersDecodeErrorZ in ProbabilisticScoringParameters.o
  "_ProbabilisticScoringParameters_write", referenced from:
      LDKFramework.ProbabilisticScoringParameters.write() -> [Swift.UInt8] in ProbabilisticScoringParameters.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** ARCHIVE FAILED **

The following build commands failed:
    Ld /Users/cuhte3/Library/Developer/Xcode/DerivedData/LDKFramework-fneuplswncykdybwopycmpvqifjs/Build/Intermediates.noindex/ArchiveIntermediates/LDKFramework/InstallationBuildProductsLocation/Library/Frameworks/LDKFramework.framework/Versions/A/LDKFramework normal (in target 'LDKFramework' from project 'LDKFramework')

As far as I can see there is a warning Could not find or use auto-linked library 'libldk.a', also a list of Undefined symbols for architecture x86_64. I guess the host Xcode project isn't properly configured on my end

jurvis commented 2 years ago

@cuhte3 thanks, this is helpful. I don't really have any solutions for you at the current moment, but I'll loop you in once I get the PR up with the new tooling to make sure it works for your use-case!

cuhte3 commented 2 years ago

I've just notice the xcframework also missing an iOS arm64 simulator lib = doesn't run in iOS simulator on m1 Macs

arik-so commented 2 years ago

Sorry, I'm finally able to get around to this. I would like to point out that on my non-M1-Mac running the latest Big Sur with the latest Xcode, I get architecture unsupported errors when trying to build the binaries for aarch64-apple-ios-macabi and aarch64-apple-darwin, whereas both x86_64-… architectures seem to work just fine.

cuhte3 commented 2 years ago

Sorry, I'm finally able to get around to this. I would like to point out that on my non-M1-Mac running the latest Big Sur with the latest Xcode, I get architecture unsupported errors when trying to build the binaries for aarch64-apple-ios-macabi and aarch64-apple-darwin, whereas both x86_64-… architectures seem to work just fine.

@arik-so probably you need to install additional instructions set. you can see all the supported targets by running rustup target list on your machine. however according to the list aarch64-apple-ios-macabi is in tier 3 means there is no official build. catalyst not a deal breaker for me personally :)

arik-so commented 2 years ago

Hm, it doesn't appear to be a rust toolchain issue, that's the first thing I checked. But I'll keep looking, thanks!

cuhte3 commented 2 years ago

last week I was able to build static libs for all the targets listed above on my m1 mac running Monterey. let me know if I can be helpful here, thanks!

jurvis commented 2 years ago

@cuhte3 I just put up #43, which includes a change to support building non-catalyst, darwin-based framework builds :)

I'm working on getting CI up to get some sanity checks now. Catalyst is last on my list.

cuhte3 commented 2 years ago

@jurvis you made my day! <3

jurvis commented 2 years ago

@cuhte3 oh and additional cherry on top: #43 will also add iOS simulator support for arm64 macs :)

Your SwiftUI previews should work again