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

Include stderr in error reports for easier debugging #320

Merged

Conversation

JasonGross
Copy link
Member

@JasonGross JasonGross commented Oct 13, 2024

On top of #317
Fixes #318

Except I think it doesn't quite work in the current form

@JasonGross JasonGross force-pushed the no-leak-token+include-stderr branch from 6515568 to 7bcb9f7 Compare October 13, 2024 19:36
@JasonGross JasonGross marked this pull request as ready for review October 13, 2024 19:49
@JasonGross JasonGross force-pushed the no-leak-token+include-stderr branch from 7bcb9f7 to d410e69 Compare October 14, 2024 00:26
@JasonGross JasonGross force-pushed the no-leak-token+include-stderr branch from d410e69 to aa66477 Compare October 14, 2024 00:27
@JasonGross
Copy link
Member Author

@Zimmi48 Do you have any opinion on the implementation here? I've checked that it still emits stderr and stdout in the log, doesn't crash, etc.

Copy link
Member

@Zimmi48 Zimmi48 left a comment

Choose a reason for hiding this comment

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

I can't say that I understand precisely all the code (in particular the copy_stream function), but this looks good to me.

@JasonGross JasonGross merged commit 001a4ca into rocq-prover:master Oct 16, 2024
@JasonGross JasonGross deleted the no-leak-token+include-stderr branch October 16, 2024 17:39
@JasonGross
Copy link
Member Author

I can't say that I understand precisely all the code (in particular the copy_stream function), but this looks good to me.

copy_stream reads from a steam character by character, simultaneously saving it to a buffer and writing it to another stream. It was written mostly by claude.ai. It's possibly a bit overkill (we could just read from stdout and stderr all at once), but this version keeps them interleaved in the logs.

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.

execute_cmd should include process stderr when the exit code is not 0
2 participants