Skip to content

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Oct 10, 2025

Exit the plugin when it receives an empty message.

rdar://160820381

Exit the plugin when it receives an empty message.

rdar://160820381
@rintaro
Copy link
Member Author

rintaro commented Oct 10, 2025

swiftlang/swift#84829
@swift-ci Please test

// Empty message is a termination signal.
if count == 0 {
return nil
}
Copy link
Member Author

@rintaro rintaro Oct 10, 2025

Choose a reason for hiding this comment

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

FWIW, not returning nil is still safe. try _read(into: data) is no-op, and JSON.decode() would throw an Error, then the caller would exit(1). This change just make it graceful immediate exit(0)

@rintaro
Copy link
Member Author

rintaro commented Oct 10, 2025

swiftlang/swift#84829
@swift-ci Please test Linux

2 similar comments
@rintaro
Copy link
Member Author

rintaro commented Oct 10, 2025

swiftlang/swift#84829
@swift-ci Please test Linux

@rintaro
Copy link
Member Author

rintaro commented Oct 10, 2025

swiftlang/swift#84829
@swift-ci Please test Linux


// Read the JSON payload.
let count = Int(UInt64(littleEndian: header))
// Empty message is a termination signal.
Copy link
Member

Choose a reason for hiding this comment

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

Is the compiler explicitly sending a message with header == 0 to indicate that the plugin process should exit?

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