Skolson5903
01/19/2022, 12:42 AMsaket
01/19/2022, 4:47 AMspec.name
of a generated podspec can't be changed?Landry Norris
01/20/2022, 4:22 AMfun main() {
}
and tried compiling it with konanc -nostdlib test.kt
. I get the following errors:
error: could not load module <org.jetbrains.kotlinx.kotlinx-cli>
error: compilation failed: Kotlin IR Linker exception
Has anyone tried compiling with the nostdlib option?nfrankel
01/21/2022, 5:35 PMkotlinc-native
https://kotlinlang.org/docs/native-command-line-compiler.html
but i’ve installed kotlin with homebrew
and i don’t see kotlinc-native
in the available binaries
$ls /usr/local/Cellar/kotlin/1.6.10/bin
kapt kotlin kotlin-dce-js kotlinc kotlinc-js kotlinc-jvm
do i need something additional?
or is an issue with the homebrew recipe?tarek
01/21/2022, 5:44 PM-opt
enabled
Do you think I should file a bug ?Benjamin Deroche
01/24/2022, 12:24 AM# SFML/Audio.h SFML/Graphics.h SFML/Network.h SFML/System.h SFML/Window.h
headers = SFML/Graphics.h \
SFML/System.h \
SFML/Window.h
headerFilter = SFML/**
compilerOpts.linux = -I/usr/include -I/usr/include/x86_64-linux-gnu
# -lcsfml-audio -lcsfml-graphics -lcsfml-network -lcsfml-system -lcsfml-window
linkerOpts.osx = -L/opt/local/lib -lcsfml-graphics -lcsfml-system -lcsfml-window
linkerOpts.linux = -L/usr/lib/x86_64-linux-gnu -lcsfml-graphics -lcsfml-system -lcsfml-window
Skolson5903
01/24/2022, 11:40 PMsuspend fun anyname(arg1:String, block: suspend (arg) -> Unit)
. What is the best way to invoke this from swift? I'm watching some unresolved issues in Youtrack (https://youtrack.jetbrains.com/issue/KT-47610 ) on making this better, but with current swift and kotlin 1.6.10 am having trouble figuring out if there is a non-messy way to do this. Specifically the best way to code the block
lambda above in the Swift call of anyname("xxx") { arg -> ... }
. I'm currently playing with using a class that implements the kotlin-generated swift protocol KotlinSuspendFunction1
which has an invoke
function that is getting called with arg1: Any? and a completionHandler. Is that the best/only way to make this work, or am I going down a rabbit hole since I'm a Swift newbie? If anyone can point me to an example of doing this better, I'd appreciate it. I guess the real answer I'm asking for is whether this is even a good thing to try to do from Swift until it gets improved 🙂. Thanks in advance for any tips/links.Racci
01/25/2022, 6:05 AMLandry Norris
01/25/2022, 8:47 PMkotlin::mm::internal::ObjectFactoryStorage<8ul, kotlin::mm::internal::AllocatorWithGC<kotlin::mm::internal::SimpleAllocator, kotlin::gc::SameThreadMarkAndSweep::ThreadData> >::Node::~Node:
and the error is Thread 1: EXC_BAD_ACCESS (code=1, address=0xff000000ff000000)
How can I confirm if this is a GC bug?y9san9
01/26/2022, 6:57 AMcompanion object
somehow, so I can use it without additional Companion()
call from Swift.
Seen this one: https://youtrack.jetbrains.com/issue/KT-44862. May be some workaround here?Daniel Baird
01/27/2022, 2:55 PMAttempted to dereference garbage pointer
exceptions in iOS with a few different stack traces, and we are unable to reproduce it. We do a lot of passing objects around between swift and kotlin native, and I don't feel like I have a good handle on how the memory management works in cases where an object originates in kotlin and gets passed into swift, or situations involving lambdas/closures that should be holding on to things. I have a hunch that these issues are related to issues with how we are handling this though.
Does anyone know where I can find detailed documentation of how these situations work, or have any info about potential causes of this error when interoping with kotlin native?
I have of course read the main kotlin pages like https://kotlinlang.org/docs/native-objc-interop.html.wilddev
01/31/2022, 7:20 PMGabi
02/01/2022, 4:07 AMFrancesco Pedron
02/01/2022, 8:47 AMJim
02/01/2022, 10:31 PMmartmists
02/05/2022, 2:37 AMLandry Norris
02/08/2022, 6:36 PMnapperley
02/10/2022, 2:40 AMCore (depends on LVGL C lib); targets linuxX64 & linuxArm32Hfp
|> Drivers (depends on LVGL & LV Drivers C libs); targets linuxX64 & linuxArm32Hfp
|> SDL 2 (depends on LV Drivers & SDL 2 C libs); targets linuxX64
If the LVGK KT Widgets library existed then the structure would look like this:
Core (depends on LVGL C lib); targets linuxX64 & linuxArm32Hfp
|> Widgets (depends on LVGL C lib); targets linuxX64 & linuxArm32Hfp
|> Drivers (depends on LVGL & LV Drivers C libs); targets linuxX64 & linuxArm32Hfp
|> SDL 2 (depends on LV Drivers & SDL 2 C libs); targets linuxX64
Apparently there is an issue where Kotlin compiler caching can fail when the same C library is used in multiple Kotlin Native libraries that are used by a Kotlin Native program: https://youtrack.jetbrains.com/issue/KT-51190Bailey Pollard
02/10/2022, 4:51 PM.xcframework
to a kotlin native project?ubuntudroid
02/11/2022, 1:43 PMisStatic = true
to integrate our shared module into the iOS app.
However, I now have to make shared dynamic due to some third party library issue which can only be worked around with that due to this Kotlin native issue: https://youtrack.jetbrains.com/issue/KT-50982#focus=Comments-27-5741956.0-0 Apart from that, it seems that using dynamic frameworks is the preferred way anyway, so I am generally fine with that workaround:
cocoapods {
ios.deploymentTarget = "14.1"
framework {
summary = "Shared Module"
baseName = "shared"
isStatic = false
embedBitcode(BITCODE)
podfile = project.file("../iosApp/Podfile")
}
}
All is good and well and the app builds as it should until I try to export the archive which now fails with the following error message:
shared not found in dylib search path
Any idea what I might need to change to make this work?ishitatsuyuki
02/13/2022, 9:59 AMsdeleuze
02/15/2022, 8:42 AMimport platform.posix.*
and import libcurl.*
in red (unresolved reference) in kotlin/kotlin-native/tools/benchmarksAnalyzer/src/main/kotlin-native/org/jetbrains/analyzer/Utils.kt
.
I found in Kotlin Native README that I had to run ./gradlew :kotlin-native:dist :kotlin-native:distPlatformLibs
at the root of the kotlin
project to get import platform.posix.*
resolving. This part is now fixed.
But I am blocked for libcurl:
> Task :compileNativeMainKotlinMetadata FAILED
e: /home/seb/playground/kotlin/kotlin-native/tools/benchmarksAnalyzer/src/main/kotlin-native/org/jetbrains/analyzer/Utils.kt: (10, 8): Unresolved reference: libcurl
I have libcurl installed (Archlinux) and headers are in /usr/local/include
.
I tried to modify the build to specify `compilerOpts '-I/usr/local/include'`:
fromPreset(presets.linuxX64, 'linux') {
compilations.main.cinterops {
libcurl {
compilerOpts '-I/usr/local/include'
includeDirs.headerFilterOnly '/usr/include', '/usr/local/include'
}
}
}
But still the same error. When I try to build the project with gradle build
I get:
> Task :compileNativeMainKotlinMetadata FAILED
e: /home/seb/playground/kotlin/kotlin-native/tools/benchmarksAnalyzer/src/main/kotlin-native/org/jetbrains/analyzer/Utils.kt: (10, 8): Unresolved reference: libcurl
The command gradle cinteropLibcurlLinux
seems to run properly and invokes cinterop -o /home/seb/playground/kotlin/kotlin-native/tools/benchmarksAnalyzer/build/classes/kotlin/linux/main/cinterop/benchmarksAnalyzer-cinterop-libcurl.klib -target linux_x64 -def /home/seb/playground/kotlin/kotlin-native/tools/benchmarksAnalyzer/src/nativeInterop/cinterop/libcurl.def -compiler-option -I/usr/local/include -Xmodule-name benchmarksAnalyzer-cinterop-libcurl
which seems to work fine.
Could somebody point me to what I am missing to get libcurl resolving both in IDEA and with gradle build
?kevin.cianfarini
02/16/2022, 4:33 PM> Task :runtime:linkDebugTestLinuxX64
e: Unable to compile C bridges
> Task :runtime:linkDebugTestLinuxX64 FAILED
FAILURE: Build failed with an exception.
Which took a while to debug that it was an issue with the compiler itself, and not the code I was compiling.Sterling Albury
02/16/2022, 9:44 PMwithContext
in my suspend function. If I try to use DispatchQueue.main.async
it complains about passing a function type () aync ->()
to a param expecting sync function type. I'm using the experimental native memory model in my kotlin module btw.Zode
02/17/2022, 3:01 AMhho
02/17/2022, 6:35 PM./gradlew nativeTest
the task nativeTestProcessResources
is actually never executed. Why is that?William Reed
02/17/2022, 7:48 PMmaxosX64
target project on my apple silicon mac, and everything with the build goes fine, but the run
task keeps getting skipped.
> Task :app:compileKotlinMacosX64 UP-TO-DATE
> Task :app:linkDebugExecutableMacosX64 UP-TO-DATE
> Task :app:runDebugExecutableMacosX64 SKIPPED
any ideas? I've tried on multiple projects and running a clean build. kotlin 1.6.10
running with ./gradlew runDebugExecutableMacosX64
Shehab Ellithy
02/18/2022, 5:25 AMflygerian.eagle
02/21/2022, 5:33 AMWilliam Reed
02/21/2022, 9:50 PMByteBuffer
that is kotlin native friendly? I found there is something similar inside kotlinx.serialization
so I might just copy that file in https://github.com/Kotlin/kotlinx.serialization/blob/v0.9.1/runtime/native/src/main/kotlin/kotlinx/io/Buffers.kt