Skip to content

Dup and redirect stdout to defend against accidental print() #296

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
Jul 21, 2020

Conversation

benlangmuir
Copy link
Contributor

We currently have a regression where sourcekit-lsp stops working in
some packages, because swiftpm started printing a warning to stdout.
While we should also fix swiftpm, it behooves us to be more robust in
sourcekit-lsp in case this happens again. Dup stdout for use by the
protocol, and redirect the stdout file descriptor to stderr, which does
not interfere with the protocol.

We currently have a regression where sourcekit-lsp stops working  in
some packages, because swiftpm started printing a warning to stdout.
While we should also fix swiftpm, it behooves us to be more robust in
sourcekit-lsp in case this happens again. Dup stdout for use by the
protocol, and redirect the stdout file descriptor to stderr, which does
not interfere with the protocol.
@benlangmuir
Copy link
Contributor Author

@swift-ci please test

@benlangmuir
Copy link
Contributor Author

@swift-ci please build toolchain

@benlangmuir benlangmuir merged commit 21df377 into swiftlang:master Jul 21, 2020
@benlangmuir benlangmuir deleted the dup-dup2-duparoo branch July 21, 2020 16:07
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