iamsteveholmes
06/25/2021, 9:29 PMphisch
06/27/2021, 6:52 PMxcb.def
(used for x11), one cairo.def
(used for both x11 and wayland), and a pango.def
(also used for both targets). The issue is that a part of the cairo library (which i will extract into its own def file), links against xcb. So if i create its own file for this, the package will be a different one, and in code, i end up with 2 interop types in different packages which are basically the same. So a function from the cairo package might require cairo.xcb_visualtype_t
instead of a xcb.xcb_visualtype_t
and i have no idea how to tell it that it should use the one from the xcb namespace instead.
There is probably a really easy way to solve this, but i don't know how yet, and the documentations didn't push me in the right direction.napperley
06/28/2021, 4:50 AMimport kotlinx.cinterop.*
import platform.linux.free
import platform.linux.malloc
fun main() {
var topicPtr = malloc(8uL * 5uL)?.reinterpret<ByteVar>()
topicPtr?.set(0, '/'.toByte())
topicPtr?.set(1, 't'.toByte())
topicPtr?.set(2, 'e'.toByte())
topicPtr?.set(3, 's'.toByte())
topicPtr?.set(4, 't'.toByte())
println("Topic: ${topicPtr?.toKString()}")
free(topicPtr)
topicPtr = null
// Smart Casting occurs here.
free(topicPtr)
println("Exiting...")
}
napperley
06/29/2021, 3:20 AMUncaught Kotlin exception: kotlin.native.IncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread
at ThrowIncorrectDereferenceException (0x28742c)
at (0x32cda1)
at Kotlin_initRuntimeIfNeeded (0x33cd7b)
at _636f6d2e636861706d616e3a626f6c742d646174612d636f6e73756d6572_kncfun78 (0x32e26c)
at MQTTClient_run (0x347173)
at (0x7fd0e85d86db)
at clone (0x7fd0e80e9a3f)
at ((nil))
napperley
06/30/2021, 2:37 AMankushg
06/30/2021, 4:08 PMSlackbot
06/30/2021, 8:45 PMMats Larsen
07/01/2021, 12:03 AM-p library
.Mats Larsen
07/01/2021, 12:05 AMMohit Khanna
07/01/2021, 1:54 AMoverride val entries: MutableSet<MutableMap.MutableEntry<K, V>>
get() {
throw UnsupportedOperationException("Can't leak mutable reference")
// access { IsoMutableSet(fork(it.entries)) }
}
Thanks!martmists
07/02/2021, 11:01 AMmartmists
07/02/2021, 4:16 PMmartmists
07/02/2021, 4:20 PMkotlin
abstract class Node {
abstract fun process()
abstract fun cleanup()
abstract val inputs: Map<String, CArrayPointer<FloatVar>>
abstract val outputs: List<String>
fun connect(output: String, receivingNode: Node, input: String) {
if (!outputs.contains(output)) {
throw IllegalArgumentException("Unknown node output name! (Connecting ${this::class.simpleName}.$output to ${receivingNode::class.simpleName}.$input)")
}
val new = mutableMapOf<String, CArrayPointer<FloatVar>>().also {
it.putAll(this.connections.value)
it[output] = receivingNode.getInputBuffer(input)
}
this.connections.value = new
}
fun getOutputBuffer(name: String) : CArrayPointer<FloatVar>? = connections.value[name]
/* internals below */
private val connections = AtomicReference(mapOf<String, CArrayPointer<FloatVar>>())
private fun getInputBuffer(name: String) : CArrayPointer<FloatVar> = inputs[name] ?: throw IllegalArgumentException("Unknown node input name! (${this::class.simpleName}.$name)");
}
For some reason somewhere in connect
, it throws an error because a map that is supposedly already frozen gets modified, but I don't see where that happens.martmists
07/02/2021, 6:02 PMBig Chungus
07/03/2021, 9:21 PMmartmists
07/03/2021, 10:55 PMvar loop = true
// TODO: Make this compatible with windows
signal(SIGINT, staticCFunction<Int, Unit> {
loop = false
})
while (loop) {
Pa_Sleep(20) // Sleep 20ms
}
io.cleanup()
Pa_Terminate()
martmists
07/04/2021, 11:03 AMmartmists
07/04/2021, 4:10 PMunsigned long
is a ULong, but on windows it's parsed as UInt
martmists
07/05/2021, 7:13 AMneugartf
07/05/2021, 5:22 PMClocks
07/06/2021, 4:12 AMKarel Petránek
07/06/2021, 2:44 PMMatthias Geisler
07/07/2021, 6:45 PMNSData *nsdataFromBase64String = [[NSData alloc]initWithBase64EncodedString:base64Encoded options:0];
into Kotlin? I understand what the function wants...but I do not catch the [NSData alloc]
to write in Kotlin. Anybody here maybe knows that?Big Chungus
07/07/2021, 9:56 PMmemScoped { val result = alloc<T>() }
, but with that the pointer is gone as soon as memScoped returns and I neet to keep reference to that pointer afer it treturns.ankushg
07/07/2021, 10:51 PM./gradlew iosX64Test
on 1.5.10, everything passes
When I run ./gradlew iosX64Test
on 1.5.20, tests for one specific module are consistently giving me a segfault, both on my local machine and on CI (see thread for output)
No other changes besides the version number.
Any likely-culprit known issues in 1.5.20 that would cause this that I could follow on YT?
Any tips on how to track down the issue or work around it?scavenger5
07/08/2021, 9:01 PMBig Chungus
07/09/2021, 10:13 AMBig Chungus
07/09/2021, 12:50 PMException in thread "main" java.lang.IllegalStateException: Resolved classifier platform/posix/__darwin_size_t of type TypeAlias. Expected: Class.
Any tips?ribesg
07/09/2021, 1:58 PMMpp
, which compiles into a Framework.
I have this data class in the Mpp
project:
data class Event(
// …
val publicName: String?,
// …
) {
// …
val hasPublicName: Boolean
get() = !publicName.isNullOrBlank()
}
Somewhere in Swift, I have this:
func configure(_ event: Event) {
if event.hasPublicName {
eventTypeLabel.isHidden = true
locationView.isHidden = true
publicNameLabel.isHidden = false
publicNameLabel.text = event.publicName
// …
I didn’t change any of these files, but I now get this error (worked in 1.4.10):
2021-07-09 15:46:41.834833+0200 MyApp[25797:9497146] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MppEvent hasPublicName]: unrecognized selector sent to instance 0x600001ae5650'
Maybe I broke something in the way the project is built, but I don’t know what. I don’t know what could cause this. I also tried to replace event.hasPublicName
in Swift with event.publicName != nil
but then it crashes the same way but on publicName
.
I’m tweaking the XCode project a lot, and now I don’t know what could cause this?Big Chungus
07/09/2021, 8:40 PM./gradlew build
is a bit too fat for my use case.