Comments (4)
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
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
from supabase-swift.
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.
Supporting xcframework is not in the roadmap for now, we can revisit this later if priority changes.
from supabase-swift.
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
from supabase-swift.
Related Issues (20)
- Broke `StoredSession` JSON backward-compatibility HOT 2
- Failing to decode models when querying foreign tables HOT 11
- DecodingError when receiving 401 from API HOT 5
- SwiftCompile Error in Xcode 15.0 beta 5 for EventEmitter.swift from Supabase Swift SD HOT 7
- SwiftData Best Practices HOT 3
- rpc with different params type HOT 4
- createSignedURLs error in Supabase for Swift: body must have required property 'expiresIn' HOT 1
- Session.User: isAnonymous field missed HOT 1
- Can't log out deleted user with supabase.auth.signOut() HOT 1
- Edge Functions are invoked with POST only
- Incorrect parameters extracting on PKCE flow HOT 1
- Unable to update user after anonymous sign-in HOT 2
- App crashes with error: pointer being freed was not allocated
- Add examples for new way to access database HOT 2
- [Realtime] RealtimeV2 broadcastStreams skip every other "Broadcast" HOT 3
- "Could not connect to the server" using Supabase in AppClip. HOT 1
- [Auth] Add support for error codes
- Equals filter failed on column where value starts with non-alphanumeric character HOT 2
- Need proper signOut() after deleting account HOT 1
- [Auth] Add option for disabling auto refresh token
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supabase-swift.