Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 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
39dfad8
Merge remote-tracking branch 'origin/main' into kn-main-merge-take2
ianbotsf Sep 16, 2025
cc0ed83
add mingw local build support
ianbotsf Sep 16, 2025
2902b79
lint
ianbotsf Sep 16, 2025
925afc7
fix eager Gradle API
ianbotsf Sep 16, 2025
9428a7d
even weaker sourceset ref?
ianbotsf Sep 16, 2025
3801d2c
only configure mingw def file if we're building K/N
ianbotsf Sep 16, 2025
2f42928
upgade to latest repo-tools
ianbotsf Sep 17, 2025
60a3427
Refactor getAllEnvVars
lauzadis Sep 18, 2025
66a420c
Add back cinterop
lauzadis Sep 18, 2025
a899e40
ktlint
lauzadis Sep 18, 2025
c8322f0
spam add opt-ins, to see if CI passes
lauzadis Sep 18, 2025
36295f2
use `pull_request` instead of `pull_request_target`
ianbotsf Sep 18, 2025
29b7a9b
remove opt-ins
lauzadis Sep 18, 2025
d0e0142
Just add opt-ins where needed
lauzadis Sep 18, 2025
9a4ac94
Merge branch 'kn-main-merge-take2' of github.com:smithy-lang/smithy-k…
lauzadis Sep 18, 2025
8193cdb
Remove unnecessary opt-in
lauzadis Sep 18, 2025
7fc34e8
ktlint
lauzadis Sep 18, 2025
0ef0e81
kn: merge from main, fix Windows compilation (#1409)
aws-sdk-kotlin-ci Sep 19, 2025
6c25cb4
chore: re-enable K/N ignored tests
ianbotsf Sep 19, 2025
1cdc074
temporarily bypass irrelevant MacOS CI
ianbotsf Sep 22, 2025
14b0a19
more debug info from MacOS test
ianbotsf Sep 22, 2025
1f02e5f
restore original MacOS CI
ianbotsf Sep 22, 2025
56adbc6
retrigger CI
ianbotsf Sep 23, 2025
abd54c8
retrigger CI
ianbotsf Sep 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .brazil.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"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",
"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",
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`"
}
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'
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()
22 changes: 15 additions & 7 deletions .github/workflows/artifact-size-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,41 @@ jobs:
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 17
cache: 'gradle'
path: smithy-kotlin

- name: Setup build
uses: ./smithy-kotlin/.github/actions/setup-build

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
aws-region: us-west-2

- name: Configure Gradle
uses: aws/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
with:
working-directory: smithy-kotlin

- name: Generate Artifact Size Metrics
run: ./gradlew artifactSizeMetrics
run: ./gradlew -Paws.kotlin.native=false artifactSizeMetrics
working-directory: smithy-kotlin

- name: Analyze Artifact Size Metrics
run: ./gradlew analyzeArtifactSizeMetrics
working-directory: smithy-kotlin

- name: Show Results
uses: aws/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/show-results@main

- name: Evaluate
if: ${{ !contains(github.event.pull_request.labels.*.name, 'acknowledge-artifact-size-increase') }}
working-directory: smithy-kotlin
run: |
cd build/reports/metrics
cat has-significant-change.txt | grep false || {
echo An artifact increased in size by more than allowed or a new artifact was created.
echo If this is expected please add the 'acknowledge-artifact-size-increase' label to this pull request.
exit 1
}
}
4 changes: 2 additions & 2 deletions .github/workflows/changelog-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permissions:
id-token: write

on:
pull_request:
pull_request_target:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
branches:
- main
Expand All @@ -22,4 +22,4 @@ jobs:
aws-region: us-west-2

- name: Verify changelog
uses: aws/aws-kotlin-repo-tools/.github/actions/changelog-verification@main
uses: aws/aws-kotlin-repo-tools/.github/actions/changelog-verification@main
Loading
Loading