Hi, I'm trying to build a "small" command line tool that requires calling an AWS Lambda function. Originally I was producing the text for calling the aws client, but now that there's the aws sdk for swift I wanted to make a new version that used it. It builds and runs OK when on macOS (Swif5 and Swift6 by using /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift build
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let xName = "My-Project"
let package = Package(
name: xName,
platforms: [
.macOS(.v10_15),
.iOS(.v14),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"),
.package(url: "https://github.com/awslabs/aws-sdk-swift.git", from: "0.16.0")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.executableTarget(
name: xName,
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "AWSLambda", package: "aws-sdk-swift")
],
swiftSettings: [
.unsafeFlags([
"-parse-as-library"
])
]
),
]
)
For Linux, I'm running on Ubuntu 22.04 (x86_64 and arm64 on a Raspberry Pi 4, too) and it builds OK with Swift5, but I get this weird issue when building with swift6:
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:85:103: error: incomplete definition of type 'struct openssl_hmac_ctx_table'
85 | (int (*)(HMAC_CTX *, const void *, int, const EVP_MD *, ENGINE *))g_aws_openssl_hmac_ctx_table->impl.init_ex_fn;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:29:15: note: forward declaration of 'struct openssl_hmac_ctx_table'
29 | static struct openssl_hmac_ctx_table hmac_ctx_table;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:108:37: error: incomplete definition of type 'struct openssl_hmac_ctx_table'
108 | g_aws_openssl_hmac_ctx_table->init_fn != s_hmac_ctx_init_noop &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/assert.h:173:63: note: expanded from macro 'AWS_PRECONDITION'
173 | #define AWS_PRECONDITION(...) CALL_OVERLOAD(AWS_PRECONDITION, __VA_ARGS__)
| ^~~~~~~~~~~
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/macros.h:54:92: note: expanded from macro 'CALL_OVERLOAD'
54 | #define CALL_OVERLOAD(name, ...) GLUE(OVERLOAD_MACRO(name, COUNT_ARGS_MAX5(__VA_ARGS__)), (__VA_ARGS__))
| ^~~~~~~~~~~
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/macros.h:44:22: note: expanded from macro 'GLUE'
44 | #define GLUE(x, y) x y
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/assert.h:118:48: note: expanded from macro 'AWS_PRECONDITION1'
118 | # define AWS_PRECONDITION1(cond) AWS_ASSERT(cond)
| ^~~~
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/assert.h:64:47: note: expanded from macro 'AWS_ASSERT'
64 | # define AWS_ASSERT(cond) AWS_FATAL_ASSERT(cond)
| ^~~~
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/assert.h:87:23: note: expanded from macro 'AWS_FATAL_ASSERT'
87 | if (!(cond)) { \
| ^~~~
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:29:15: note: forward declaration of 'struct openssl_hmac_ctx_table'
29 | static struct openssl_hmac_ctx_table hmac_ctx_table;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:112:33: error: incomplete definition of type 'struct openssl_hmac_ctx_table'
112 | g_aws_openssl_hmac_ctx_table->init_fn(ctx);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:29:15: note: forward declaration of 'struct openssl_hmac_ctx_table'
29 | static struct openssl_hmac_ctx_table hmac_ctx_table;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:120:37: error: incomplete definition of type 'struct openssl_hmac_ctx_table'
120 | g_aws_openssl_hmac_ctx_table->clean_up_fn != s_hmac_ctx_clean_up_noop &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/assert.h:173:63: note: expanded from macro 'AWS_PRECONDITION'
173 | #define AWS_PRECONDITION(...) CALL_OVERLOAD(AWS_PRECONDITION, __VA_ARGS__)
| ^~~~~~~~~~~
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/macros.h:54:92: note: expanded from macro 'CALL_OVERLOAD'
54 | #define CALL_OVERLOAD(name, ...) GLUE(OVERLOAD_MACRO(name, COUNT_ARGS_MAX5(__VA_ARGS__)), (__VA_ARGS__))
| ^~~~~~~~~~~
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/macros.h:44:22: note: expanded from macro 'GLUE'
44 | #define GLUE(x, y) x y
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/assert.h:118:48: note: expanded from macro 'AWS_PRECONDITION1'
118 | # define AWS_PRECONDITION1(cond) AWS_ASSERT(cond)
| ^~~~
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/assert.h:64:47: note: expanded from macro 'AWS_ASSERT'
64 | # define AWS_ASSERT(cond) AWS_FATAL_ASSERT(cond)
| ^~~~
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/include/aws/common/assert.h:87:23: note: expanded from macro 'AWS_FATAL_ASSERT'
87 | if (!(cond)) { \
| ^~~~
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:29:15: note: forward declaration of 'struct openssl_hmac_ctx_table'
29 | static struct openssl_hmac_ctx_table hmac_ctx_table;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:122:33: error: incomplete definition of type 'struct openssl_hmac_ctx_table'
122 | g_aws_openssl_hmac_ctx_table->clean_up_fn(ctx);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:29:15: note: forward declaration of 'struct openssl_hmac_ctx_table'
29 | static struct openssl_hmac_ctx_table hmac_ctx_table;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:138:5: error: use of undeclared identifier 'hmac_ctx_init'
138 | hmac_ctx_init init_fn = (hmac_ctx_init)HMAC_CTX_init;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:139:5: error: use of undeclared identifier 'hmac_ctx_clean_up'
139 | hmac_ctx_clean_up clean_up_fn = (hmac_ctx_clean_up)HMAC_CTX_cleanup;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:140:5: error: use of undeclared identifier 'hmac_update'
140 | hmac_update update_fn = (hmac_update)HMAC_Update;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:141:5: error: use of undeclared identifier 'hmac_final'
141 | hmac_final final_fn = (hmac_final)HMAC_Final;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:142:5: error: use of undeclared identifier 'hmac_init_ex'
142 | hmac_init_ex init_ex_fn = (hmac_init_ex)HMAC_Init_ex;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:145:28: error: use of undeclared identifier 'init_fn'
145 | bool has_102_symbols = init_fn && clean_up_fn && update_fn && final_fn && init_ex_fn;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:145:39: error: use of undeclared identifier 'clean_up_fn'
145 | bool has_102_symbols = init_fn && clean_up_fn && update_fn && final_fn && init_ex_fn;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:145:54: error: use of undeclared identifier 'update_fn'
145 | bool has_102_symbols = init_fn && clean_up_fn && update_fn && final_fn && init_ex_fn;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:145:67: error: use of undeclared identifier 'final_fn'
145 | bool has_102_symbols = init_fn && clean_up_fn && update_fn && final_fn && init_ex_fn;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:145:79: error: use of undeclared identifier 'init_ex_fn'
145 | bool has_102_symbols = init_fn && clean_up_fn && update_fn && final_fn && init_ex_fn;
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:150:21: error: use of undeclared identifier 'init_fn'
150 | *(void **)(&init_fn) = dlsym(module, "HMAC_CTX_init");
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:151:21: error: use of undeclared identifier 'clean_up_fn'
151 | *(void **)(&clean_up_fn) = dlsym(module, "HMAC_CTX_cleanup");
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:152:21: error: use of undeclared identifier 'update_fn'
152 | *(void **)(&update_fn) = dlsym(module, "HMAC_Update");
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/openssl_platform_init.c:153:21: error: use of undeclared identifier 'final_fn'
153 | *(void **)(&final_fn) = dlsym(module, "HMAC_Final");
| ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/opensslcrypto_hmac.c:30:9: error: use of undeclared identifier 'g_aws_openssl_hmac_ctx_table'
30 | g_aws_openssl_hmac_ctx_table->free_fn(ctx);
| ^
/home/marcelo/repo/my-project/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-cal/source/unix/opensslcrypto_hmac.c:63:11: error: use of undeclared identifier 'g_aws_openssl_hmac_ctx_table'
63 | ctx = g_aws_openssl_hmac_ctx_table->new_fn();
| ^
[11/428] Write swift-version-6A52383ED409C6A7.txt
marcelo:my-project %
any help figuring out what's wrong would be great.
Thanks!