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

Progress cuts off prints to the terminal #20119

Closed
NicoElbers opened this issue May 29, 2024 · 6 comments
Closed

Progress cuts off prints to the terminal #20119

NicoElbers opened this issue May 29, 2024 · 6 comments
Labels
bug Observed behavior contradicts documented or intended behavior zig build system std.Build, the build runner, `zig build` subcommand, package management

Comments

@NicoElbers
Copy link
Contributor

Zig Version

0.13.0-dev.339+6b020c3d1

Steps to Reproduce and Observed Behavior

Create a template project using zig init

paste the following in src/main.zig

const std = @import("std");

pub fn main() !void {
    std.debug.print("0\n", .{});
    std.debug.print("1\n", .{});
    std.debug.print("2\n", .{});
    std.debug.print("3\n", .{});
    std.debug.print("4\n", .{});
    std.debug.print("5\n", .{});
    std.debug.print("6\n", .{});
    std.debug.print("7\n", .{});
    std.debug.print("8\n", .{});
    std.debug.print("9\n", .{});
    std.debug.print("10\n", .{});
}

Run zig build run

Your ouput should look something like this:

❯ zig build run           
[2/7] steps
└─ [5] zig build-exe ProgressObscuresLogging De
   └─ LLVM Emit Object
0
1
2
3
4
5
6
7

Notice that the "8", "9" and "10" prints are cut off.

From my testing the same holds true for printing to std out.

Expected Behavior

That all 10 debug print statements are successfully displayed in the terminal.

@NicoElbers NicoElbers added the bug Observed behavior contradicts documented or intended behavior label May 29, 2024
@nektro
Copy link
Contributor

nektro commented May 29, 2024

Related #18855

@Vexu
Copy link
Member

Vexu commented May 30, 2024

Cannot reproduce on Linux, are you on Windows perhaps #20105?

@Cloudef
Copy link
Contributor

Cloudef commented May 30, 2024

I can reproduce this with alacritty terminal on linux using zig 0.13.0-dev.340+d750a78b2
2024-05-30-152613_hyprshot

@Cloudef
Copy link
Contributor

Cloudef commented May 30, 2024

Removing cache and running again makes even more lines disappear, so it seems the amount of rows in the std.Progress output seems to affect it.
2024-05-30-152845_hyprshot

@Vexu
Copy link
Member

Vexu commented May 30, 2024

My bad, I was using zig run instead of zig build run.

@Vexu Vexu added zig build system std.Build, the build runner, `zig build` subcommand, package management regression It worked in a previous version of Zig, but stopped working. labels May 30, 2024
@Vexu Vexu added this to the 0.13.0 milestone May 30, 2024
andrewrk added a commit that referenced this issue May 31, 2024
The docs for setting stdio to "inherit" say:

It also means that this step will obtain a global lock to prevent other
steps from running in the meantime.

The implementation of this lock was missing but is now provided by this
commit.

closes #20119
@andrewrk
Copy link
Member

Duplicate of #18855

@andrewrk andrewrk marked this as a duplicate of #18855 May 31, 2024
@andrewrk andrewrk closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
@andrewrk andrewrk removed the regression It worked in a previous version of Zig, but stopped working. label May 31, 2024
@andrewrk andrewrk removed this from the 0.13.0 milestone May 31, 2024
andrewrk added a commit that referenced this issue May 31, 2024
The docs for setting stdio to "inherit" say:

It also means that this step will obtain a global lock to prevent other
steps from running in the meantime.

The implementation of this lock was missing but is now provided by this
commit.

closes #20119
Rexicon226 pushed a commit to Rexicon226/zig that referenced this issue Jun 9, 2024
The docs for setting stdio to "inherit" say:

It also means that this step will obtain a global lock to prevent other
steps from running in the meantime.

The implementation of this lock was missing but is now provided by this
commit.

closes ziglang#20119
ryoppippi pushed a commit to ryoppippi/zig that referenced this issue Jul 5, 2024
The docs for setting stdio to "inherit" say:

It also means that this step will obtain a global lock to prevent other
steps from running in the meantime.

The implementation of this lock was missing but is now provided by this
commit.

closes ziglang#20119
SammyJames pushed a commit to SammyJames/zig that referenced this issue Aug 7, 2024
The docs for setting stdio to "inherit" say:

It also means that this step will obtain a global lock to prevent other
steps from running in the meantime.

The implementation of this lock was missing but is now provided by this
commit.

closes ziglang#20119
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

No branches or pull requests

5 participants