Skip to content

[6.1] Read stdout from sourcekit-lsp in binary mode instead of text mode #153

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

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Dec 11, 2024

Cherry-pick #151 to release/6.1.


self.process.stdout.read reads a number of Unicode characters, but the Content-Length specifies number of bytes. This started causing deterministic issues since swiftlang/sourcekit-lsp#1861 is logging messages from package loading, which contains emojis.

Switch stdout and stderr to binary mode and manually decode them into UTF-8 when needed.

`self.process.stdout.read` reads a number of Unicode characters, but the `Content-Length` specifies number of bytes. This started causing deterministic issues since swiftlang/sourcekit-lsp#1861 is logging messages from package loading, which contains emojis.

Switch `stdout` and `stderr` to binary mode and manually decode them into UTF-8 when needed.
@ahoppen ahoppen requested a review from bnbarham December 11, 2024 05:34
@ahoppen ahoppen merged commit 65f7d50 into swiftlang:release/6.1 Dec 11, 2024
@ahoppen ahoppen deleted the 6.1/read-binary-mode branch December 11, 2024 05:35
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.

1 participant