Thomas
10/18/2019, 8:49 PMkDTLSProtocol12
from Kotlin/Native? I am able to find kDTLSProtocol1
, but I really need kDTLSProtocol12
.
This one is visible: https://developer.apple.com/documentation/security/sslprotocol/kdtlsprotocol1?language=objc
This one is NOT visible: https://developer.apple.com/documentation/security/sslprotocol/kdtlsprotocol12?language=objcFudge
10/19/2019, 9:30 AMMarcin Wisniowski
10/19/2019, 4:10 PMkotlinx-coroutines-core-native
dependency, but I am not sure how to do that. The build.gradle
file Idea generated for me along with the project does not have a dependencies
section, and if I create my own I get an error Could not find method implementation()
when running Gradle sync. What's the correct way to add the dependency? I looked at the Kotlin/Native coroutines example project and it does not have the dependency in it's build.gradle
so I'm not sure how it works. This is probably a stupid issue but I can't find any information on using coroutines in Kotlin/Native, except in the context of mobile development and compatibility with iOS, while my project is just a plain simple command line program.adev_one
10/20/2019, 8:15 PMSome Kotlin/Native targets cannot be built on this linux_x64 machine and are disabled:
* In project ':summer':
* targets 'iosArm64', 'iosX64' (can be built with a macos_x64 host)
To hide this message, add 'kotlin.native.ignoreDisabledTargets=true' to the Gradle properties.
on build.
Can I configure jitpack to build K/N in another way or which service should I use to publish K/N artifacts?XQDD
10/21/2019, 9:38 AMAndy Gibel
10/21/2019, 7:51 PMSujit
10/21/2019, 8:17 PMimplementation()
on gradle, how does it resolve the architecture to download? Currently I have a publication on maven, but I'm also uploading the .klib
. Is there a way to avoid that so that I won't have to upload separate publications for all the hardwares I want to support? I'm sorry this is like a long multi-question question, but I've been wrecking my brain trying to make this work... Help please.Prateek Grover
10/22/2019, 11:51 AMlouiscad
10/22/2019, 7:51 PMMarc Reichelt
10/24/2019, 10:02 AMlouiscad
10/24/2019, 10:09 AMS Korebrits
10/24/2019, 2:07 PMS Korebrits
10/24/2019, 2:08 PMThomas
10/24/2019, 7:59 PMimport UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let layer = createGradient()
layer.frame = self.view.bounds
self.view.layer.addSublayer(layer)
}
func createGradient() -> CAGradientLayer {
let layer = CAGradientLayer()
layer.type = kCAGradientLayerAxial
layer.colors = [UIColor.red.cgColor, UIColor.blue.cgColor]
return layer
}
}
I would like to convert the createGradient function to Kotlin. This is what I have tried:
import platform.QuartzCore.CAGradientLayer
import platform.QuartzCore.kCAGradientLayerAxial
import platform.UIKit.UIColor
fun createGradient(): CAGradientLayer {
val layer = CAGradientLayer()
layer.type = kCAGradientLayerAxial
layer.colors = listOf(UIColor.redColor.CGColor, UIColor.blueColor.CGColor)
return layer
}
When using this function the layer just doesn’t appear on the screen. As if it is completely transparent. I think something could be going wrong with the colors. Could anyone here help me out?Marc Reichelt
10/25/2019, 5:17 PMld: warning: ignoring file .../debugFramework/SharedCode.framework/SharedCode, building for iOS-arm64 but attempting to link with file built for iOS Simulator-x86_64
And indeed the debug framework only contains x86_64. I followed the tutorial on https://play.kotlinlang.org/hands-on/Targeting%20iOS%20and%20Android%20with%20Kotlin%20Multiplatform/01_Introduction
Is there a way to build a debug framework containing both architectures (i.e. a ‘fat framework’)?Marcin Wisniowski
10/26/2019, 6:01 PMLock
class to act as a mutex, for my pthread
using code. Is there any example of that? I tried to do it like ktor: https://github.com/ktorio/ktor/blob/master/ktor-utils/posix/src/io/ktor/util/LockNative.kt but it calls functions like ktor_mutex_create
whose implementation I cannot find. This is my current implementation: https://pastebin.com/THbMhiqD but I'm not sure it's correct. It clearly does something right because my threads don't immediately fail now when I lock with it, but I still get Segmentation Faults sometimes and I think it may be due to my Lock implementation.Andy Gibel
10/27/2019, 2:43 AMjimn
10/27/2019, 9:31 AMFudge
10/27/2019, 12:34 PMlouiscad
10/28/2019, 10:10 AMallTests
Gradle task Kotlin/Native only?alexcouch
10/28/2019, 8:31 PMMarc Reichelt
10/29/2019, 8:18 PMSharedCode
framework, but he got a crash with EXC_BAD_ACCESS. So what happened here? It looks like a bug in coroutines, but I don’t know.
How do we debug crashes like this, and most importantly: how do we fix it?andreasmattsson
10/30/2019, 10:56 AMprintln("State Test")
println("State Random inherited instance val 1: ${StateTest.InheritingSingleton.randomInstanceVal}")
println("State Random inherited instance val 2: ${StateTest.InheritingSingleton.randomInstanceVal}")
println("State Random inherited instance lazy 1: ${StateTest.InheritingSingleton.randomInstanceLazy}")
println("State Random inherited instance lazy 2: ${StateTest.InheritingSingleton.randomInstanceLazy}")
println("State Random file val 1: ${StateTest.InheritingSingleton.randomFileLevelVal}")
println("State Random file val 2: ${StateTest.InheritingSingleton.randomFileLevelVal}")
println("State Random file lazy 1: ${StateTest.InheritingSingleton.randomFileLevelLazy}")
println("State Random file lazy 2: ${StateTest.InheritingSingleton.randomFileLevelLazy}")
println("State Random independent val 1: ${StateTest.IndependentSingleton.randomSingletonSimple}")
println("State Random independent val 2: ${StateTest.IndependentSingleton.randomSingletonSimple}")
println("State Random independent lazy 1: ${StateTest.IndependentSingleton.randomSingletonLazy}")
println("State Random independent lazy 2: ${StateTest.IndependentSingleton.randomSingletonLazy}")
Called on iOS like (Swift - calling multiplatform library included as Cocoapod):
print("State Test")
print("State Random inherited instance val 1: \(StateTest.InheritingSingleton().randomInstanceVal)")
print("State Random inherited instance val 2: \(StateTest.InheritingSingleton().randomInstanceVal)")
print("State Random inherited instance lazy 1: \(StateTest.InheritingSingleton().randomInstanceLazy)")
print("State Random inherited instance lazy 2: \(StateTest.InheritingSingleton().randomInstanceLazy)")
print("State Random file val 1: \(StateTest.InheritingSingleton().randomFileLevelVal)")
print("State Random file val 2: \(StateTest.InheritingSingleton().randomFileLevelVal)")
print("State Random file lazy 1: \(StateTest.InheritingSingleton().randomFileLevelLazy)")
print("State Random file lazy 2: \(StateTest.InheritingSingleton().randomFileLevelLazy)")
print("State Random independent val 1: \(StateTest.IndependentSingleton().randomSingletonSimple)")
print("State Random independent val 2: \(StateTest.IndependentSingleton().randomSingletonSimple)")
print("State Random independent lazy 1: \(StateTest.IndependentSingleton().randomSingletonLazy)")
print("State Random independent lazy 2: \(StateTest.IndependentSingleton().randomSingletonLazy)")
Output on JVM:
State Test
StateTest init
StateTest.InheritingSingleton init
State Random inherited instance val 1: -14155247
State Random inherited instance val 2: -14155247
State Random inherited instance lazy 1: -1793673803
State Random inherited instance lazy 2: -1793673803
State Random file val 1: -483920171
State Random file val 2: -483920171
State Random file lazy 1: -1570839155
State Random file lazy 2: -1570839155
StateTest.IndependentSingleton init
State Random independent val 1: -883005959
State Random independent val 2: -883005959
State Random independent lazy 1: -1287948357
State Random independent lazy 2: -1287948357
Output on iOS:
State Test
StateTest init
State Random inherited instance val 1: 137897944
StateTest init
State Random inherited instance val 2: -1206959235
StateTest init
State Random inherited instance lazy 1: -695365290
StateTest init
State Random inherited instance lazy 2: 1274463100
StateTest init
State Random file val 1: -525097753
StateTest init
State Random file val 2: -525097753
StateTest init
State Random file lazy 1: -549146703
StateTest init
State Random file lazy 2: -549146703
StateTest.IndependentSingleton init
State Random independent val 1: 1573861028
State Random independent val 2: 1573861028
State Random independent lazy 1: -1005578215
State Random independent lazy 2: -1005578215
Kris Wong
10/30/2019, 8:00 PMexecute
?Prateek Grover
10/31/2019, 11:15 AMNico Buescher
10/31/2019, 5:34 PM-g
flag in CLI, but that doesn't help me with CLion. Thanks for any help.Andy Gibel
10/31/2019, 6:20 PMProduce native binaries directly from klibs, speeds up large project compilation (GH-3246)
What does this mean exactly? What was the limitation in 1.3.50?César
11/01/2019, 2:18 PMAdam Lusch
11/01/2019, 4:40 PMFoo
that has an api
dependency on Bar
, which as I understand it should export its symbols to consumers. However, the generated header only contains types from Bar
that are referenced in the public API of Foo
, and even then only as opaque pointers with no vtables.
Is there a way to include the entire public API of Bar
so that clients using the C API can make full use of Bar
objects returned from Foo
? This seems similar to the export
setting on framework
builds for iOS, but I didn't see anything similar for sharedLib
. Thanks!Qinghua
11/03/2019, 4:20 AMshared singleton
between threads like iOS native sharedInstance
behaviour ?
I have read [CONCURRENCY.md](https://github.com/JetBrains/kotlin-native/blob/master/CONCURRENCY.md) and [IMMUTABILITY.md](https://github.com/JetBrains/kotlin-native/blob/master/IMMUTABILITY.md).
However @threadLocal
annotation can not share states between threads, but shared instance
in iOS domain means it shared states in all threads.Qinghua
11/03/2019, 4:20 AMshared singleton
between threads like iOS native sharedInstance
behaviour ?
I have read [CONCURRENCY.md](https://github.com/JetBrains/kotlin-native/blob/master/CONCURRENCY.md) and [IMMUTABILITY.md](https://github.com/JetBrains/kotlin-native/blob/master/IMMUTABILITY.md).
However @threadLocal
annotation can not share states between threads, but shared instance
in iOS domain means it shared states in all threads.kpgalligan
11/03/2019, 4:59 AMQinghua
11/03/2019, 5:37 AMstately
library, it looks like the only way is that using Atomics
to implement a CopyOnWrite
data structure to share between threads. However, in iOS native solution is that using NSMutableArray/NSMutableXXX
to share states with GCD avoiding data-race problem. The former CopyOnWrite
solution which means more extra copy and lock/unlock operations maybe have performance issue ?kpgalligan
11/03/2019, 7:28 AMQinghua
11/03/2019, 8:29 AMworker
support sync pull mechanism like dispatch_sync
?olonho
11/03/2019, 12:51 PM