Giter Club home page Giter Club logo

Comments (4)

johndpope avatar johndpope commented on May 30, 2024

Sorry - bumping into several issues here

this library
https://github.com/unsignedapps/swift-create-xcframework

brew install mint
mint install unsignedapps/swift-create-xcframework
swift create-xcframework --platform ios

I need a path to get this working -
the realtime has an issue with zlib

spleeter) ➜ supabase-swift git:(master) ✗ swift create-xcframework --platform ios
Error: Xcode project generation is not supported by Swift Package Manager for packages that reference system modules.These system modules were referenced: swift-nio-zlib-support

// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
  name: "Supabase",
  platforms: [
    .iOS(.v13),
    .macCatalyst(.v13),
    .macOS(.v10_15),
    .watchOS(.v6),
    .tvOS(.v13),
  ],
  products: [
    .library(
      name: "Supabase",
      targets: ["Supabase"]
    )
  ],
  dependencies: [
    .package(url: "https://github.com/supabase-community/gotrue-swift", from: "0.0.7"),
    .package(url: "https://github.com/supabase-community/storage-swift.git", from: "0.0.2"),
    .package(url: "https://github.com/supabase-community/postgrest-swift", from: "0.0.6"),
  ],
  targets: [
    .target(
      name: "Supabase",
      dependencies: [
        .product(name: "GoTrue", package: "gotrue-swift"),
        .product(name: "SupabaseStorage", package: "storage-swift"),
        .product(name: "PostgREST", package: "postgrest-swift"),
      ]
    )
  ]
)

I still hit this

** ARCHIVE FAILED **

The following build commands failed:
CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler (in target 'SupabaseStorage' from project 'Supabase')
CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler (in target 'KeychainAccess' from project 'Supabase')
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'KeychainAccess' from project 'Supabase')
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'AnyCodable' from project 'Supabase')
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Get' from project 'Supabase')
CompileSwift normal arm64 (in target 'Get' from project 'Supabase')
(6 failures)
Error: xcodebuild exited with a non-zero code: 65

// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
  name: "Supabase",
  platforms: [
    .iOS(.v13),
    .macCatalyst(.v13),
    .macOS(.v10_15),
    .watchOS(.v6),
    .tvOS(.v13),
  ],
  products: [
    .library(
      name: "Supabase",
      targets: ["Supabase"]
    )
  ],
  dependencies: [
    .package(url: "https://github.com/supabase-community/gotrue-swift", from: "0.0.7"),
    .package(url: "https://github.com/supabase-community/storage-swift.git", from: "0.0.2"),
    .package(url: "https://github.com/wweevv-johndpope/realtime-swift.git", from: "0.0.2"),
    .package(url: "https://github.com/supabase-community/postgrest-swift", from: "0.0.6"),
  ],
  targets: [
    .target(
      name: "Supabase",
      dependencies: [
        .product(name: "GoTrue", package: "gotrue-swift"),
        .product(name: "SupabaseStorage", package: "storage-swift"),
        .product(name: "Realtime", package: "realtime-swift"),
        .product(name: "PostgREST", package: "postgrest-swift"),
      ]
    )
  ]
)

I hack the package to use my fork which has this fix
daltoniam/Starscream#844

but still not working...

swift create-xcframework --platform ios --stack-evolution

Screen Shot 2022-09-04 at 10 46 46 am

Screen Shot 2022-09-04 at 10 51 22 am

let closeCode = (error as? WSError)?.code ?? RealtimeClient.CloseCode.abnormal.rawValue

probably due to the hot fix above - I'll do some digging.

UPDATE

after some hotfixes - I got it to compile.

not sure what's going on - but seems like theres some code rot with the realtime.
wweevv-johndpope/realtime-swift@36cdcac

// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
  name: "Supabase",
  platforms: [
    .iOS(.v13),
    .macCatalyst(.v13),
    .macOS(.v10_15),
    .watchOS(.v6),
    .tvOS(.v13),
  ],
  products: [
    .library(
      name: "Supabase",
      targets: ["Supabase"]
    )
  ],
  dependencies: [
    .package(url: "https://github.com/supabase-community/gotrue-swift", from: "0.0.7"),
    .package(url: "https://github.com/supabase-community/storage-swift.git", from: "0.0.2"),
    .package(url: "https://github.com/wweevv-johndpope/realtime-swift.git", from: "0.0.5"),
    .package(url: "https://github.com/supabase-community/postgrest-swift", from: "0.0.6"),
  ],
  targets: [
    .target(
      name: "Supabase",
      dependencies: [
        .product(name: "GoTrue", package: "gotrue-swift"),
        .product(name: "SupabaseStorage", package: "storage-swift"),
        .product(name: "Realtime", package: "realtime-swift"),
        .product(name: "PostgREST", package: "postgrest-swift"),
      ]
    )
  ]
)

not sure if this will work - but goal is to get a file like this
https://github.com/wweevv-johndpope/supabase-xcframework

UPDATE
so it's possible to render out all the frameworks as so

swift create-xcframework AnyCodable ComposableKeychain Get GoTrue KeychainAccess PostgREST Realtime Starscream SupabaseStorage URLQueryEncoder XCTestDynamicOverlay --platform ios --stack-evolution

something breaks on import

Screen Shot 2022-09-04 at 12 00 28 pm

from supabase-swift.

johndpope avatar johndpope commented on May 30, 2024

https://github.com/apple/swift-package-manager/blob/main/Sources/SPMLLBuild/llbuild.swift

It maybe possible to reduce number of xcframeworks by using this technique
https://developer.apple.com/forums/thread/650995
You’d just need to modify a couple of lines in this library…. (I think)

UPDATE -

at this point using a bunch of hot fixes (renamed modules) + swift-create-xcframework

I can successfully create all the packages -

// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
  name: "Supabase",
  platforms: [
    .iOS(.v13),
    .macCatalyst(.v13),
    .macOS(.v10_15),
    .watchOS(.v6),
    .tvOS(.v13),
  ],
  products: [
    .library(
      name: "Supabase",
      targets: ["Supabase"]
    )
  ],
  dependencies: [
    .package(url: "https://github.com/wweevv-johndpope/gotrue-swift", from: "0.0.10"),
    .package(url: "https://github.com/supabase-community/storage-swift.git", from: "0.0.2"),
    .package(url: "https://github.com/wweevv-johndpope/realtime-swift.git", from: "0.0.5"),
    .package(url: "https://github.com/supabase-community/postgrest-swift", from: "0.0.6"),
  ],
  targets: [
    .target(
      name: "Supabase",
      dependencies: [
        .product(name: "GoTrue", package: "gotrue-swift"),
        .product(name: "SupabaseStorage", package: "storage-swift"),
        .product(name: "Realtime", package: "realtime-swift"),
        .product(name: "PostgREST", package: "postgrest-swift"),
      ]
    )
  ]
)

So currently - this is crashing
binaryscraping/swift-composable-keychain#1

UPDATE

this is a slim example of supabase integration + bazel - demonstrating crash.

git clone https://github.com/wweevv-johndpope/DemoBazel/tree/supabase
./xcodegen app

cheatsheet for adding dependencies with bazel
https://docs.google.com/presentation/d/1ZYwyA_zHjDugt4UH-APJt4qBSt_fbY_286WrgFQvdfA/edit#slide=id.p

from supabase-swift.

grdsdev avatar grdsdev commented on May 30, 2024

Supporting xcframework is not in the roadmap for now, we can revisit this later if priority changes.

from supabase-swift.

johndpope avatar johndpope commented on May 30, 2024

Hi @bok- have you encountered any problems in general with xcframework / where the swift code that would automatically deallocate / BAD_EXEC - but run fine when code is ran locally?
supabase-community/gotrue-swift#32

image

from supabase-swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.