Brian Donovan
10/29/2021, 2:32 AMmbonnin
10/29/2021, 5:33 PMtest.kexe
binary?ankushg
10/29/2021, 5:38 PMBy default, Kotlin/Native compiler producesBut the docs for building XCFrameworks only mention dSYMs for the debug task Digging in deeper, the source forfor release (i.e. optimized) binaries on Darwin platforms.dSYM
XCFrameworkTask
seems to only check for dSYM
files for debug builds.tunedal
10/29/2021, 6:59 PMgcc -ldl -lm -lpthread -lstdc++ hello-kt.c libuntitled.a
, but that fails due to various undefined symbols such as std::chrono::_V2::steady_clock::now()
and __cpu_model
.吴少滨
11/03/2021, 7:16 AMmbonnin
11/03/2021, 3:19 PMmacosArm64
, iosArm64
, watchosArm64
, watchosSimulatorArm64
, tvosArm64
, tvosX64
, tvosSimulatorArm64
, ...) our CI build times took a 40min hit 😕 . Is there any chance the compiler could optimize "something" down there as from the distance it looks like it's doing the same thing over and over again?mbonnin
11/03/2021, 3:25 PMiOSArm64
and iOSSimulatorArm64
? Could they somehow be merged as the instruction sets are the same? Or are the APIs different somehow?Justin
11/03/2021, 7:02 PMiosx64
• iosArm64
• iosSimulatorArm64
• macosX64
• macosArm64
...you can use these tasks to generate an XCFramework that works for all of them.
XCFramework.kts
The only 'official' Apple documentation on how to create such a framework (at least that I could find) is in an Apple forums post, so hopefully sharing this will (a) save other people time, and (b) lead to improvements on my amateurish gradle code!Miroslav Sobotka
11/03/2021, 9:33 PMLDAP *ld
and then
ldap_initialize(&ld, ...
ldap_set_option(ld, ...
How to properly implement this? Thanks!Laurent Laborde
11/04/2021, 3:43 PMLukellmann
11/05/2021, 6:29 PMIs there already some sort of documentation/specification for K/N's new experimental memory model? I'm thinking of something similar to https://docs.oracle.com/javase/specs/jls/se17/html/jls-17.htmlIn particular I'm looking for some kind of volatile/acquire/release semantics
jimn
11/07/2021, 8:39 PM#!c
typedef struct request {
int event_type;
int iovec_count;
int client_socket;
struct iovec iov[];// <--- this
};
in 1.5.31 this has no members, presumably silently errors during generation. in 1.6.0-RC it gains four members
#!kotlin
@kotlinx.cinterop.internal.CStruct public final class request 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 var client_socket: <http://kotlin.Int|kotlin.Int> /* compiled code */
public final var event_type: <http://kotlin.Int|kotlin.Int> /* compiled code */
public final val iov: kotlinx.cinterop.CArrayPointer<platform.posix.iovec> /* = kotlinx.cinterop.CPointer<platform.posix.iovec> */ /* compiled code */
public final var iovec_count: <http://kotlin.Int|kotlin.Int> /* compiled code */
}
I have been naively porting this source c code using nativeHeap.alloc() and finally come to the part where the code does malloc(request.size+iov.size*6)
the pointer needs to be long lived as this gets passed to the linux kernel and is immediately freed when the kernel returns it.
that said, the goal is using uring with stable kotlin pointers when im done porting the webserver sample, not to preserve c code.
should i stick with a factory method that takes the array size and uses malloc or is there a similar OO snippet somewhere that can get the job done with an aligned flat byte-expanse?KV
11/08/2021, 8:14 AMnatario1
11/08/2021, 10:28 AMWilliam Reed
11/10/2021, 6:39 PMjimn
11/12/2021, 5:08 PM-luring
and shows up as complete in the kotlin/idea compiled cinterop code.
the exe compiles and runs but when it hits the liburing struct definition there should be a static const int size, but instead the exe bails with a cryptic error code. there are a number of glibc/kernel headers which are getting the job done until it gets to this missing constant.Justin
11/13/2021, 7:23 PMMichael Clancy
11/14/2021, 2:00 PMnapperley
11/17/2021, 12:21 AMNewSettings.c_lflag &= ~( ICANON | ECHO );
(C language) to Kotlin, and have hit a brick wall 🧱 with the bit manipulation since there appears to be some bit manipulation operations that can't be done in Kotlin, unless there are some workarounds available. Below is the full C code I am trying to translate into Kotlin:
#include <termios.h>
static struct termios OriginalSettings, NewSettings;
void terminal_setup()
{
tcgetattr(STDIN_FILENO, &OriginalSettings);
NewSettings = OriginalSettings;
NewSettings.c_lflag &= ~( ICANON | ECHO );
tcsetattr(STDIN_FILENO, TCSANOW, &NewSettings);
printf("\e[?25l");
}
void terminal_reset()
{
tcsetattr (STDIN_FILENO, TCSAFLUSH, &OriginalSettings);
}
napperley
11/17/2021, 12:36 AM// ...
private val globalArena = Arena()
private val originalSettings = globalArena.alloc<termios>()
private val newSettings = globalArena.alloc<termios>()
// ...
private fun setupTerminal() {
tcgetattr(STDIN_FILENO, originalSettings.ptr)
newSettings.run {
c_ispeed = originalSettings.c_ispeed
c_ospeed = originalSettings.c_ospeed
c_line = originalSettings.c_line
c_oflag = originalSettings.c_oflag
c_cflag = originalSettings.c_cflag
c_iflag = originalSettings.c_iflag
// ...
}
// ...
}
Marcin Wisniowski
11/17/2021, 10:12 PM.so
library on my target, and copied it back to my development box. I can use library functions and the project compiles, but it fails at linking with: .[..]/.konan/dependencies/arm-unknown-linux-gnueabihf-gcc-8.3.0-glibc-2.19-kernel-4.9-2/arm-unknown-linux-gnueabihf/bin/ld.bfd: src/nativeInterop/cinterop/libpigpio.so: undefined reference to glob@GLIBC_2.27'
It looks like Kotlin/Native is trying to compile with a different version of glibc than I compiled the library with, and it doesn't work. But how do I choose the glibc version in my project?Piotr Krzemiński
11/18/2021, 2:06 PMBrian G
11/18/2021, 5:10 PMfun apiUrl(param: String): String {
return "/v2/$param"
}
Is somehow returning "/v2/kotlin.Unit"
and hitting my server. Anyone seen anything like this?
My code is multiplatform (Android/iOS/JS), but these are only coming from the iOS Kotlin/native version.Clocks
11/18/2021, 5:13 PMgtk-kt
to play video.
(There is audio, but pipewire is being a tad buggy so it is not included)
I made this in under an hour, with a bit of debugging. It's impressively easy to make a GTK video player with Kotlin/Native :Doshai
11/18/2021, 11:04 PMnapperley
11/19/2021, 12:38 AMPaul Woitaschek
11/19/2021, 7:33 AMLuigi Scarminio
11/19/2021, 5:30 PMclass ViewController: UIViewController {
@IBAction func importDatabase(_ sender: UIButton) {
let xmlImporter = AirportXMLImporter(airportDatabaseService: DatabaseService())
(1...5).forEach{ index in
xmlImporter.parseXmlFile(path: Bundle.main.path(forResource: "airports-mundial", ofType: "xml")!)
.subscribe(isThreadLocal: false,
onError: {error in},
onSuccess: {result in }).dispose()
}
}
override func viewDidLoad() {
super.viewDidLoad()
}
}
The XML parser is the AirportXMLImporter. DatabaseService is injected as a persistence layer. DatabaseService is implemented in Swift.Clocks
11/19/2021, 8:28 PMnapperley
11/20/2021, 3:09 AMnapperley
11/20/2021, 3:09 AMnatario1
11/20/2021, 1:31 PMnapperley
11/21/2021, 12:53 AMpackage = frameBuffer
---
#include <linux/fb.h>