stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.57k stars 1.54k forks source link

Add VisionOS support #1237

Closed AnthonyMDev closed 2 months ago

AnthonyMDev commented 5 months ago

This PR adds support or VisionOS by:

When running the tests on visionOS, there is a single failing test. I'm not familiar enough with the library to know what could be causing that failure. If someone is able to point me in the right direction, I'd be happy to get the test passing so this can be merged in.

AnthonyMDev commented 5 months ago

It looks like this test failure is unrelated to this PR, as it was also failing in this other PR.

AnthonyMDev commented 4 months ago

@nathanfallet, any chance we could get some eyes on this? We've got users of our SDK asking for VisionOS support, and we are waiting on support in this library to make that work.

AnthonyMDev commented 4 months ago

Awesome thank you! Looks like the just that one broken test that is failing still.

nathanfallet commented 4 months ago

Yes I need to check why; I don't think it's related to visionOS addition, but I don't want to merge if it's failing 😅

loganblevins commented 4 months ago

@nathanfallet Where does this stand?

nathanfallet commented 4 months ago

EDIT: This is fixed

It fails at:

Test Case '-[SQLiteTests.QueryTests test_insert_encodable_with_nested_encodable]' started.
/Users/runner/work/SQLite.swift/SQLite.swift/Tests/SQLiteTests/Typed/QueryTests.swift:367: error: -[SQLiteTests.QueryTests test_insert_encodable_with_nested_encodable] : XCTAssertEqual failed: ("INSERT INTO "emails" ("int", "string", "bool", "float", "double", "date", "uuid", "optional", "sub") VALUES (1, '2', 1, 3.0, 4.0, '1970-01-01T00:00:00.000', 'E621E1F8-C36C-495A-93FC-0C247A3E6E5F', 'optional', '{"bool":true,"double":4,"uuid":"E621E1F8-C36C-495A-93FC-0C247A3E6E5F","float":3,"string":"2","date":-978307200,"int":1}')") is not equal to ("INSERT INTO "emails" ("int", "string", "bool", "float", "double", "date", "uuid", "optional", "sub") VALUES (1, '2', 1, 3.0, 4.0, '1970-01-01T00:00:00.000', 'E621E1F8-C36C-495A-93FC-0C247A3E6E5F', 'optional', '{"string":"2","int":1,"bool":true,"date":-978307200,"float":3,"double":4,"uuid":"E621E1F8-C36C-495A-93FC-0C247A3E6E5F"}')")
Test Case '-[SQLiteTests.QueryTests test_insert_encodable_with_nested_encodable]' failed (0.268 seconds).

It's actually the json is not ordered the same way... (it represents the same thing but not equals as a string)

{"bool":true,"double":4,"uuid":"E621E1F8-C36C-495A-93FC-0C247A3E6E5F","float":3,"string":"2","date":-978307200,"int":1}
{"string":"2","int":1,"bool":true,"date":-978307200,"float":3,"double":4,"uuid":"E621E1F8-C36C-495A-93FC-0C247A3E6E5F"}

It seems to be a change to a newer version of Swift, because it does not happen in other PR's tests. After some tests in Xcode Playground, it looks like encoding to JSON gives a random order each time. image

nathanfallet commented 4 months ago

Last thing to fix:

-> SQLite.swift/standalone (0.14.1)
    - ERROR | [SQLite.swift/standalone] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - NOTE  | [SQLite.swift/standalone] xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | [SQLite.swift/standalone] xcodebuild:  note: Building targets in dependency order
    - NOTE  | [iOS] [SQLite.swift/standalone] xcodebuild:  note: Target dependency graph (4 targets)
    - NOTE  | [SQLite.swift/standalone] xcodebuild:  clang: error: SDK does not contain 'libarclite' at the path '/Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a'; try increasing the minimum deployment target
    - NOTE  | [SQLite.swift/standalone] xcodebuild:  Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'sqlite3' from project 'Pods')
    - NOTE  | [iOS] [SQLite.swift/standalone] xcodebuild:  note: Target dependency graph (3 targets)

[!] SQLite.swift did not pass validation, due to 1 error.

I had the warning for IPHONEOS_DEPLOYMENT_TARGET 3 times (the two other ones were from 11.0, I updated it in the podspec) but I'm unable to get rid of this last one. (it's a warning but I read the missing libarclite was linked to this)

@jberkel any idea on this?

groue commented 4 months ago

Last thing to fix

It's probably https://github.com/CocoaPods/CocoaPods/issues/11839. If you manage to work around it, I'll be happy to know your solution :-)

calvincestari commented 3 months ago

@nathanfallet - where are we on getting this resolved and merged?

nathanfallet commented 3 months ago

@calvincestari I'm trying to find a solution with cocoapods that currently breaks the project. When that will be fixed, we'll be able to merge it.

fenhelix commented 2 months ago

@nathanfallet Any luck or insight on the cocoapods breaking the VisionOS support?

calvincestari commented 2 months ago

Thanks for getting this merged @nathanfallet, much appreciated!

calvincestari commented 2 months ago

@nathanfallet, another question for this: will the podspec be updated to declare support for visionOS too? When I try push our updated podspec I get an error about incompatibility with SQLite.swift and visionOS. I believe it requires another deployment target.

- ERROR | [visionOS] [Apollo/SQLite] unknown: Encountered an unknown error (The platform of the target `App` (visionOS 1.0) is not compatible with `SQLite.swift (0.15.1)`, which does not support `visionOS`.) during validation.
nathanfallet commented 2 months ago

@calvincestari I'll have a look at that, it might have been missing in the PR