Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9d9faf3
misc: Set up Kotlin/Native build (#1174)
lauzadis Nov 14, 2024
fe34b22
Merge branch 'main' of github.com:smithy-lang/smithy-kotlin into kn-main
lauzadis Dec 13, 2024
523dba9
kn: checksum bindings (#1182)
lauzadis Dec 17, 2024
f5c5af0
kn: Ignore failing tests (#1203)
lauzadis Jan 8, 2025
43e39b8
kn: Implement `Instant` using `kotlinx.datetime.Instant` (#1201)
lauzadis Jan 8, 2025
2653fbf
kn: implement `SdkBuffer` (#1214)
lauzadis Jan 10, 2025
f025d2b
feat: Kotlin/Native implementation of BigDecimal and BigInteger (#1200)
ianbotsf Jan 10, 2025
9c6b231
kn: merge from main (#1216)
lauzadis Jan 23, 2025
99d1214
kn: gzip compression (#1228)
lauzadis Feb 3, 2025
7c3c73f
kn: HostResolver (#1229)
lauzadis Feb 4, 2025
ae80656
kn: implement `SystemDefaultProvider` for Native (#1231)
lauzadis Feb 4, 2025
31412d2
kn: enable many `@IgnoreNative` tests (#1233)
lauzadis Feb 11, 2025
7067459
kn: merge from main (#1256)
lauzadis Mar 19, 2025
ad639f2
kn: observability (#1234)
lauzadis Mar 21, 2025
f7c8f82
kn/misc: enable various ignored tests (#1257)
lauzadis Mar 26, 2025
cde940f
kn: merge from main (#1273)
lauzadis Apr 15, 2025
8daa00e
kn: upgrade to latest version of aws-kotlin-repo-tools (#1327)
lauzadis Jul 16, 2025
d603059
kn: merge from main (#1332)
lauzadis Jul 17, 2025
7890bec
kn: depend on SNAPSHOT version of aws-crt-kotlin (#1333)
lauzadis Jul 17, 2025
7257283
fix: correctly close HTTP-related CRT resources in native sourceset (…
ianbotsf Jul 31, 2025
e425de3
kn: merge from main, upgrade to latest version of aws-kotlin-repo-too…
lauzadis Aug 7, 2025
147dc8c
usePinned V1877473314
lauzadis Aug 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
66 changes: 66 additions & 0 deletions .brazil-1.x.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"dependencies": {
"org.jetbrains.kotlin:kotlin-stdlib:2.*": "KotlinStdlib-2.x",
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.*": "KotlinxCoroutinesCoreJvm-1.x",

"com.squareup.okhttp3:okhttp-coroutines:5.*": "OkHttp3Coroutines-5.x",
"com.squareup.okhttp3:okhttp:5.*": "OkHttp3-5.x",
"com.squareup.okio:okio-jvm:3.*": "OkioJvm-3.x",
"io.opentelemetry:opentelemetry-api:1.*": "Maven-io-opentelemetry_opentelemetry-api-1.x",
"io.opentelemetry:opentelemetry-extension-kotlin:1.*": "Maven-io-opentelemetry_opentelemetry-extension-kotlin-1.x",
"org.slf4j:slf4j-api:2.*": "Maven-org-slf4j_slf4j-api-2.x",
"aws.sdk.kotlin.crt:aws-crt-kotlin:0.9.*": "AwsCrtKotlin-0.9.x",
"aws.sdk.kotlin.crt:aws-crt-kotlin:0.8.*": "AwsCrtKotlin-0.8.x",
"com.squareup.okhttp3:okhttp:4.*": "OkHttp3-4.x",

"software.amazon.smithy:smithy-aws-traits:1.*": "Maven-software-amazon-smithy_smithy-aws-traits-1.x",
"software.amazon.smithy:smithy-aws-iam-traits:1.*": "Maven-software-amazon-smithy_smithy-aws-iam-traits-1.x",
"software.amazon.smithy:smithy-aws-cloudformation-traits:1.*": "Maven-software-amazon-smithy_smithy-aws-cloudformation-traits-1.x",
"software.amazon.smithy:smithy-protocol-test-traits:1.*": "Maven-software-amazon-smithy_smithy-protocol-test-traits-1.x",
"software.amazon.smithy:smithy-protocol-traits:1.*": "Maven-software-amazon-smithy_smithy-protocol-traits-1.x",
"software.amazon.smithy:smithy-aws-endpoints:1.*": "Maven-software-amazon-smithy_smithy-aws-endpoints-1.x",
"software.amazon.smithy:smithy-codegen-core:1.*": "Maven-software-amazon-smithy_smithy-codegen-core-1.x",
"software.amazon.smithy:smithy-waiters:1.*": "Maven-software-amazon-smithy_smithy-waiters-1.x",
"software.amazon.smithy:smithy-rules-engine:1.*": "Maven-software-amazon-smithy_smithy-rules-engine-1.x",
"software.amazon.smithy:smithy-smoke-test-traits:1.*": "Maven-software-amazon-smithy_smithy-smoke-test-traits-1.x",
"org.jsoup:jsoup:1.19.*": "Maven-jsoup-1.19.x"
},
"packageHandlingRules": {
"versioning": {
"defaultVersionLayout": "{MAJOR}.x"
},
"rename": {
"software.amazon.smithy.kotlin:smithy-aws-kotlin-codegen": "AwsSmithyAwsKotlinCodegen",
"software.amazon.smithy.kotlin:smithy-kotlin-codegen": "AwsSmithyKotlinCodegen"
},
"ignore": [
"aws.smithy.kotlin:http-test",
"aws.smithy.kotlin:smithy-test",
"aws.smithy.kotlin:telemetry-provider-micrometer",
"aws.smithy.kotlin:testing",
"aws.smithy.kotlin:bom",
"aws.smithy.kotlin:version-catalog",
"software.amazon.smithy.kotlin:smithy-kotlin-codegen-testutils"
],
"resolvesConflictDependencies": {
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.*": [
"KotlinxCoroutinesCoreJvm-1.x"
],
"com.squareup.okhttp3:okhttp-coroutines:5.*": [
"KotlinStdlib-2.x",
"KotlinxCoroutinesCoreJvm-1.x",
"KotlinStdlibJdk7-2.x",
"KotlinStdlibJdk8-2.x"
],
"com.squareup.okhttp3:okhttp:5.*": [
"KotlinStdlib-2.x"
],
"com.squareup.okio:okio-jvm:3.*": [
"KotlinStdlib-2.x"
],
"com.squareup.okhttp3:okhttp:4.*": [
"OkHttp3-4.x"
]
}
}
}
32 changes: 25 additions & 7 deletions .brazil.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,53 @@
{
"dependencies": {
"org.jetbrains.kotlin:kotlin-stdlib:2.0.*": "KotlinStdlib-2.x",
"org.jetbrains.kotlin:kotlin-stdlib:2.*": "KotlinStdlib-2.x",
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.*": "KotlinxCoroutinesCoreJvm-1.x",

"com.squareup.okhttp3:okhttp-coroutines:5.*": "OkHttp3Coroutines-5.x",
"com.squareup.okhttp3:okhttp:5.*": "OkHttp3-5.x",
"com.squareup.okhttp3:okhttp-jvm:5.*": "OkHttp3-5.x",
"com.squareup.okio:okio-jvm:3.*": "OkioJvm-3.x",
"io.opentelemetry:opentelemetry-api:1.*": "Maven-io-opentelemetry_opentelemetry-api-1.x",
"io.opentelemetry:opentelemetry-extension-kotlin:1.*": "Maven-io-opentelemetry_opentelemetry-extension-kotlin-1.x",
"org.slf4j:slf4j-api:2.*": "Maven-org-slf4j_slf4j-api-2.x",
"aws.sdk.kotlin.crt:aws-crt-kotlin:0.10.*": "AwsCrtKotlin-0.10.x",
"aws.sdk.kotlin.crt:aws-crt-kotlin:0.9.*": "AwsCrtKotlin-0.9.x",
"aws.sdk.kotlin.crt:aws-crt-kotlin:0.8.*": "AwsCrtKotlin-0.8.x",
"com.squareup.okhttp3:okhttp:4.*": "OkHttp3-4.x"
"com.squareup.okhttp3:okhttp:4.*": "OkHttp3-4.x",
"org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.*": "KotlinxDatetimeJvm-0.x",

"software.amazon.smithy:smithy-aws-traits:1.*": "Maven-software-amazon-smithy_smithy-aws-traits-1.x",
"software.amazon.smithy:smithy-aws-iam-traits:1.*": "Maven-software-amazon-smithy_smithy-aws-iam-traits-1.x",
"software.amazon.smithy:smithy-aws-cloudformation-traits:1.*": "Maven-software-amazon-smithy_smithy-aws-cloudformation-traits-1.x",
"software.amazon.smithy:smithy-protocol-test-traits:1.*": "Maven-software-amazon-smithy_smithy-protocol-test-traits-1.x",
"software.amazon.smithy:smithy-protocol-traits:1.*": "Maven-software-amazon-smithy_smithy-protocol-traits-1.x",
"software.amazon.smithy:smithy-aws-endpoints:1.*": "Maven-software-amazon-smithy_smithy-aws-endpoints-1.x",
"software.amazon.smithy:smithy-codegen-core:1.*": "Maven-software-amazon-smithy_smithy-codegen-core-1.x",
"software.amazon.smithy:smithy-waiters:1.*": "Maven-software-amazon-smithy_smithy-waiters-1.x",
"software.amazon.smithy:smithy-rules-engine:1.*": "Maven-software-amazon-smithy_smithy-rules-engine-1.x",
"software.amazon.smithy:smithy-smoke-test-traits:1.*": "Maven-software-amazon-smithy_smithy-smoke-test-traits-1.x",
"org.jsoup:jsoup:1.19.*": "Maven-jsoup-1.19.x"
},
"packageHandlingRules": {
"versioning": {
"defaultVersionLayout": "{MAJOR}.0.x",
"overrides": {
"software.amazon.smithy.kotlin:smithy-kotlin-codegen": "{MAJOR}.{MINOR}.x",
"software.amazon.smithy.kotlin:smithy-kotlin-codegen-testutils": "{MAJOR}.{MINOR}.x"
"software.amazon.smithy.kotlin:smithy-aws-kotlin-codegen": "{MAJOR}.x",
"software.amazon.smithy.kotlin:smithy-kotlin-codegen": "{MAJOR}.x"
}
},
"rename": {
"software.amazon.smithy.kotlin:smithy-kotlin-codegen": "SmithyKotlinCodegen",
"software.amazon.smithy.kotlin:smithy-kotlin-codegen-testutils": "SmithyKotlinCodegenTestUtils"
"software.amazon.smithy.kotlin:smithy-aws-kotlin-codegen": "AwsSmithyAwsKotlinCodegen",
"software.amazon.smithy.kotlin:smithy-kotlin-codegen": "AwsSmithyKotlinCodegen"
},
"ignore": [
"aws.smithy.kotlin:http-test",
"aws.smithy.kotlin:smithy-test",
"aws.smithy.kotlin:telemetry-provider-micrometer",
"aws.smithy.kotlin:testing",
"aws.smithy.kotlin:bom",
"aws.smithy.kotlin:version-catalog"
"aws.smithy.kotlin:version-catalog",
"software.amazon.smithy.kotlin:smithy-kotlin-codegen-testutils"
],
"resolvesConflictDependencies": {
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.*": [
Expand Down
5 changes: 5 additions & 0 deletions .changes/1021e75a-45f3-4f3a-820c-700d9ec6e782.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "1021e75a-45f3-4f3a-820c-700d9ec6e782",
"type": "bugfix",
"description": "Fix serialization of CBOR blobs"
}
5 changes: 5 additions & 0 deletions .changes/4820850c-8916-47f5-a7e1-8880e6a00d22.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "4820850c-8916-47f5-a7e1-8880e6a00d22",
"type": "bugfix",
"description": "Fix errors in equality checks for `CaseInsensitiveMap` which affect `Headers` and `ValuesMap` implementations"
}
5 changes: 5 additions & 0 deletions .changes/c0040355-ffdc-4813-80e9-baf859ef02b9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "c0040355-ffdc-4813-80e9-baf859ef02b9",
"type": "bugfix",
"description": "fix: correct hash code calculation for case-insensitive map entries"
}
5 changes: 5 additions & 0 deletions .changes/d3ce7511-6fb2-4435-8f46-db724551b384.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "d3ce7511-6fb2-4435-8f46-db724551b384",
"type": "misc",
"description": "Add telemetry provider configuration to `DefaultAwsSigner`"
}
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ ktlint_standard_backing-property-naming = disabled
# enable trailing commas per JetBrains recommendation
# (https://kotlinlang.org/docs/coding-conventions.html#trailing-commas)
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma = true
49 changes: 49 additions & 0 deletions .github/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Setup Build
description: >
Checkout repositories and build dependencies

runs:
using: composite
steps:
- name: Extract aws-kotlin-repo-tools version
working-directory: ./smithy-kotlin
shell: bash
run: |
export AWS_KOTLIN_REPO_TOOLS_VERSION=$(grep '^aws-kotlin-repo-tools-version' ./gradle/libs.versions.toml | sed -E 's/.*= "(.*)"/\1/')
echo "Using aws-kotlin-repo-tools version $AWS_KOTLIN_REPO_TOOLS_VERSION"
echo "aws_kotlin_repo_tools_version=$AWS_KOTLIN_REPO_TOOLS_VERSION" >> $GITHUB_ENV

- name: Checkout aws-kotlin-repo-tools
uses: actions/checkout@v4
with:
path: 'aws-kotlin-repo-tools'
repository: 'awslabs/aws-kotlin-repo-tools'
ref: ${{ env.aws_kotlin_repo_tools_version }}
sparse-checkout: |
.github

- name: Checkout aws-crt-kotlin
uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head
with:
# checkout aws-crt-kotlin as a sibling which will automatically make it an included build
path: 'aws-crt-kotlin'
repository: 'awslabs/aws-crt-kotlin'
submodules: 'true'

# Cache the Kotlin/Native toolchain based on the input Kotlin version from version catalog
# see https://kotlinlang.org/docs/native-improving-compilation-time.html
- name: Cache Kotlin Native toolchain
uses: actions/cache@v4
with:
path: |
~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('gradle/libs.versions.toml') }}
restore-keys: |
${{ runner.os }}-konan-

- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 17
cache: 'gradle'
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: gradle
directory: /
schedule:
interval: daily # means every _weekday_ (Monday through Friday)
152 changes: 152 additions & 0 deletions .github/scripts/run-container-test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
#!/usr/bin/env python3
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

"""
Run precompiled Kotlin/Native test binaries in a Docker container for a specific Linux distribution and architecture.

This requires Docker multiarch support, see https://docs.docker.com/build/building/multi-platform/ and https://github.com/multiarch/qemu-user-static
In GitHub we use a provided action for this: https://github.com/docker/setup-qemu-action

Locally you would need to run one of:

`docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes`

OR

`docker run --privileged --rm tonistiigi/binfmt --install all`
"""

import argparse
import os
import subprocess
import shlex
import shutil

VERBOSE = False

DISTRO_TO_IMAGE_NAME = {
"ubuntu-22.04": "public.ecr.aws/lts/ubuntu:22.04_stable",
"al2023": "public.ecr.aws/amazonlinux/amazonlinux:2023",
"al2": "public.ecr.aws/amazonlinux/amazonlinux:2"
}

DOCKER_PLATFORM_BY_ARCH = {
"x64": "linux/amd64",
"arm64": "linux/arm64"
}


def vprint(message):
global VERBOSE
if VERBOSE:
print(message)


def running_in_github_action():
"""
Test if currently running in a GitHub action or running locally
:return: True if running in GH, False otherwise
"""
return "GITHUB_WORKFLOW" in os.environ


def shell(command, cwd=None, check=True, capture_output=False):
"""
Run a command
:param command: command to run
:param cwd: the current working directory to change to before executing the command
:param check: flag indicating if the status code should be checked. When true an exception will be
thrown if the command exits with a non-zero exit status.
:returns: the subprocess CompletedProcess output
"""
vprint(f"running `{command}`")
return subprocess.run(command, shell=True, check=check, cwd=cwd, capture_output=capture_output)


def oci_executable():
"""
Attempt to find the OCI container executor used to build and run docker containers
"""
oci_exe = os.environ.get('OCI_EXE')
if oci_exe is not None:
return oci_exe

executors = ['finch', 'podman', 'docker']

for exe in executors:
if shutil.which(exe) is not None:
return exe

print("cannot find container executor")
exit(1)


def run_docker_test(opts):
"""
Run a docker test for a precompiled Kotlin/Native binary

:param opts: the parsed command line options
"""
platform = DOCKER_PLATFORM_BY_ARCH[opts.arch]
oci_exe = oci_executable()

test_bin_dir = os.path.abspath(opts.test_bin_dir)
image_name = DISTRO_TO_IMAGE_NAME[opts.distro]
path_to_exe = f'./linux{opts.arch.capitalize()}/debugTest/test.kexe'

cmd = [
oci_exe,
'run',
'--rm',
f'-v{test_bin_dir}:/test',
]
if not opts.no_system_certs:
cmd.append(f'-v/etc/ssl:/etc/ssl')

cmd.extend(
[
'-w/test',
'-e DEBIAN_FRONTEND=noninteractive',
'--platform',
platform,
image_name,
path_to_exe,
]
)

cmd = shlex.join(cmd)
print(cmd)
shell(cmd)


def create_cli():
parser = argparse.ArgumentParser(
prog="run-container-test",
description="Run cross platform test binaries in a container",
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)

parser.add_argument("-v", "--verbose", help="enable verbose output", action="store_true")

parser.add_argument("--distro", required=True, choices=DISTRO_TO_IMAGE_NAME.keys(), help="the distribution name to run the task on")
parser.add_argument("--arch", required=True, choices=DOCKER_PLATFORM_BY_ARCH.keys(), help="the architecture to use")
parser.add_argument("--test-bin-dir", required=True, help="the path to the test binary directory root")
parser.add_argument("--no-system-certs", action='store_true', help="disable mounting system certificates into the container")

return parser


def main():
cli = create_cli()
opts = cli.parse_args()
if opts.verbose:
global VERBOSE
VERBOSE = True

run_docker_test(opts)


if __name__ == '__main__':
main()
4 changes: 3 additions & 1 deletion .github/workflows/api-compat-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: API compatibility verification
on:
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
branches: [ main ]
branches:
- main
- '*-main'

jobs:
api-compat-verification:
Expand Down
Loading
Loading