Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not force unwrap stdout #398

Merged
merged 6 commits into from
Oct 10, 2024
Merged

do not force unwrap stdout #398

merged 6 commits into from
Oct 10, 2024

Conversation

sebsto
Copy link
Contributor

@sebsto sebsto commented Oct 8, 2024

Revert a change from #d2bd7f1aae1fc9455b208567ba5d85e42463c82c that caused the plugin to crash

-------------------------------------------------------------------------
building "test" in docker
-------------------------------------------------------------------------
updating "swift:amazonlinux2" docker image
  amazonlinux2: Pulling from library/swift
  Digest: sha256:089bb14fe09b24ed6ab1fb43379200b42ba9ce52a37889d3dc37cdd1e2d3fbb6
Status: Image is up to date for swift:amazonlinux2
  docker.io/library/swift:amazonlinux2
AWSLambdaPackager/PluginUtils.swift:35: Fatal error: Unexpectedly found nil while unwrapping an Optional value

Revert a change from #d2bd7f1aae1fc9455b208567ba5d85e42463c82c that caused the plugin to crash
@sebsto sebsto requested a review from fabianfett October 8, 2024 20:25
@@ -32,7 +32,7 @@ struct Utils {

let fd = dup(1)
let stdout = fdopen(fd, "rw")
defer { fclose(stdout!) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should change ci to use the released swift image here. I think the build issue happens with swift:6.0.0 and swift:6.0.1 but not 6.0-nightly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As much as I understand how it works in Swift-NIO, we can not give the container name as a parameter
https://github.com/apple/swift-nio/blob/main/.github/workflows/swift_6_language_mode.yml

That would be a change request for the Swift-NIO project

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with ! is not in the CI, it crashes the plugin when using it. We can not force unwrap, there are cases where stdout is nil

@sebsto sebsto merged commit bb9ddfb into main Oct 10, 2024
14 of 15 checks passed
@sebsto sebsto deleted the sebsto-patch-plugin branch October 14, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants