Eric Womer
12/28/2022, 11:06 AMEric Womer
12/29/2022, 2:15 AMKrystian
12/29/2022, 11:22 PM@kotlinx.cinterop.internal.CStruct public final class Camera2D public constructor(rawPtr: kotlinx.cinterop.NativePtr /* = kotlin.native.internal.NativePtr */) : kotlinx.cinterop.CStructVar {
@kotlinx.cinterop.internal.CStruct.VarType @kotlin.Deprecated public companion object : kotlinx.cinterop.CStructVar.Type {
}
public final val offset: kaylib.Vector2 /* compiled code */
public final var rotation: kotlin.Float /* compiled code */
public final val target: kaylib.Vector2 /* compiled code */
public final var zoom: kotlin.Float /* compiled code */
}
offset and target are both vals and I can't simply modify them once alloc'ed, but I can modify their values which are .x and .y which isn't that much of a problem, but it does cause a little bit of dull modifications of .x and .y one by one (and I'm very sure its for a good reason)
There is no other way to mitigate this at all by somehow being able to mutate offset or target as one, rather than mutating its members?kevin.cianfarini
12/30/2022, 3:24 PMstatic inline void io_uring_prep_rw(int op, struct io_uring_sqe *sqe, int fd,
const void *addr, unsigned len,
__u64 offset)
{
fprintf(stdout, "SQE pointer %p", sqe);
For the life of me I cannot get this to be printed to stdout and I don't know why. Calls to Kotlin's println
are working fine so I suspect there's something funky going on in kotlin native modules. Does anyone have any idea why this might be happening?Landry Norris
12/30/2022, 4:14 PMoperator fun COpaquePointer?.compareTo(other: COpaquePointer?): Int {
return (toLong() - other.toLong()).toInt()
}
Adam S
01/01/2023, 5:06 PMkevin.cianfarini
01/01/2023, 6:38 PMvbsteven
01/02/2023, 8:54 AMnapperley
01/03/2023, 12:45 AMArchie
01/03/2023, 11:03 AMmicbakos
01/03/2023, 3:58 PMkotlin::FormatToSpan(kotlin::std_support::span<char, ...>, char const*, ...) + 10
which is mentioned in this channel before. This is the stacktrace in detail:
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x7b38 __pthread_kill + 8
1 libsystem_pthread.dylib 0x73bc pthread_kill + 268
2 libsystem_c.dylib 0x20524 abort + 168
3 ios 0x118b4f8 kotlin::FormatToSpan(kotlin::std_support::span<char, 18446744073709551615ul>, char const*, ...) + 10
4 ios 0x11b3850 ReportBacktraceToIosCrashLog(ObjHeader*) + 38
5 ios 0x11b3688 void (anonymous namespace)::$_0::operator()<(anonymous namespace)::terminateWithUnhandledException(ObjHeader*)::$_1>((anonymous namespace)::terminateWithUnhandledException(ObjHeader*)::$_1) + 80
6 ios 0x11b33d0 (anonymous namespace)::TerminateHandler::queuedHandler() + 10
7 ios 0x11b3384 (anonymous namespace)::processUnhandledException(ObjHeader*) + 64
8 ios 0x148d3ac kfun:kotlinx.coroutines#handleCoroutineExceptionImpl(kotlin.coroutines.CoroutineContext;kotlin.Throwable){} + 13 (CoroutineExceptionHandlerImpl.kt:13)
9 ios 0x1380520 kfun:kotlinx.coroutines#handleCoroutineException(kotlin.coroutines.CoroutineContext;kotlin.Throwable){} + 33 (CoroutineExceptionHandler.kt:33)
10 ios 0x1372c04 kfun:kotlinx.coroutines.StandaloneCoroutine.handleJobException#internal + 196 (Builders.common.kt:196)
11 ios 0x138e614 kfun:kotlinx.coroutines.JobSupport.finalizeFinishingState#internal + 229 (JobSupport.kt:229)
12 ios 0x1398794 kfun:kotlinx.coroutines.JobSupport.continueCompleting#internal + 935 (JobSupport.kt:935)
13 ios 0x139b5c8 kfun:kotlinx.coroutines.JobSupport.ChildCompletion.invoke#internal + 1155 (JobSupport.kt:1155)
14 ios 0x1390c3c kfun:kotlinx.coroutines.JobSupport.notifyCompletion#internal + 368 (JobSupport.kt:368)
15 ios 0x138fea4 kfun:kotlinx.coroutines.JobSupport.completeStateFinalization#internal + 323 (JobSupport.kt:323)
16 ios 0x138e4d4 kfun:kotlinx.coroutines.JobSupport.finalizeFinishingState#internal + 240 (JobSupport.kt:240)
17 ios 0x1397ac4 kfun:kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath#internal + 906 (JobSupport.kt:906)
18 ios 0x13974d0 kfun:kotlinx.coroutines.JobSupport.tryMakeCompleting#internal + 863 (JobSupport.kt:863)
19 ios 0x13970b0 kfun:kotlinx.coroutines.JobSupport#makeCompletingOnce(kotlin.Any?){}kotlin.Any? + 828 (JobSupport.kt:828)
20 ios 0x136d0e8 kfun:kotlinx.coroutines.AbstractCoroutine#resumeWith(kotlin.Result<1:0>){} + 100 (AbstractCoroutine.kt:100)
21 ios 0x1024a38 kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(kotlin.Result<kotlin.Any?>){} + 43 (ContinuationImpl.kt:43)
22 ios 0x145c138 kfun:kotlinx.coroutines.DispatchedTask#run(){} + 54 (Continuation.kt:54)
23 ios 0x1496b14 kfun:kotlinx.coroutines.DarwinMainDispatcher.dispatch$lambda$0#internal + 44 (Dispatchers.kt:44)
24 ios 0x1496e84 kfun:kotlinx.coroutines.DarwinMainDispatcher.$dispatch$lambda$0$FUNCTION_REFERENCE$75.invoke#internal + 43 (Dispatchers.kt:43)
25 ios 0x1496f68 kfun:kotlinx.coroutines.DarwinMainDispatcher.$dispatch$lambda$0$FUNCTION_REFERENCE$75.$<bridge-UNN>invoke(){}#internal + 43 (Dispatchers.kt:43)
26 ios 0x1497fec _6f72672e6a6574627261696e732e6b6f746c696e783a6b6f746c696e782d636f726f7574696e65732d636f7265_knbridge13 + 43 (Dispatchers.kt:43)
27 libdispatch.dylib 0x1e6c _dispatch_call_block_and_release + 32
28 libdispatch.dylib 0x3a30 _dispatch_client_callout + 20
29 libdispatch.dylib 0x11f48 _dispatch_main_queue_drain + 928
30 libdispatch.dylib 0x11b98 _dispatch_main_queue_callback_4CF + 44
31 CoreFoundation 0x51800 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
32 CoreFoundation 0xb704 __CFRunLoopRun + 2532
33 CoreFoundation 0x1ebc8 CFRunLoopRunSpecific + 600
34 GraphicsServices 0x1374 GSEventRunModal + 164
35 UIKitCore 0x514b58 -[UIApplication _run] + 1100
36 UIKitCore 0x296090 UIApplicationMain + 364
37 SwiftUI 0x23ff24 closure #1 in KitRendererCommon(_:) + 164
38 SwiftUI 0x16de08 runApp<A>(_:) + 252
39 SwiftUI 0x14f0f4 static App.main() + 128
40 ios 0x437fcc static iOSApp.$main() + 40 (<compiler-generated>:40)
41 ios 0x438074 main + 12 (iOSApp.swift:12)
42 ??? 0x105285da4 (Missing)
Are there any suggestions on where I can start looking for the reason of the crash?kevin.cianfarini
01/03/2023, 10:33 PMvbsteven
01/04/2023, 12:07 PMexport CC=<konan-gcc>
export LDFLAGS=-L<konan-lib-folder>
./configure --prefix=/tmp/somelibfolder
and linking that in my final output binary.vbsteven
01/04/2023, 12:14 PMhultgren
01/05/2023, 6:38 PMnoStringConversion
with the cocoapods plugin?Krystian
01/05/2023, 7:03 PMLandry Norris
01/06/2023, 8:25 PM:modulename:iosSimulatorArm64Test > 122 tests completed
. I’d like to know which test is currently running. If I run in the IDE, where it does show the current test, no tests infinite loop.Piasy
01/07/2023, 8:51 AMkotlin {
linuxX64 {
compilations.main {
cinterops {
xlog {
defFile "src/cppCommon/cinterop/xlog.def"
includeDirs {
allHeaders "${project.projectDir}/src/cppCommon/cpp"
}
}
}
kotlinOptions.freeCompilerArgs += [
"-include-binary",
"${project.projectDir}/src/linuxMain/libs/x64/libkmp_xlog.a".toString()
]
}
}
}
The key point is setting kotlinOptions.freeCompilerArgs
.
I’m wondering another thing: my c++ code depends on pthread
and z
, so in module which produces executable, my lib users need to add these two linker flags,
kotlin {
linuxX64 {
binaries {
all {
linkerOpts = [
"-lpthread",
"-lz",
]
}
executable("kmp_xlog") {
entryPoint = "com.piasy.kmp.xlog.example.main"
}
}
}
}
Is it possible that I specify these two linker flags in my library module, so they can be added to dependent modules automatically? So my lib users only need to add a gradle dependency, no need to set linkerOpts.Adam S
01/07/2023, 2:21 PMpublic external expect fun rocksdb_open(
options: CValuesRef<rocksdb_options_t>?,
name: String?,
errptr: CValuesRef<CPointerVar<ByteVar>>?
): CPointer<rocksdb_t>?
I need to pass in errptr
, but how can I create a value with type CValuesRef<CPointerVar<ByteVar>>
?Krystian
01/08/2023, 9:36 AMLandry Norris
01/09/2023, 7:00 PMios_simulator_arm64
is always underlined. For example, linkerOpts.ios_x64
shows as correct, but linkerOpts.ios_simulator_arm64
shows as an error. When I run tests or the app on ios arm64 simulator, everything works fine, it’s just a bit annoying to see the false error. What’s the best place to report this?Krystian
01/09/2023, 9:01 PMnapperley
01/09/2023, 12:35 AMMark Vogel
01/10/2023, 5:18 PMfun test() {
val bar = Bar()
val foo = Foo()
bar.doSomething() // How do you call this function
}
class Foo {
fun Bar.doSomething() {
// ...
}
}
class Bar {
// ...
}
ribesg
01/11/2023, 1:12 PMribesg
01/11/2023, 3:47 PMe: Could not find "org.jetbrains.kotlin.native.platform.CoreFoundationBase" in [/Users/ribesg/Projects/Inboxbooster-Mailer/HttpReceiver, /Users/ribesg/.konan/klib, /Users/ribesg/.konan/kotlin-native-prebuilt-macos-aarch64-1.7.22/klib/common, /Users/ribesg/.konan/kotlin-native-prebuilt-macos-aarch64-1.7.22/klib/platform/macos_arm64]
during compileKotlinMacosArm64
and compileKotlinMacosX64
. It worked before, it appeared when I added a dependency on com.squareup.okio:okio:3.3.0
, but the problem is that I don't understand the error.
It's open source so you can try for yourself here https://github.com/wizbii/Inboxbooster-Mailer/tree/feature/kotlin-receiver/HttpReceiver
✅ Was caused by Okio 3.3.0 being built for Kotlin 1.8 while I am using 1.7.22.kevin.cianfarini
01/11/2023, 11:53 PMrequestTerminationInternal
which is an external fun
so I'm not quite sure how to keep digging on this. I imagine it differs on each platform, but is this documented functionality anywhere?
https://github.com/JetBrains/kotlin/blob/30788566012c571aa1d3590912468d1ebe59983d/[…]ve/runtime/src/main/kotlin/kotlin/native/concurrent/Internal.ktJan Kuchař
01/13/2023, 6:41 PMKrystian
01/13/2023, 7:55 PMEric Womer
01/15/2023, 10:55 PM