From 2ab88acb9fa27c25f4c13d2eee9e5be74577aafe Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 4 Feb 2025 12:40:20 -0500 Subject: [PATCH 01/14] Add CRT logger implementation --- runtime/build.gradle.kts | 2 +- .../logging-crt/build.gradle.kts | 27 ++++++++++ .../logging/crt/CrtLogRecordBuilder.kt | 49 +++++++++++++++++++ .../telemetry/logging/crt/CrtLogger.kt | 41 ++++++++++++++++ .../logging/crt/CrtLoggerProvider.kt | 15 ++++++ .../logging-slf4j2/build.gradle.kts | 2 +- .../telemetry-defaults/build.gradle.kts | 6 +++ .../logging/DefaultLoggerProviderNative.kt | 4 +- .../http/engine/DefaultHttpEngineNative.kt | 5 +- settings.gradle.kts | 1 + 10 files changed, 147 insertions(+), 5 deletions(-) create mode 100644 runtime/observability/logging-crt/build.gradle.kts create mode 100644 runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt create mode 100644 runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt create mode 100644 runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLoggerProvider.kt diff --git a/runtime/build.gradle.kts b/runtime/build.gradle.kts index 2ff2032916..237a65ab26 100644 --- a/runtime/build.gradle.kts +++ b/runtime/build.gradle.kts @@ -61,7 +61,7 @@ subprojects { } } - named("jvmTest") { + findByName("jvmTest")?.run { dependencies { implementation(libraries.kotlinx.coroutines.debug) implementation(libraries.kotest.assertions.core.jvm) diff --git a/runtime/observability/logging-crt/build.gradle.kts b/runtime/observability/logging-crt/build.gradle.kts new file mode 100644 index 0000000000..166c833292 --- /dev/null +++ b/runtime/observability/logging-crt/build.gradle.kts @@ -0,0 +1,27 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +description = "Logging provider based on CRT" +extra["displayName"] = "Smithy :: Kotlin :: Observability :: CRT" +extra["moduleName"] = "aws.smithy.kotlin.runtime.telemetry.logging.crt" + +kotlin { + sourceSets { + commonMain { + dependencies { + api(project(":runtime:observability:telemetry-api")) + } + } + + nativeMain { + dependencies { + api(libs.crt.kotlin) + } + } + + all { + languageSettings.optIn("aws.smithy.kotlin.runtime.InternalApi") + } + } +} diff --git a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt new file mode 100644 index 0000000000..e0c6e39cf6 --- /dev/null +++ b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt @@ -0,0 +1,49 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package aws.smithy.kotlin.runtime.telemetry.logging.crt + +import aws.smithy.kotlin.runtime.telemetry.logging.LogLevel +import aws.smithy.kotlin.runtime.telemetry.logging.LogRecordBuilder +import aws.smithy.kotlin.runtime.telemetry.logging.MessageSupplier + +public class CrtLogRecordBuilder( + private val delegate: CrtLogger, + private val level: LogLevel +) : LogRecordBuilder { + private var cause: Throwable? = null + private var msg: (() -> String)? = null + private val kvp by lazy { mutableMapOf() } + + override fun setCause(ex: Throwable) { + cause = ex + } + + override fun setMessage(message: String) { + msg = { message } + } + + override fun setMessage(message: MessageSupplier) { + msg = message + } + + override fun setKeyValuePair(key: String, value: Any) { + kvp[key] = value + } + + override fun emit() { + val message = requireNotNull(msg) { "no message provided to LogRecordBuilder" } + + val logMethod = when(level) { + LogLevel.Trace -> delegate::trace + LogLevel.Debug -> delegate::debug + LogLevel.Info -> delegate::info + LogLevel.Warning -> delegate::warn + LogLevel.Error -> delegate::error + } + + logMethod(cause, message) + } +} \ No newline at end of file diff --git a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt new file mode 100644 index 0000000000..f36a326b2b --- /dev/null +++ b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt @@ -0,0 +1,41 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package aws.smithy.kotlin.runtime.telemetry.logging.crt + +import aws.sdk.kotlin.crt.WithCrt +import aws.sdk.kotlin.crt.log +import aws.smithy.kotlin.runtime.telemetry.logging.LogLevel +import aws.smithy.kotlin.runtime.telemetry.logging.LogRecordBuilder +import aws.smithy.kotlin.runtime.telemetry.logging.Logger +import aws.smithy.kotlin.runtime.telemetry.logging.MessageSupplier +import aws.sdk.kotlin.crt.Config as CrtConfig +import aws.sdk.kotlin.crt.LogLevel as CrtLogLevel + +public class CrtLogger(public val name: String, public val config: CrtConfig) : Logger, WithCrt() { + override fun trace(t: Throwable?, msg: MessageSupplier) { + log(CrtLogLevel.Trace, msg()) + } + + override fun debug(t: Throwable?, msg: MessageSupplier) { + log(CrtLogLevel.Debug, msg()) + } + + override fun info(t: Throwable?, msg: MessageSupplier) { + log(CrtLogLevel.Info, msg()) + } + + override fun warn(t: Throwable?, msg: MessageSupplier) { + log(CrtLogLevel.Warn, msg()) + } + + override fun error(t: Throwable?, msg: MessageSupplier) { + log(CrtLogLevel.Error, msg()) + } + + override fun isEnabledFor(level: LogLevel): Boolean = config.logLevel.ordinal >= level.ordinal + + override fun atLevel(level: LogLevel): LogRecordBuilder = CrtLogRecordBuilder(this, level) +} diff --git a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLoggerProvider.kt b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLoggerProvider.kt new file mode 100644 index 0000000000..fb415df074 --- /dev/null +++ b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLoggerProvider.kt @@ -0,0 +1,15 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package aws.smithy.kotlin.runtime.telemetry.logging.crt + +import aws.sdk.kotlin.crt.Config as CrtConfig +import aws.smithy.kotlin.runtime.telemetry.logging.* + +public class CrtLoggerProvider : LoggerProvider { + override fun getOrCreateLogger(name: String): Logger = CrtLogger(name, CrtConfig()) + public fun getOrCreateLogger(name: String, config: CrtConfig): Logger = CrtLogger(name, config) +} + diff --git a/runtime/observability/logging-slf4j2/build.gradle.kts b/runtime/observability/logging-slf4j2/build.gradle.kts index 2fd9ad4c70..1f2bd3ad69 100644 --- a/runtime/observability/logging-slf4j2/build.gradle.kts +++ b/runtime/observability/logging-slf4j2/build.gradle.kts @@ -4,7 +4,7 @@ */ description = "Logging provider based on SLF4J" extra["displayName"] = "Smithy :: Kotlin :: Observability :: SLF4J binding" -extra["moduleName"] = "aws.smithy.kotlin.runtime.telemetry" +extra["moduleName"] = "aws.smithy.kotlin.runtime.telemetry.slf4j" kotlin { sourceSets { diff --git a/runtime/observability/telemetry-defaults/build.gradle.kts b/runtime/observability/telemetry-defaults/build.gradle.kts index e77655c91d..357b11d80e 100644 --- a/runtime/observability/telemetry-defaults/build.gradle.kts +++ b/runtime/observability/telemetry-defaults/build.gradle.kts @@ -24,6 +24,12 @@ kotlin { } } + nativeMain { + dependencies { + implementation(project(":runtime:observability:logging-crt")) + } + } + all { languageSettings.optIn("aws.smithy.kotlin.runtime.InternalApi") } diff --git a/runtime/observability/telemetry-defaults/native/src/aws/smithy/kotlin/runtime/telemetry/logging/DefaultLoggerProviderNative.kt b/runtime/observability/telemetry-defaults/native/src/aws/smithy/kotlin/runtime/telemetry/logging/DefaultLoggerProviderNative.kt index 1d8bec0441..506d10869d 100644 --- a/runtime/observability/telemetry-defaults/native/src/aws/smithy/kotlin/runtime/telemetry/logging/DefaultLoggerProviderNative.kt +++ b/runtime/observability/telemetry-defaults/native/src/aws/smithy/kotlin/runtime/telemetry/logging/DefaultLoggerProviderNative.kt @@ -5,4 +5,6 @@ package aws.smithy.kotlin.runtime.telemetry.logging -internal actual val DefaultLoggerProvider: LoggerProvider = TODO("Not yet implemented") +import aws.smithy.kotlin.runtime.telemetry.logging.crt.CrtLoggerProvider + +internal actual val DefaultLoggerProvider: LoggerProvider = CrtLoggerProvider() diff --git a/runtime/protocol/http-client-engines/http-client-engine-default/native/src/aws/smithy/kotlin/runtime/http/engine/DefaultHttpEngineNative.kt b/runtime/protocol/http-client-engines/http-client-engine-default/native/src/aws/smithy/kotlin/runtime/http/engine/DefaultHttpEngineNative.kt index d9d060337f..6c0a4af219 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-default/native/src/aws/smithy/kotlin/runtime/http/engine/DefaultHttpEngineNative.kt +++ b/runtime/protocol/http-client-engines/http-client-engine-default/native/src/aws/smithy/kotlin/runtime/http/engine/DefaultHttpEngineNative.kt @@ -5,5 +5,6 @@ package aws.smithy.kotlin.runtime.http.engine -internal actual fun newDefaultHttpEngine(block: (HttpClientEngineConfig.Builder.() -> Unit)?): CloseableHttpClientEngine = - TODO("Not yet implemented") +import aws.smithy.kotlin.runtime.http.engine.crt.CrtHttpEngine + +internal actual fun newDefaultHttpEngine(block: (HttpClientEngineConfig.Builder.() -> Unit)?): CloseableHttpClientEngine = CrtHttpEngine() diff --git a/settings.gradle.kts b/settings.gradle.kts index bfd379d2ec..4d9de3eae7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -75,6 +75,7 @@ include(":runtime:auth:http-auth-api") include(":runtime:auth:http-auth-aws") include(":runtime:auth:identity-api") include(":runtime:crt-util") +include(":runtime:observability:logging-crt") include(":runtime:observability:logging-slf4j2") include(":runtime:observability:telemetry-api") include(":runtime:observability:telemetry-defaults") From cec0017d8b999ac745b401b79301430062c47ca1 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 4 Feb 2025 13:59:53 -0500 Subject: [PATCH 02/14] ktlint --- .../runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt | 6 ++---- .../kotlin/runtime/telemetry/logging/crt/CrtLogger.kt | 4 +++- .../runtime/telemetry/logging/crt/CrtLoggerProvider.kt | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt index e0c6e39cf6..212a8677fc 100644 --- a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt +++ b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt @@ -15,7 +15,6 @@ public class CrtLogRecordBuilder( ) : LogRecordBuilder { private var cause: Throwable? = null private var msg: (() -> String)? = null - private val kvp by lazy { mutableMapOf() } override fun setCause(ex: Throwable) { cause = ex @@ -29,9 +28,8 @@ public class CrtLogRecordBuilder( msg = message } - override fun setKeyValuePair(key: String, value: Any) { - kvp[key] = value - } + // CRT logger does not support setting key-value pairs + override fun setKeyValuePair(key: String, value: Any) { } override fun emit() { val message = requireNotNull(msg) { "no message provided to LogRecordBuilder" } diff --git a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt index f36a326b2b..efa417890e 100644 --- a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt +++ b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt @@ -14,7 +14,9 @@ import aws.smithy.kotlin.runtime.telemetry.logging.MessageSupplier import aws.sdk.kotlin.crt.Config as CrtConfig import aws.sdk.kotlin.crt.LogLevel as CrtLogLevel -public class CrtLogger(public val name: String, public val config: CrtConfig) : Logger, WithCrt() { +public class CrtLogger(public val name: String, public val config: CrtConfig) : + WithCrt(), + Logger { override fun trace(t: Throwable?, msg: MessageSupplier) { log(CrtLogLevel.Trace, msg()) } diff --git a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLoggerProvider.kt b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLoggerProvider.kt index fb415df074..31259e9804 100644 --- a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLoggerProvider.kt +++ b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLoggerProvider.kt @@ -5,11 +5,10 @@ package aws.smithy.kotlin.runtime.telemetry.logging.crt -import aws.sdk.kotlin.crt.Config as CrtConfig import aws.smithy.kotlin.runtime.telemetry.logging.* +import aws.sdk.kotlin.crt.Config as CrtConfig public class CrtLoggerProvider : LoggerProvider { override fun getOrCreateLogger(name: String): Logger = CrtLogger(name, CrtConfig()) public fun getOrCreateLogger(name: String, config: CrtConfig): Logger = CrtLogger(name, config) } - From ea260c170e6b1026c850352766bc1b023d959866 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 4 Feb 2025 15:15:22 -0500 Subject: [PATCH 03/14] Cleanup --- .../telemetry/logging/crt/CrtLogger.kt | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt index efa417890e..1a88eb068b 100644 --- a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt +++ b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt @@ -17,27 +17,11 @@ import aws.sdk.kotlin.crt.LogLevel as CrtLogLevel public class CrtLogger(public val name: String, public val config: CrtConfig) : WithCrt(), Logger { - override fun trace(t: Throwable?, msg: MessageSupplier) { - log(CrtLogLevel.Trace, msg()) - } - - override fun debug(t: Throwable?, msg: MessageSupplier) { - log(CrtLogLevel.Debug, msg()) - } - - override fun info(t: Throwable?, msg: MessageSupplier) { - log(CrtLogLevel.Info, msg()) - } - - override fun warn(t: Throwable?, msg: MessageSupplier) { - log(CrtLogLevel.Warn, msg()) - } - - override fun error(t: Throwable?, msg: MessageSupplier) { - log(CrtLogLevel.Error, msg()) - } - + override fun trace(t: Throwable?, msg: MessageSupplier): Unit = log(CrtLogLevel.Trace, msg()) + override fun debug(t: Throwable?, msg: MessageSupplier): Unit = log(CrtLogLevel.Debug, msg()) + override fun info(t: Throwable?, msg: MessageSupplier): Unit = log(CrtLogLevel.Info, msg()) + override fun warn(t: Throwable?, msg: MessageSupplier): Unit = log(CrtLogLevel.Warn, msg()) + override fun error(t: Throwable?, msg: MessageSupplier): Unit = log(CrtLogLevel.Error, msg()) override fun isEnabledFor(level: LogLevel): Boolean = config.logLevel.ordinal >= level.ordinal - override fun atLevel(level: LogLevel): LogRecordBuilder = CrtLogRecordBuilder(this, level) } From 2cf1bfb6c77770d1613ec58698e2ce769966a230 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 4 Feb 2025 16:10:59 -0500 Subject: [PATCH 04/14] ktlint --- .../runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt index 212a8677fc..67415ed59b 100644 --- a/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt +++ b/runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt @@ -11,7 +11,7 @@ import aws.smithy.kotlin.runtime.telemetry.logging.MessageSupplier public class CrtLogRecordBuilder( private val delegate: CrtLogger, - private val level: LogLevel + private val level: LogLevel, ) : LogRecordBuilder { private var cause: Throwable? = null private var msg: (() -> String)? = null @@ -34,7 +34,7 @@ public class CrtLogRecordBuilder( override fun emit() { val message = requireNotNull(msg) { "no message provided to LogRecordBuilder" } - val logMethod = when(level) { + val logMethod = when (level) { LogLevel.Trace -> delegate::trace LogLevel.Debug -> delegate::debug LogLevel.Info -> delegate::info @@ -44,4 +44,4 @@ public class CrtLogRecordBuilder( logMethod(cause, message) } -} \ No newline at end of file +} From 99c3e73cef123f6a700219de3d45968a2de7a86e Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 12 Mar 2025 10:28:57 -0400 Subject: [PATCH 05/14] Add http-client-engine-crt dependency in nativeMain sourceset --- .../http-client-engine-default/build.gradle.kts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime/protocol/http-client-engines/http-client-engine-default/build.gradle.kts b/runtime/protocol/http-client-engines/http-client-engine-default/build.gradle.kts index d2381c39f0..321be4f532 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-default/build.gradle.kts +++ b/runtime/protocol/http-client-engines/http-client-engine-default/build.gradle.kts @@ -16,19 +16,28 @@ kotlin { implementation(project(":runtime:runtime-core")) } } + jvmMain { dependencies { // okhttp works on both JVM and Android implementation(project(":runtime:protocol:http-client-engines:http-client-engine-okhttp")) } } + jvmTest { dependencies { implementation(project(":runtime:protocol:http-client-engines:http-client-engine-crt")) } } + all { languageSettings.optIn("aws.smithy.kotlin.runtime.InternalApi") } + + nativeMain { + dependencies { + implementation(project(":runtime:protocol:http-client-engines:http-client-engine-crt")) + } + } } } From 3840affedd0138ebdfd333c61dbf2b5c6d893ecc Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 13 Mar 2025 12:43:07 -0400 Subject: [PATCH 06/14] Collapse all dependencies into `nativeMain` --- runtime/observability/logging-crt/build.gradle.kts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/runtime/observability/logging-crt/build.gradle.kts b/runtime/observability/logging-crt/build.gradle.kts index 166c833292..5fc2f44d17 100644 --- a/runtime/observability/logging-crt/build.gradle.kts +++ b/runtime/observability/logging-crt/build.gradle.kts @@ -8,20 +8,12 @@ extra["moduleName"] = "aws.smithy.kotlin.runtime.telemetry.logging.crt" kotlin { sourceSets { - commonMain { - dependencies { - api(project(":runtime:observability:telemetry-api")) - } - } - nativeMain { dependencies { + api(project(":runtime:observability:telemetry-api")) api(libs.crt.kotlin) } - } - all { - languageSettings.optIn("aws.smithy.kotlin.runtime.InternalApi") } } } From 612cbd7341f48bde054d575bf3f5c56633ce3bdd Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 13 Mar 2025 12:50:29 -0400 Subject: [PATCH 07/14] ktlitn --- runtime/observability/logging-crt/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/observability/logging-crt/build.gradle.kts b/runtime/observability/logging-crt/build.gradle.kts index 5fc2f44d17..b59d7b81d8 100644 --- a/runtime/observability/logging-crt/build.gradle.kts +++ b/runtime/observability/logging-crt/build.gradle.kts @@ -13,7 +13,6 @@ kotlin { api(project(":runtime:observability:telemetry-api")) api(libs.crt.kotlin) } - } } } From fe0d0d38c3245b430550d9b00118414ce0dc5124 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Mon, 17 Mar 2025 14:16:38 -0400 Subject: [PATCH 08/14] Try shutting down and erasing all simulators before running simulator tests --- .github/workflows/continuous-integration.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3486c8e707..b16a307fb0 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -67,7 +67,9 @@ jobs: shell: bash run: | # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 - # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties + # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties + /usr/bin/xcrun simctl shutdown all + /usr/bin/xcrun simctl erase all ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build From 027584fca331adb971917fa3ae30a2a7399663bb Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Mon, 17 Mar 2025 15:48:03 -0400 Subject: [PATCH 09/14] Shutdown simulator service --- .github/workflows/continuous-integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b16a307fb0..d17d769688 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -70,6 +70,7 @@ jobs: # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties /usr/bin/xcrun simctl shutdown all /usr/bin/xcrun simctl erase all + killall -9 com.apple.CoreSimulator.CoreSimulatorService ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build From 776fe9ae0e6ea374fbeb64665601b2f53130ece1 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Mon, 17 Mar 2025 15:48:53 -0400 Subject: [PATCH 10/14] list devices --- .github/workflows/continuous-integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d17d769688..589b3e39f5 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -71,6 +71,7 @@ jobs: /usr/bin/xcrun simctl shutdown all /usr/bin/xcrun simctl erase all killall -9 com.apple.CoreSimulator.CoreSimulatorService + xcrun simctl list devices ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build From 7dbdbdba946181a7ffd1094c62badb0af31092b7 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Mon, 17 Mar 2025 17:46:21 -0400 Subject: [PATCH 11/14] Run with iPhone 16 simulator --- .github/workflows/continuous-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 589b3e39f5..358f7cb331 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -72,8 +72,8 @@ jobs: /usr/bin/xcrun simctl erase all killall -9 com.apple.CoreSimulator.CoreSimulatorService xcrun simctl list devices - ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck - ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build + ./gradlew -PiosSimulatorDevice="iPhone 16" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck + ./gradlew -PiosSimulatorDevice="iPhone 16" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build - name: Save Test Reports if: failure() From bbb78fb8ac6e66a07af03b1477faa6598eaaea09 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 18 Mar 2025 10:18:18 -0400 Subject: [PATCH 12/14] Run with iPhone 15 Pro simulator --- .github/workflows/continuous-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 358f7cb331..3f651a5796 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -72,8 +72,8 @@ jobs: /usr/bin/xcrun simctl erase all killall -9 com.apple.CoreSimulator.CoreSimulatorService xcrun simctl list devices - ./gradlew -PiosSimulatorDevice="iPhone 16" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck - ./gradlew -PiosSimulatorDevice="iPhone 16" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build + ./gradlew -PiosSimulatorDevice="iPhone 15 Pro" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck + ./gradlew -PiosSimulatorDevice="iPhone 15 Pro" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build - name: Save Test Reports if: failure() From ae75af87acf5e3e37a25d64f096886afb2f2a6fc Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 18 Mar 2025 10:21:49 -0400 Subject: [PATCH 13/14] Run on macOS 15, with iPhone 16 --- .github/workflows/continuous-integration.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3f651a5796..7fda781fb6 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -45,13 +45,13 @@ jobs: run: | ./gradlew -Paws.kotlin.native=false -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace - # macos-14 build and test for targets: jvm, macoArm64, iosSimulatorArm64, watchosSimulatorArm65, tvosSimulatorArm64 - # macos-13 build and test for targets: jvm, macoX64, iosX64, tvosX64, watchosX64 + # macos-15 build and test for targets: jvm, macosArm64, iosSimulatorArm64, watchosSimulatorArm65, tvosSimulatorArm64: https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md + # macos-15-large build and test for targets: jvm, macosX64, iosX64, tvosX64, watchosX64: https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md macos: strategy: fail-fast: false matrix: - os: [macos-14, macos-13] + os: [macos-15, macos-15-large] runs-on: ${{ matrix.os }} steps: - name: Checkout sources @@ -72,8 +72,8 @@ jobs: /usr/bin/xcrun simctl erase all killall -9 com.apple.CoreSimulator.CoreSimulatorService xcrun simctl list devices - ./gradlew -PiosSimulatorDevice="iPhone 15 Pro" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck - ./gradlew -PiosSimulatorDevice="iPhone 15 Pro" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build + ./gradlew -PiosSimulatorDevice="iPhone 16" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck + ./gradlew -PiosSimulatorDevice="iPhone 16" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build - name: Save Test Reports if: failure() From 8712d5213f6c35d849766fe26e7ce9324df7f79c Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 18 Mar 2025 21:46:03 -0400 Subject: [PATCH 14/14] Revert macOS 15 edits --- .github/workflows/continuous-integration.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 8c635a5fbe..b09ce9173d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -45,13 +45,13 @@ jobs: run: | ./gradlew -Paws.kotlin.native=false -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace - # macos-15 build and test for targets: jvm, macosArm64, iosSimulatorArm64, watchosSimulatorArm65, tvosSimulatorArm64: https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md - # macos-15-large build and test for targets: jvm, macosX64, iosX64, tvosX64, watchosX64: https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md + # macos-14 build and test for targets: jvm, macoArm64, iosSimulatorArm64, watchosSimulatorArm65, tvosSimulatorArm64 + # macos-13 build and test for targets: jvm, macoX64, iosX64, tvosX64, watchosX64 macos: strategy: fail-fast: false matrix: - os: [macos-15, macos-15-large] + os: [macos-14, macos-13] runs-on: ${{ matrix.os }} steps: - name: Checkout sources @@ -67,13 +67,9 @@ jobs: shell: bash run: | # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 - # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties - /usr/bin/xcrun simctl shutdown all - /usr/bin/xcrun simctl erase all - killall -9 com.apple.CoreSimulator.CoreSimulatorService - xcrun simctl list devices - ./gradlew -PiosSimulatorDevice="iPhone 16" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck - ./gradlew -PiosSimulatorDevice="iPhone 16" -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build + # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties + ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true apiCheck + ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true -Paws.kotlin.native.disableCrossCompile=true build - name: Save Test Reports if: failure()