Skip to content

Commit f279c81

Browse files
committed
Stepdown Kotlin version, including other Kotlin libraries in order to support native macOS.
Current version is blocked by https://youtrack.jetbrains.com/issue/KT-73672/Bump-KLIB-ABI-version-in-2.2.0
1 parent 81da98d commit f279c81

8 files changed

Lines changed: 30 additions & 8 deletions

File tree

core/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ kotlin {
2424
iosArm64()
2525
iosSimulatorArm64()
2626
wasmJs().nodejs()
27+
macosX64 ()
28+
linuxX64 ()
29+
2730

2831
sourceSets {
2932
val commonMain by getting {

core/src/iosMain/kotlin/sk/ai/net/performance/Measure.ios.kt renamed to core/src/appleMain/kotlin/sk/ai/net/performance/Measure.apple.kt

File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package sk.ai.net.performance
22

3-
actual fun currentMillis(): Long = System.currentTimeMillis()
3+
actual fun currentMillis(): Long = System.currentTimeMillis()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package sk.ai.net.performance
2+
3+
import kotlinx.cinterop.ExperimentalForeignApi
4+
import kotlinx.cinterop.alloc
5+
import kotlinx.cinterop.memScoped
6+
import kotlinx.cinterop.ptr
7+
import platform.posix.gettimeofday
8+
import platform.posix.timeval
9+
10+
@OptIn(ExperimentalForeignApi::class)
11+
actual fun currentMillis(): Long = memScoped {
12+
val tv = alloc<timeval>()
13+
gettimeofday(tv.ptr, null)
14+
tv.tv_sec * 1000L + tv.tv_usec / 1000L
15+
}
16+

gguf/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ kotlin {
2323
iosArm64()
2424
iosSimulatorArm64()
2525
wasmJs().nodejs()
26+
macosX64 ()
27+
linuxX64 ()
28+
2629

2730
sourceSets {
2831
val commonMain by getting {

gguf/src/commonMain/kotlin/sk/ai/net/gguf/GGUFReader.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package sk.ai.net.gguf
22

3-
import kotlinx.io.Buffer
43
import kotlinx.io.Source
54
import kotlinx.io.readByteArray
65
import sk.ai.net.gguf.utils.Endian
@@ -53,7 +52,7 @@ data class FieldParts(
5352
)
5453

5554
@OptIn(ExperimentalUnsignedTypes::class)
56-
class GGUFReader(bufferedSource: Source) {
55+
class GGUFReader(source: Source) {
5756
// Properties
5857
var byteOrder: Char = 'I' // 'I' - same as host, 'S' - swapped
5958
var alignment: Int = GGUF_DEFAULT_ALIGNMENT
@@ -81,7 +80,7 @@ class GGUFReader(bufferedSource: Source) {
8180
)
8281

8382
init {
84-
data = bufferedSource.readByteArray()
83+
data = source.readByteArray()
8584

8685
checkGGUFMagicNumber().then {
8786
checkGGUFVersion().then {

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[versions]
2-
agp = "8.7.3"
3-
kotlin = "2.1.0"
2+
agp = "8.7.2"
3+
kotlin = "2.0.21"
44
kotlinx-coroutines = "1.10.1"
55
android-minSdk = "24"
66
android-compileSdk = "35"
7-
kotlinxSerializationJson = "1.8.0"
7+
kotlinxSerializationJson = "1.7.3"
88
nexus-publish = "2.0.0"
99
jetbrainsKotlinJvm = "1.9.22"
1010
testng = "7.10.2"

io/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ kotlin {
2525
iosArm64()
2626
iosSimulatorArm64()
2727
wasmJs().nodejs()
28-
28+
macosX64 ()
29+
linuxX64 ()
2930

3031
sourceSets {
3132
val commonMain by getting {

0 commit comments

Comments
 (0)