Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac support #1393

Merged
merged 19 commits into from
Jan 18, 2020
Merged

Mac support #1393

merged 19 commits into from
Jan 18, 2020

Conversation

luca992
Copy link
Contributor

@luca992 luca992 commented Jul 3, 2019

Rebased @DanielRBaird pull request onto master's latest changes and add macosX64 as a target for the native driver

Looks like the transaction logs are correct test is failing with kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.Array@68c20b68 ... but as far as I can see that same test is not being run on ios targets? so that might also might be an issue for ios?

@JakeWharton
Copy link
Member

We cannot rename the ios-driver artifact. The best we can do is make it empty and depend on a shared native-driver.

@luca992
Copy link
Contributor Author

luca992 commented Jul 3, 2019

Okay, that was not brought up on the windows pull request. I'll see what I can do about that requirement

@JakeWharton
Copy link
Member

Any update? Want me to take over?

@JakeWharton JakeWharton self-assigned this Aug 1, 2019
@luca992
Copy link
Contributor Author

luca992 commented Aug 1, 2019

Sorry, I've been basically waiting for the kotlin native cocapods plugin to support swiftui desktop before fixing this up. Probably can't work on this til sometime next week. So go ahead if you want to.

@saket
Copy link
Contributor

saket commented Sep 5, 2019

Curious question: why is this blocked on swiftui?

@luca992
Copy link
Contributor Author

luca992 commented Sep 5, 2019

@saket it's not. Just trying to say that if my swiftUI app would actually build targeting desktop it would encourage me to fix up this pull request faster. Sorry, I can try and make the requested changes soon.

@luca992
Copy link
Contributor Author

luca992 commented Sep 17, 2019

Okay, I added the ios-driver artifact back in. I also added a InvalidMutabilityException workaround for the LogSqliteDriverTest. Not exactly sure if using AtomicReference is the best way to fix that. And I tried adding a native test driver for coroutines-extensions... but I'm running into more InvalidMutabilityException's there.

like:

query[macosX64]

kotlin.AssertionError: Expected no more events but found Error(throwable=kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlinx.coroutines.internal.LinkedListHead@c3023ab8)
        at 0   test.kexe                           0x000000010c142975 kfun:kotlin.Error.<init>(kotlin.String?)kotlin.Error + 85 (/Users/teamcity/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/Exceptions.kt:12:44)
        at 1   test.kexe                           0x000000010c143142 kfun:kotlin.AssertionError.<init>(kotlin.Any?)kotlin.AssertionError + 226 (/Users/teamcity/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/Exceptions.kt:128:41)
        at 2   test.kexe                           0x000000010c30102d kfun:com.squareup.sqldelight.runtime.coroutines.FlowAssert.$expectNoMoreEventsCOROUTINE$3.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? + 1197 (/Users/lucaspinazzola/Projects/sqldelight/extensions/coroutines-extensions/src/commonTest/kotlin/com/squareup/sqldelight/runtime/coroutines/FlowAssert.kt:107:13)
        at 3   test.kexe                           0x000000010c30122b kfun:com.squareup.sqldelight.runtime.coroutines.FlowAssert.expectNoMoreEvents() + 235 (/Users/lucaspinazzola/Projects/sqldelight/extensions/coroutines-extensions/src/commonTest/kotlin/com/squareup/sqldelight/runtime/coroutines/FlowAssert.kt:102:11)
        at 4   test.kexe                           0x000000010c30743f kfun:com.squareup.sqldelight.runtime.coroutines.$test$lambda-1COROUTINE$1.invokeSuspend#internal + 2799 (/Users/lucaspinazzola/Projects/sqldelight/extensions/coroutines-extensions/src/commonTest/kotlin/com/squareup/sqldelight/runtime/coroutines/FlowAssert.kt:58:18)
        at 5   test.kexe                           0x000000010c168a9a kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) + 730 (/Users/teamcity/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.kt:26:0)
        at 6   test.kexe                           0x000000010c2b6bcc kfun:kotlinx.coroutines.resumeUninterceptedMode$kotlinx-coroutines-core@kotlin.coroutines.Continuation<#GENERIC>.(#GENERIC;kotlin.Int)Generic + 1100 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/ResumeMode.kt:45:0)
        at 7   test.kexe                           0x000000010c2b7dc9 kfun:kotlinx.coroutines.TimeoutCoroutine.afterCompletionInternal#internal + 425 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/Timeout.kt:100:19)
        at 8   test.kexe                           0x000000010c2a2db6 kfun:kotlinx.coroutines.JobSupport.completeStateFinalization#internal + 1398 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/JobSupport.kt:310:9)
        at 9   test.kexe                           0x000000010c2a14cf kfun:kotlinx.coroutines.JobSupport.tryFinalizeFinishingState#internal + 1807 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/JobSupport.kt:236:9)
        at 10  test.kexe                           0x000000010c2abc40 kfun:kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath#internal + 1648 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/JobSupport.kt:849:13)
        at 11  test.kexe                           0x000000010c2ab503 kfun:kotlinx.coroutines.JobSupport.tryMakeCompleting#internal + 547 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/JobSupport.kt:811:16)
        at 12  test.kexe                           0x000000010c2aaf18 kfun:kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx-coroutines-core(kotlin.Any?;kotlin.Int)ValueType + 584 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/JobSupport.kt:786:0)
        at 13  test.kexe                           0x000000010c284024 kfun:kotlinx.coroutines.AbstractCoroutine.resumeWith(kotlin.Result<#GENERIC>) + 244 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/AbstractCoroutine.kt:111:9)
        at 14  test.kexe                           0x000000010c168d6a kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) + 1450 (/Users/teamcity/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.kt:26:0)
        at 15  test.kexe                           0x000000010c293ebf kfun:kotlinx.coroutines.DispatchedTask.run() + 2783 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/Dispatched.kt:227:0)
        at 16  test.kexe                           0x000000010c298e06 kfun:kotlinx.coroutines.EventLoopImplBase.processNextEvent()ValueType + 710 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/EventLoop.common.kt:270:20)
        at 17  test.kexe                           0x000000010c2ed202 kfun:kotlinx.coroutines.BlockingCoroutine.joinBlocking#internal + 1570 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/native/src/Builders.kt:60:0)
        at 18  test.kexe                           0x000000010c2ec431 kfun:kotlinx.coroutines.runBlocking(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,#GENERIC>)Generic + 1233 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/native/src/Builders.kt:50:22)
        at 19  test.kexe                           0x000000010c2ec9a4 kfun:kotlinx.coroutines.runBlocking$default(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,#GENERIC>;kotlin.Int)Generic + 372 (/opt/teamcity-agent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/native/src/Builders.kt:33:8)
        at 20  test.kexe                           0x000000010c33f329 kfun:com.squareup.sqldelight.runtime.coroutines.runTest(kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,kotlin.Unit>) + 217 (/Users/lucaspinazzola/Projects/sqldelight/extensions/coroutines-extensions/src/nativeTest/kotlin/com/squareup/sqldelight/runtime/coroutines/runTest.kt:22:63)
        at 21  test.kexe                           0x000000010c32c4d6 kfun:com.squareup.sqldelight.runtime.coroutines.QueryAsFlowTest.query() + 182 (/Users/lucaspinazzola/Projects/sqldelight/extensions/coroutines-extensions/src/commonTest/kotlin/com/squareup/sqldelight/runtime/coroutines/QueryAsFlowTest.kt:24:23)
        at 22  test.kexe                           0x000000010c337583 kfun:com.squareup.sqldelight.runtime.coroutines.$QueryAsFlowTest$test$0.$query$FUNCTION_REFERENCE$40.invoke#internal + 67 (/Users/lucaspinazzola/Projects/sqldelight/extensions/coroutines-extensions/src/commonTest/kotlin/com/squareup/sqldelight/runtime/coroutines/QueryAsFlowTest.kt:24:9)
        at 23  test.kexe                           0x000000010c3375f9 kfun:com.squareup.sqldelight.runtime.coroutines.$QueryAsFlowTest$test$0.$query$FUNCTION_REFERENCE$40.$<bridge-UNNN>invoke(#GENERIC)#internal + 89 (/Users/lucaspinazzola/Projects/sqldelight/extensions/coroutines-extensions/src/commonTest/kotlin/com/squareup/sqldelight/runtime/coroutines/QueryAsFlowTest.kt:24:9)
        at 24  test.kexe                           0x000000010c199ad0 kfun:kotlin.native.internal.test.BaseClassSuite.TestCase.run() + 1280 (/Users/teamcity/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/native/internal/test/TestSuite.kt:85:26)
        at 25  test.kexe                           0x000000010c193844 kfun:kotlin.native.internal.test.TestRunner.run#internal + 2404 (/Users/teamcity/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt:229:0)
        at 26  test.kexe                           0x000000010c1949d6 kfun:kotlin.native.internal.test.TestRunner.runIteration#internal + 2918 (/Users/teamcity/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt:252:0)
        at 27  test.kexe                           0x000000010c1952e9 kfun:kotlin.native.internal.test.TestRunner.run()ValueType + 953 (/Users/teamcity/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt:270:0)
        at 28  test.kexe                           0x000000010c188bcb kfun:kotlin.native.internal.test.testLauncherEntryPoint(kotlin.Array<kotlin.String>)ValueType + 283 (/Users/teamcity/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/native/internal/test/Launcher.kt:22:53)


Is this a problem with sqldelight or just the testing code?

@AlecKazakova
Copy link
Collaborator

the native driver changes have been merged to master, @luca992 would you be able to rebase this pr against master?

@luca992
Copy link
Contributor Author

luca992 commented Dec 12, 2019

@alecStrong yeah sure, no problem.

Copy link
Collaborator

@AlecKazakova AlecKazakova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, although the diff is hard to read because its including a bunch of commits that are on master, if you do git rebase -i master and manually drop commits that are already on master from your branch, does that fix it?

@@ -4,25 +4,7 @@ kotlin {
sourceSets {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we decided against having an ios-driver artifact and just doing the switch to native-driver, so this module can be removed entirely

@AlecKazakova AlecKazakova merged commit 8982629 into cashapp:master Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants