mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-06-02 07:27:33 +00:00
When including resources in the package and packaging on Ubuntu, `FileManager` throws a FilePermission error. The docker daemon runs as root and files to be copied are owned by `root` while the archiver runs as the current user (`ubuntu` on EC2 Ubuntu). The `FileManager` manages to copy the files but throws an error after the copy. We suspect the `FileManager` to perform some kind of operation after the copy and it fails because of the `root` permission of the files. See https://github.com/swift-server/swift-aws-lambda-runtime/issues/449#issuecomment-2595978246 for a description of the problem. This PR contains code to reproduce the problem, a very simple workaround, and an integration test. The workaround consists of - trapping all errors - verify if the error is the permission error (Code = 513) - verify if the files have been copied or not - if the two above conditions are met, ignore the error, otherwise re-throw it I would rather prefer a solution that solves the root cause rather than just ignoring the error. We're still investigating the root cause (see [this thread](https://forums.swift.org/t/filemanager-copyitem-on-linux-fails-after-copying-the-files/77282) on the Swift Forum and this issue on Swift Foundation https://github.com/swiftlang/swift-foundation/issues/1125
72 lines
2.8 KiB
YAML
72 lines
2.8 KiB
YAML
name: PR
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, reopened, synchronize]
|
|
|
|
jobs:
|
|
soundness:
|
|
name: Soundness
|
|
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
|
|
with:
|
|
license_header_check_project_name: "SwiftAWSLambdaRuntime"
|
|
shell_check_enabled: true
|
|
python_lint_check_enabled: true
|
|
api_breakage_check_container_image: "swift:6.0-noble"
|
|
docs_check_container_image: "swift:6.0-noble"
|
|
format_check_container_image: "swiftlang/swift:nightly-6.0-jammy"
|
|
yamllint_check_enabled: true
|
|
|
|
unit-tests:
|
|
name: Unit tests
|
|
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
|
|
with:
|
|
linux_5_9_enabled: false
|
|
linux_5_10_enabled: false
|
|
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
|
|
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
|
|
|
|
integration-tests:
|
|
name: Integration Tests
|
|
uses: ./.github/workflows/integration_tests.yml
|
|
with:
|
|
name: "Integration tests"
|
|
examples_enabled: true
|
|
matrix_linux_command: "LAMBDA_USE_LOCAL_DEPS=../.. swift build"
|
|
# We pass the list of examples here, but we can't pass an array as argument
|
|
# Instead, we pass a String with a valid JSON array.
|
|
# The workaround is mentioned here https://github.com/orgs/community/discussions/11692
|
|
examples: "[ 'APIGateway', 'APIGateway+LambdaAuthorizer', 'BackgroundTasks', 'HelloJSON', 'HelloWorld', 'ResourcesPackaging', 'S3_AWSSDK', 'S3_Soto', 'Streaming', 'Testing', 'Tutorial' ]"
|
|
archive_plugin_examples: "[ 'HelloWorld', 'ResourcesPackaging' ]"
|
|
archive_plugin_enabled: true
|
|
|
|
swift-6-language-mode:
|
|
name: Swift 6 Language Mode
|
|
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main
|
|
|
|
semver-label-check:
|
|
name: Semantic Version label check
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 1
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- name: Check for Semantic Version label
|
|
uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main
|
|
|
|
# until there is a support for musl in swiftlang/github-workflows
|
|
# https://github.com/swiftlang/github-workflows/issues/34
|
|
musl:
|
|
runs-on: ubuntu-latest
|
|
container: swift:6.0.2-noble
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
- name: Install SDK
|
|
run: swift sdk install https://download.swift.org/swift-6.0.2-release/static-sdk/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum aa5515476a403797223fc2aad4ca0c3bf83995d5427fb297cab1d93c68cee075
|
|
- name: Build
|
|
run: swift build --swift-sdk x86_64-swift-linux-musl
|