Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit e07a9e3

Browse files
Support Swift 5.3
1 parent 1635c6a commit e07a9e3

File tree

6 files changed

+48
-12
lines changed

6 files changed

+48
-12
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
SWIFT_VERSION?=5.2.3
1+
SWIFT_VERSION?=5.3-amazonlinux2
2+
DOCKER_OS?=amazonlinux2
23

34
DOCKER_TAG=nio-swift:$(SWIFT_VERSION)
45
SWIFT_DOCKER_IMAGE=$(DOCKER_TAG)

Package.resolved

+26-8
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/swift-server/async-http-client.git",
77
"state": {
88
"branch": null,
9-
"revision": "037b70291941fe43de668066eb6fb802c5e181d2",
10-
"version": "1.1.1"
9+
"revision": "4b4d6605aa2e4f0c2ae3c7563795ae3bec259fff",
10+
"version": "1.2.1"
1111
}
1212
},
1313
{
@@ -19,31 +19,49 @@
1919
"version": "1.0.0"
2020
}
2121
},
22+
{
23+
"package": "swift-log",
24+
"repositoryURL": "https://github.com/apple/swift-log.git",
25+
"state": {
26+
"branch": null,
27+
"revision": "173f567a2dfec11d74588eea82cecea555bdc0bc",
28+
"version": "1.4.0"
29+
}
30+
},
2231
{
2332
"package": "swift-nio",
2433
"repositoryURL": "https://github.com/apple/swift-nio.git",
2534
"state": {
2635
"branch": null,
27-
"revision": "e876fb37410e0036b98b5361bb18e6854739572b",
28-
"version": "2.16.0"
36+
"revision": "96db8838be60fcbb993fa738e1120fb7f4b99c43",
37+
"version": "2.22.1"
2938
}
3039
},
3140
{
3241
"package": "swift-nio-extras",
3342
"repositoryURL": "https://github.com/apple/swift-nio-extras.git",
3443
"state": {
3544
"branch": null,
36-
"revision": "b4dbfacff47fb8d0f9e0a422d8d37935a9f10570",
37-
"version": "1.4.0"
45+
"revision": "e5b5d191a80667a14827bfeb0ae4a511f7677942",
46+
"version": "1.7.0"
3847
}
3948
},
4049
{
4150
"package": "swift-nio-ssl",
4251
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
4352
"state": {
4453
"branch": null,
45-
"revision": "ae213938e151964aa691f0e902462fbe06baeeb6",
46-
"version": "2.7.1"
54+
"revision": "ea1dfd64193bf5af4490635a4a44c4fb43b1e1ae",
55+
"version": "2.9.1"
56+
}
57+
},
58+
{
59+
"package": "swift-nio-transport-services",
60+
"repositoryURL": "https://github.com/apple/swift-nio-transport-services.git",
61+
"state": {
62+
"branch": null,
63+
"revision": "bb56586c4cab9a79dce6ec4738baddb5802c5de7",
64+
"version": "1.9.0"
4765
}
4866
}
4967
]

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# aws-lambda-swift-sprinter-nio-plugin
22

33

4-
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1](https://img.shields.io/badge/Swift-5.1-blue.svg)](https://swift.org/download/) [![Swift 5.2](https://img.shields.io/badge/Swift-5.2-blue.svg)](https://swift.org/download/) ![](https://img.shields.io/badge/version-1.0.0-green) [![Build Status](https://travis-ci.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin.svg?branch=master)](https://travis-ci.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin) [![codecov](https://codecov.io/gh/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin)
4+
[![Swift 5](https://img.shields.io/badge/Swift-5.3-blue.svg)](https://swift.org/download/) ![](https://img.shields.io/badge/version-1.0.0-green) [![Build Status](https://travis-ci.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin.svg?branch=master)](https://travis-ci.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin) [![codecov](https://codecov.io/gh/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin)
55

66
The project implements an HTTPS client plugin for the [LambdaSwiftSprinter](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core) framework.
77

88
The plugin is based on swift-nio 2.0 and uses the third part library [async-http-client](https://github.com/swift-server/async-http-client.git)
99

1010

11-
- Allow the handler to make an HTTPS call. Swift's implementation relies on ``libgnutls`` which expects to find its root certificates in ``/etc/ssl/certs/ca-certificates.crt`` directory. That directory is absent on Amazon Linux. **Currently calls to HTTPS endpoint will fail with an error** : ``error setting certificate verify locations:\n CAfile: /etc/ssl/certs/ca-certificates.crt\n CApath: /etc/ssl/certs``
12-
This library fix this issue by using `swift-nio 2`.
11+
- Allow the handler to make an HTTPS call using swift-nio
1312

1413
# Usage
1514

docker/5.3-amazonlinux2/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM swift:5.3-amazonlinux2 as builder
2+
3+
RUN yum -y install zip

docker/5.3-amazonlinux2/bootstrap

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
EXECUTABLE=$LAMBDA_TASK_ROOT/"$(echo $_HANDLER | cut -d. -f1)"
3+
$EXECUTABLE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/usr/lib/swift/linux/libBlocksRuntime.so
2+
/usr/lib/swift/linux/libFoundation.so
3+
/usr/lib/swift/linux/libFoundationNetworking.so
4+
/usr/lib/swift/linux/libFoundationXML.so
5+
/usr/lib/swift/linux/libdispatch.so
6+
/usr/lib/swift/linux/libicudataswift.so.65
7+
/usr/lib/swift/linux/libicui18nswift.so.65
8+
/usr/lib/swift/linux/libicuucswift.so.65
9+
/usr/lib/swift/linux/libswiftCore.so
10+
/usr/lib/swift/linux/libswiftDispatch.so
11+
/usr/lib/swift/linux/libswiftGlibc.so
12+
/usr/lib/swift/linux/libswiftSwiftOnoneSupport.so

0 commit comments

Comments
 (0)