From 2fdca2f3163fbe95f42da11d3e25c289b5172a55 Mon Sep 17 00:00:00 2001 From: b5 Date: Mon, 22 Jul 2024 18:47:54 -0400 Subject: [PATCH 1/2] update swift, add podspec publish doc to RELEASE.md --- .../ios-arm64/Iroh.framework/Headers/iroh_ffiFFI.h | 12 ++++++------ .../Iroh.framework/Headers/iroh_ffiFFI.h | 12 ++++++------ .../macos-arm64/Iroh.framework/Headers/iroh_ffiFFI.h | 12 ++++++------ IrohLib.podspec | 2 +- IrohLib/Sources/IrohLib/IrohLib.swift | 8 ++++---- Package.swift | 4 ++-- RELEASE.md | 7 +++++++ 7 files changed, 32 insertions(+), 25 deletions(-) diff --git a/Iroh.xcframework/ios-arm64/Iroh.framework/Headers/iroh_ffiFFI.h b/Iroh.xcframework/ios-arm64/Iroh.framework/Headers/iroh_ffiFFI.h index d1bb50fa..68f18f78 100644 --- a/Iroh.xcframework/ios-arm64/Iroh.framework/Headers/iroh_ffiFFI.h +++ b/Iroh.xcframework/ios-arm64/Iroh.framework/Headers/iroh_ffiFFI.h @@ -756,9 +756,9 @@ void uniffi_iroh_ffi_fn_free_doc(void*_Nonnull ptr, RustCallStatus *_Nonnull out uint64_t uniffi_iroh_ffi_fn_method_doc_close_me(void*_Nonnull ptr ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE_ENTRY -#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE_ENTRY -uint64_t uniffi_iroh_ffi_fn_method_doc_delete_entry(void*_Nonnull ptr, void*_Nonnull author_id, RustBuffer prefix +#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE +#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE +uint64_t uniffi_iroh_ffi_fn_method_doc_delete(void*_Nonnull ptr, void*_Nonnull author_id, RustBuffer prefix ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_EXPORT_FILE @@ -2388,9 +2388,9 @@ uint16_t uniffi_iroh_ffi_checksum_method_doc_close_me(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE_ENTRY -#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE_ENTRY -uint16_t uniffi_iroh_ffi_checksum_method_doc_delete_entry(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE +#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE +uint16_t uniffi_iroh_ffi_checksum_method_doc_delete(void ); #endif diff --git a/Iroh.xcframework/ios-arm64_x86_64-simulator/Iroh.framework/Headers/iroh_ffiFFI.h b/Iroh.xcframework/ios-arm64_x86_64-simulator/Iroh.framework/Headers/iroh_ffiFFI.h index d1bb50fa..68f18f78 100644 --- a/Iroh.xcframework/ios-arm64_x86_64-simulator/Iroh.framework/Headers/iroh_ffiFFI.h +++ b/Iroh.xcframework/ios-arm64_x86_64-simulator/Iroh.framework/Headers/iroh_ffiFFI.h @@ -756,9 +756,9 @@ void uniffi_iroh_ffi_fn_free_doc(void*_Nonnull ptr, RustCallStatus *_Nonnull out uint64_t uniffi_iroh_ffi_fn_method_doc_close_me(void*_Nonnull ptr ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE_ENTRY -#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE_ENTRY -uint64_t uniffi_iroh_ffi_fn_method_doc_delete_entry(void*_Nonnull ptr, void*_Nonnull author_id, RustBuffer prefix +#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE +#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE +uint64_t uniffi_iroh_ffi_fn_method_doc_delete(void*_Nonnull ptr, void*_Nonnull author_id, RustBuffer prefix ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_EXPORT_FILE @@ -2388,9 +2388,9 @@ uint16_t uniffi_iroh_ffi_checksum_method_doc_close_me(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE_ENTRY -#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE_ENTRY -uint16_t uniffi_iroh_ffi_checksum_method_doc_delete_entry(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE +#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE +uint16_t uniffi_iroh_ffi_checksum_method_doc_delete(void ); #endif diff --git a/Iroh.xcframework/macos-arm64/Iroh.framework/Headers/iroh_ffiFFI.h b/Iroh.xcframework/macos-arm64/Iroh.framework/Headers/iroh_ffiFFI.h index d1bb50fa..68f18f78 100644 --- a/Iroh.xcframework/macos-arm64/Iroh.framework/Headers/iroh_ffiFFI.h +++ b/Iroh.xcframework/macos-arm64/Iroh.framework/Headers/iroh_ffiFFI.h @@ -756,9 +756,9 @@ void uniffi_iroh_ffi_fn_free_doc(void*_Nonnull ptr, RustCallStatus *_Nonnull out uint64_t uniffi_iroh_ffi_fn_method_doc_close_me(void*_Nonnull ptr ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE_ENTRY -#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE_ENTRY -uint64_t uniffi_iroh_ffi_fn_method_doc_delete_entry(void*_Nonnull ptr, void*_Nonnull author_id, RustBuffer prefix +#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE +#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_DELETE +uint64_t uniffi_iroh_ffi_fn_method_doc_delete(void*_Nonnull ptr, void*_Nonnull author_id, RustBuffer prefix ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_FN_METHOD_DOC_EXPORT_FILE @@ -2388,9 +2388,9 @@ uint16_t uniffi_iroh_ffi_checksum_method_doc_close_me(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE_ENTRY -#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE_ENTRY -uint16_t uniffi_iroh_ffi_checksum_method_doc_delete_entry(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE +#define UNIFFI_FFIDEF_UNIFFI_IROH_FFI_CHECKSUM_METHOD_DOC_DELETE +uint16_t uniffi_iroh_ffi_checksum_method_doc_delete(void ); #endif diff --git a/IrohLib.podspec b/IrohLib.podspec index 32a33bd3..672aafcb 100644 --- a/IrohLib.podspec +++ b/IrohLib.podspec @@ -15,7 +15,7 @@ Pod::Spec.new do |spec| } spec.author = { "b5" => "sparkle_pony_2000@n0.computer" } spec.social_media_url = "https://twitter.com/iroh_n0" - spec.source = { :git => "https://github.com/n0-computer/iroh-ffi.git", :tag => "#{spec.version}" } + spec.source = { :git => "https://github.com/n0-computer/iroh-ffi.git", :tag => "v#{spec.version}" } spec.static_framework = true spec.source_files = "IrohLib/Sources/IrohLib/*.swift" spec.swift_version = '5.9' diff --git a/IrohLib/Sources/IrohLib/IrohLib.swift b/IrohLib/Sources/IrohLib/IrohLib.swift index 6b1f3b09..a3ea414d 100644 --- a/IrohLib/Sources/IrohLib/IrohLib.swift +++ b/IrohLib/Sources/IrohLib/IrohLib.swift @@ -2748,7 +2748,7 @@ public protocol DocProtocol: AnyObject { * * Returns the number of entries deleted. */ - func deleteEntry(authorId: AuthorId, prefix: Data) async throws -> UInt64 + func delete(authorId: AuthorId, prefix: Data) async throws -> UInt64 /** * Export an entry as a file to a given absolute path @@ -2904,11 +2904,11 @@ open class Doc: * * Returns the number of entries deleted. */ - open func deleteEntry(authorId: AuthorId, prefix: Data) async throws -> UInt64 { + open func delete(authorId: AuthorId, prefix: Data) async throws -> UInt64 { return try await uniffiRustCallAsync( rustFutureFunc: { - uniffi_iroh_ffi_fn_method_doc_delete_entry( + uniffi_iroh_ffi_fn_method_doc_delete( self.uniffiClonePointer(), FfiConverterTypeAuthorId.lower(authorId), FfiConverterData.lower(prefix) ) @@ -12812,7 +12812,7 @@ private var initializationResult: InitializationResult = { if uniffi_iroh_ffi_checksum_method_doc_close_me() != 13449 { return InitializationResult.apiChecksumMismatch } - if uniffi_iroh_ffi_checksum_method_doc_delete_entry() != 42178 { + if uniffi_iroh_ffi_checksum_method_doc_delete() != 54552 { return InitializationResult.apiChecksumMismatch } if uniffi_iroh_ffi_checksum_method_doc_export_file() != 16067 { diff --git a/Package.swift b/Package.swift index 2683bcb9..66962ba4 100644 --- a/Package.swift +++ b/Package.swift @@ -21,7 +21,7 @@ let package = Package( path: "IrohLib/Sources/IrohLib"), .binaryTarget( name: "Iroh", - url: "https://github.com/n0-computer/iroh-ffi/releases/download/v0.20.0/IrohLib.xcframework.zip", - checksum: "8123c2d43690c423e9bc8993c935b2fe009731f3b65b95754358570077037858") + url: "https://github.com/n0-computer/iroh-ffi/releases/download/v0.21.0/IrohLib.xcframework.zip", + checksum: "1f5bdcf6676cd937be18845110513b0316a44053fe718cab7a6bdf7d9349677e") ] ) diff --git a/RELEASE.md b/RELEASE.md index 9ff91479..daf74533 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -46,6 +46,13 @@ let package = Package( 6. Commit the result & push +### Cocoapods +1. lint the `IrohLibFramework`: `pod spec lint IrohLibFramework.podspec`, make sure it passes +2. `pod trunk push IrohlibFramework.podspec` +3. `pod spec lint IrohFramework.podspec`, make sure it passes +4. wait 6 minutes for cache to catch up & show new `IrohLibFramework.podspec` as available +5. `pod trunk push IrohFramework.podspec --allow-warnings` + ## Python The first time: From 50c685b7b94b4be766b458df25f8042b1dd4717d Mon Sep 17 00:00:00 2001 From: b5 Date: Tue, 23 Jul 2024 10:51:35 -0400 Subject: [PATCH 2/2] welp, I messed up --- IrohLib.podspec | 7 +++++-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 -------- IrohLibFramework.podspec | 7 +++++-- Package.swift | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 IrohLib/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/IrohLib.podspec b/IrohLib.podspec index 672aafcb..589e73d4 100644 --- a/IrohLib.podspec +++ b/IrohLib.podspec @@ -15,11 +15,14 @@ Pod::Spec.new do |spec| } spec.author = { "b5" => "sparkle_pony_2000@n0.computer" } spec.social_media_url = "https://twitter.com/iroh_n0" - spec.source = { :git => "https://github.com/n0-computer/iroh-ffi.git", :tag => "v#{spec.version}" } + spec.source = { :git => "https://github.com/n0-computer/iroh-ffi.git", :tag => "#{spec.version}" } spec.static_framework = true spec.source_files = "IrohLib/Sources/IrohLib/*.swift" spec.swift_version = '5.9' spec.framework = "SystemConfiguration" spec.ios.deployment_target = '15.0' - spec.dependency 'IrohLibFramework', "#{spec.version}" + # WARNINNG: we're publishing v0.21.0-1, not v0.21.0 because of an error in the binary artifact of the original release + # on the next release, rever to the template-driven URL: + # spec.dependency 'IrohLibFramework', "#{spec.version}" + spec.dependency 'IrohLibFramework', "0.21.0-1" end diff --git a/IrohLib/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/IrohLib/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/IrohLib/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/IrohLibFramework.podspec b/IrohLibFramework.podspec index ef87f8a0..22a009de 100644 --- a/IrohLibFramework.podspec +++ b/IrohLibFramework.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "IrohLibFramework" - spec.version = "0.21.0" + spec.version = "0.21.0-1" spec.summary = "Complied rust cocoa framework for Iroh" spec.description = <<-DESC Complied rust cocoa framework for Iroh. @@ -13,6 +13,9 @@ Pod::Spec.new do |spec| spec.author = { "b5" => "sparkle_pony_2000@n0.computer" } spec.ios.deployment_target = '15.0' spec.static_framework = true - spec.source = { :http => "https://github.com/n0-computer/iroh-ffi/releases/download/v#{spec.version}/IrohLib.xcframework.zip" } + # WARNING: we're publishing v0.21.0-1, not v0.21.0 because of an error in the binary artifact of the original release + # in v0.21.1 or higher, switch back to the template-driven URL: + # spec.source = { :http => "https://github.com/n0-computer/iroh-ffi/releases/download/v#{spec.version}/IrohLib.xcframework.zip" } + spec.source = { :http => "https://github.com/n0-computer/iroh-ffi/releases/download/v0.21.0/IrohLib.xcframework.zip" } spec.vendored_frameworks = 'Iroh.xcframework' end diff --git a/Package.swift b/Package.swift index 66962ba4..43f19b4e 100644 --- a/Package.swift +++ b/Package.swift @@ -22,6 +22,6 @@ let package = Package( .binaryTarget( name: "Iroh", url: "https://github.com/n0-computer/iroh-ffi/releases/download/v0.21.0/IrohLib.xcframework.zip", - checksum: "1f5bdcf6676cd937be18845110513b0316a44053fe718cab7a6bdf7d9349677e") + checksum: "f8bfb2c9cdc9d602494e25e204ada6d44a7d6032de695a97893dca3c7fa3fac6") ] )