Reto Mayer
01/28/2023, 11:07 AMCPointerVarOf<COpaquePointer>(nativePtr)
gives me this Exception: Native interop types constructors must not be called directly
I need a CValueRef<*> for memcpyspierce7
01/28/2023, 9:37 PMKrystian
01/28/2023, 11:37 PMspierce7
01/29/2023, 6:15 AMPeter Hsu
01/30/2023, 8:26 AMAdam S
01/30/2023, 10:37 AM.konan
dir on CI/CD, so I can use the packaged gcc
and g++
to build a library . Is there a konan
command line option, or a Gradle task, that I can use that will download and setup the .konan
dir? Ideally without needing to compile some Kotlin source code.Stanislav Radchenko
01/31/2023, 5:35 AMAdam S
02/01/2023, 12:24 AM./konan/dependencies/msys2-mingw-w64-x86_64-2/bin
I see
• cc.exe
• gcc.exe
• x86_64-w64-mingw32-gcc-9.2.0.exe
• x86_64-w64-mingw32-gcc.exe
Is there any difference between them? Which should I use? They all have the same size (2140265).spierce7
02/01/2023, 5:16 AM• Google is working on a new memory allocator that should improve runtime performance as well as memory consumption. This important work also opens a path to further optimizations.Google is implementing the memory allocator for Kotlin/native? I mean - if that's what's happening, that's awesome, I'm just trying to make sure I'm understanding this correctly.
Raed Ghazal
02/01/2023, 2:57 PMfun foo(default: Int, a: Int = default) {
//todo
}
//good case
foo(a = 5)
foo(default = 5)
//compilation error "at least one of the attributes should be provided"
foo()
Paddy O'Brien
02/02/2023, 5:15 PMlanguage = Objective-C
package = StripeTerminal
compilerOpts = -framework StripeTerminal -DNS_FORMAT_ARGUMENT(A)= -D_Nullable_result=_Nullable
linkerOpts = -framework StripeTerminal -framework CoreBluetooth -framework ExternalAccessory -framework CoreLocation -framework Security -framework Foundation
# M1 Simulator
compilerOpts.ios_simulator_arm64 = -FiOSLibs/StripeTerminal.xcframework/ios-arm64_x86_64-simulator/StripeTerminal.framework
linkerOpts.ios_simulator_arm64 = -FiOSLibs/StripeTerminal.xcframework/ios-arm64_x86_64-simulator/StripeTerminal.framework
# X86 Simulator
compilerOpts.ios_x64 = -FiOSLibs/StripeTerminal.xcframework/ios-arm64_x86_64-simulator/StripeTerminal.framework
linkerOpts.ios_x64 = -FiOSLibs/StripeTerminal.xcframework/ios-arm64_x86_64-simulator/StripeTerminal.framework
# Device
compilerOpts.ios_arm64 = -FiOSLibs/StripeTerminal.xcframework/ios-arm64/StripeTerminal.framework
linkerOpts.ios_arm64 = -FiOSLibs/StripeTerminal.xcframework/ios-arm64/StripeTerminal.framework
Piasy
02/04/2023, 3:59 AMerror: LIBCMT.lib(std_type_info_static.obj): machine type x86 conflicts with x64
.
I didn’t specify the LIBCMT.lib dependency anywhere in my build scripts, so it seems like a bug in the konan toolchain, which uses the wrong x86 version of LIBCMT.lib instead of x64 version, could anybody help me take a look into it? thanks!
The attachment is my minimum reproduce project, run the runDebugExecutableNative
gradle task could reproduce it.
The C++ code static library is built by the build_xlog_windows.bat
batch script.
BTW, I’m using the latest 1.8.0 kotlin version, but I also tried 1.7.21, which also didn’t work.
C:\Users\Admin\source\kmp-windows-x64-repro>.\gradlew runDebugExecutableNative
> Task :linkDebugExecutableNative FAILED
e: C:\Users\Admin\.konan\dependencies\llvm-11.1.0-windows-x64-essentials/bin/clang++ invocation reported errors
The C:\Users\Admin\.konan\dependencies\llvm-11.1.0-windows-x64-essentials/bin/clang++ command returned non-zero exit code: 1.
output:
lld-link: error: LIBCMT.lib(std_type_info_static.obj): machine type x86 conflicts with x64
lld-link: error: LIBCMT.lib(delete_scalar_size.obj): machine type x86 conflicts with x64
lld-link: error: LIBCMT.lib(delete_scalar.obj): machine type x86 conflicts with x64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
FAILURE: Build failed with an exception.
tad
02/04/2023, 10:39 PMOleg Yukhnevich
02/07/2023, 2:40 PMfun EVP_MAC_CTX_set_params(ctx: CValuesRef<EVP_MAC_CTX>?, params: CValuesRef<OSSL_PARAM>?): <http://kotlin.Int|kotlin.Int>
(params is a reference to an array)
example of usage in C is here https://www.openssl.org/docs/man3.0/man3/EVP_MAC_init.html (in the end of the page).
I’ve tried to something like this, and it compiles and works without errors on runtime, but looks like it doesn’t work as expected, as those params
are not visible by `openssl`…
val mac = EVP_MAC_fetch(null, "HMAC", null)
val context = EVP_MAC_CTX_new(mac)
val params = allocArrayOf(
OSSL_PARAM_construct_utf8_string("digest", "SHA256".cstr, 0).ptr,
OSSL_PARAM_construct_end().ptr
)
check(EVP_MAC_CTX_set_params(context, params[0]) == 1) // works, returns 1
check(EVP_MAC_CTX_get_mac_size(context) > 0) // fails, but should not
The error is error:0300009F:digital envelope routines::message digest is null
- so looks like it don’t see digest
key in params
array for some reason
Where I could dig to understand what I do wrong? Thx in advance! 🙂Jeff Lockhart
02/08/2023, 3:34 AMkotlin.native.binary.sourceInfoType=libbacktrace
be enabled for Linux and Apple targets, but disabled for Windows, since it doesn't work for MinGW?hfhbd
02/08/2023, 8:18 PMKathrin Petrova
02/10/2023, 1:13 PMFederico Torres
02/10/2023, 3:36 PMfun foo(map: Map<String, SomeDataClass?>)
When I try to use it from Swift, SomeDataClass?
has the type Any
:
func foo(map: [String: Any])
which forces me to downcastDalinar
02/13/2023, 12:38 PMLandry Norris
02/13/2023, 8:06 PMVinod Rai
02/14/2023, 8:03 AMMoussa
02/15/2023, 2:37 PMlinkPodDebugFrameworkIosFat
gives me
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/moussa/Desktop/MoussaWork/Companies/IOHK/atala-prism-apollo/base-asymmetric-encryption/build/bin/iosArm64/podDebugFramework/ApolloBaseAsymmetricEncryption.framework/ApolloBaseAsymmetricEncryption and /Users/moussa/Desktop/MoussaWork/Companies/IOHK/atala-prism-apollo/base-asymmetric-encryption/build/bin/iosX64/podDebugFramework/ApolloBaseAsymmetricEncryption.framework/ApolloBaseAsymmetricEncryption have the same architectures (arm64) and can't be in the same fat output file
Error simplified, iosArm64
& iosX64
have the same architectures (arm64) and can’t be in the same fat output file. How do I investigate this error or at least try to figure out the root cause of that issue?
Notes:
• Using the iOS new hierarchy only ios()
Mark Lurie
02/15/2023, 3:23 PMprivate val _invoiceIntroFlowState: MutableStateFlow<InvoiceIntroFlowState> = MutableStateFlow(InvoiceIntroFlowState(customizationData = InvoiceCustomizationResponseEntity()))
val invoiceIntroFlowState: StateFlow<InvoiceIntroFlowState> = _invoiceIntroFlowState.asStateFlow()
data class InvoiceIntroFlowState(
val uiStatus: UiStatus = UiStatus.NONE,
val error: Failure? = null,
val customizationData: InvoiceCustomizationResponseEntity
)
Any attempt to do any kind of deep-copy that i know doesn’t work for me to trigger the new state event:
_invoiceIntroFlowState.update { currentState ->
currentState.copy(
customizationData = currentState.customizationData.copy(
logos = another //updatedLogos.map { it.copy() }
)
)
}
Any help will be highly appreciatedEdward Muller
02/18/2023, 8:09 PMEdward Muller
02/18/2023, 8:10 PMMach-O 64-bit executable arm64
Edward Muller
02/18/2023, 8:11 PM(KonanProperies) Downloading dependency: <https://download.jetbrains.com/kotlin/native/apple-llvm-20200714-macos-x64-essentials.tar.gz> (0/94217229).
Landry Norris
02/18/2023, 10:57 PMMitchell Syer
02/22/2023, 3:23 PMJoakim Forslund
02/23/2023, 1:16 PMLandry Norris
02/24/2023, 3:01 PM