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

The build runner doesn't clear the progress line when running zig build run #18855

Closed
mikastiv opened this issue Feb 7, 2024 · 1 comment · Fixed by #20140
Closed

The build runner doesn't clear the progress line when running zig build run #18855

mikastiv opened this issue Feb 7, 2024 · 1 comment · Fixed by #20140
Labels
bug Observed behavior contradicts documented or intended behavior zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@mikastiv
Copy link

mikastiv commented Feb 7, 2024

Zig Version

v0.12.0-dev.2641+ee36131e6

Steps to Reproduce and Observed Behavior

The output of the build runner after running zig build run is mixed with the executable output when it needs to compile files

Repro steps:

  • Create a new zig project with zig init
  • Execute zig build run
  • Observe the output

I get this:

~/zigdev/playground via ↯ v0.12.0-dev.2641+ee36131e6
❯ zig build run
steps [25/29] zig build-exe playground Debug native... LLVM Emit Object... All your codebase are belong to us.
Run `zig build test` to run the tests.

I reproduce this on windows 10 and WSL with both VSCode's terminal and the Windows Terminal; On macOS Catalina with iTerm and also on Linux with kitty

Expected Behavior

I would expect the build runner output to be cleared.

~/zigdev/playground via ↯ v0.12.0-dev.2641+ee36131e6
❯ zig build run
All your codebase are belong to us.
Run `zig build test` to run the tests.
@mikastiv mikastiv added the bug Observed behavior contradicts documented or intended behavior label Feb 7, 2024
@mikastiv mikastiv changed the title The build runner doesn't clear the progress line before running a step The build runner doesn't clear the progress line before running zig build run Feb 7, 2024
@mikastiv mikastiv changed the title The build runner doesn't clear the progress line before running zig build run The build runner doesn't clear the progress line when running zig build run Feb 7, 2024
@mikastiv
Copy link
Author

mikastiv commented Feb 8, 2024

I looked around a bit in the code and from what I understood, the "run step" itself depends on running the executable. So it waits for it to finish execution before clearing the line, but when the executable exits, stdout already has printed lines in the terminal.

The best I was able to get by calling refresh() on progress nodes is:

~/zigdev/playground via ↯ v0.12.0-dev.2641+ee36131e6
❯ zig build run
steps [28/29] run playground All your codebase are belong to us.
Run `zig build test` to run the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants