-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Execution: Add stderr block #2397
Conversation
Hi @Alx-Lai, oh wow, this patch looks great! Thanks a lot for looking into this, I would very much like to have this feature implemented. I gave the PR a quick test run locally and this is how it looks: Screencast.from.2024-10-06.23-12-20.mp4This is nearly perfect. A few comments:
I looked briefly at the full Playground and discovered that they use a WebSocket now to stream the output line by line! They include markers to show if this is a I would be happy to merge this PR as a first step — I don't know how difficult it will be to adapt the |
Ok, I'll spend time looking into it. Thanks for the feedback! |
Add a stderr block. Pros: - we can make use of dbg macro in our code Cons: - there's a limitation that the compile message also shows To be improved: - compile message regex may change overtime - can use websocket to replace the current approach Applies patches from rust-lang/mdBook#1315 since the original change was not merged by rust-lang. Signed-off-by: Alx-Lai <[email protected]>
Updated the commit.
|
Hi @Alx-Lai, thanks for the update! I haven't forgotten about it, I'm just slow to review the change. I'll try asking internally if someone else can help review this. |
I just tested the updated version, and it works great! Screencast.from.2024-11-20.16-12-30.webm |
Thanks a lot, @gotoextreme! That's super helpful :) I think we can merge this now and then we'll soon have proper testing support (#2462) to ensure that things say stable as we refactor and extend this further. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, this is an exciting step forward! It will allow us to use dbg!
throughout the course, which I've wanted for a long time.
Hey @Alx-Lai, I saw this working when testing locally, but now that it's deployed to https://google.github.io/comprehensive-rust/, I see
every time I try running some code. Can you check if you see the same? If so, then we'll have to revert this for now and figure out what is happening. |
Reverts #2397 I'm seeing ``` POST https://play.rust-lang.org/execute 500 (Internal Server Error) ``` on every request when trying to run code in the Playground. I'm not sure why, but we need to revert this ASAP if others see the same.
I think we can add this again, please see #2503. |
Reverts #2479, which is a revert of #2397. I think the problem was not related to @Alx-Lai's change, the [Playground was slow](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/playground.20incident.202024-12-03) for everyone.
Add a stderr block.
Pros:
Applies patches from rust-lang/mdBook#1315 since the original change was not merged by rust-lang.
Issue: #531