Skip to content

[core] Can't compile with default traits disabled. #562

@sebsto

Description

@sebsto

To reproduce:

  • create a lambda function (similar to HelloWorld example)
  • disable all traits
    dependencies: [
        .package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
                 from: "2.0.0-beta.3",
                 traits: []),
    ],
  • build with swift build
Building for debugging...
swift-aws-lambda-runtime/Sources/AWSLambdaRuntime/LambdaResponseStreamWriter+Headers.swift:106:65: error: cannot find 'LambdaJSONOutputEncoder' in scope
104 |     ) async throws {
105 |         encoder.outputFormatting = .withoutEscapingSlashes
106 |         try await self.writeStatusAndHeaders(response, encoder: LambdaJSONOutputEncoder(encoder))
    |                                                                 `- error: cannot find 'LambdaJSONOutputEncoder' in scope
107 |     }
108 | }
error: emit-module command failed with exit code 1 (use -v to see invocation)
swift-aws-lambda-runtime/Sources/AWSLambdaRuntime/LambdaRuntime.swift:64:19: error: instance method '_run()' is internal and cannot be referenced from an '@inlinable' function
 62 |     @inlinable
 63 |     internal func run() async throws {
 64 |         try await _run()
    |                   `- error: instance method '_run()' is internal and cannot be referenced from an '@inlinable' function
 65 |     }
 66 |     #endif
    :
 68 |     /// Make sure only one run() is called at a time
 69 |     // @inlinable
 70 |     internal func _run() async throws {
    |                   `- note: instance method '_run()' is not '@usableFromInline' or public
 71 | 
 72 |         // we use an atomic global variable to ensure only one LambdaRuntime is running at the time

Metadata

Metadata

Assignees

Labels

kind/bugFeature doesn't work as expected.

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions