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

rework std.Progress #20059

Merged
merged 60 commits into from
May 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d6e8ba3
start reworking std.Progress
andrewrk May 3, 2024
e1e4de2
progress progress
andrewrk May 22, 2024
a3c9511
rework std.Progress again
andrewrk May 23, 2024
66c3b6a
fix terminal repainting
andrewrk May 23, 2024
582acdf
keep the cursor at the end instead of beginning
andrewrk May 23, 2024
67e08e7
fix clearing and sibling iteration
andrewrk May 23, 2024
ed36470
std.Progress: truncate trailing newline
andrewrk May 23, 2024
f071164
std.Progress: child process sends updates via IPC
andrewrk May 23, 2024
df46f5a
std.Progress: include subtrees from child processes
andrewrk May 24, 2024
3a768bd
std.Progress: save a copy of IPC data
andrewrk May 24, 2024
c01cfde
std.process.Child: fix ZIG_PROGRESS env var handling
andrewrk May 24, 2024
f6873c6
std.Progress: fix using saved IPC data
andrewrk May 24, 2024
f97c2f2
update the codebase for the new std.Progress API
andrewrk May 24, 2024
795c579
test runner: update to new std.Progress API
andrewrk May 24, 2024
a486392
std.Build.Step: don't create an empty progress node
andrewrk May 24, 2024
1cf1cb6
std.debug.Trace: follow the struct default field guidance
andrewrk May 24, 2024
b27fdf9
Compilation: only create progress nodes for work actually being done
andrewrk May 24, 2024
2233d95
main: avoid creating multiple std.Progress instances
andrewrk May 24, 2024
70e39c1
std.Progress: fixes
andrewrk May 24, 2024
352dc2c
compiler: show decl name in progress node
andrewrk May 24, 2024
2759173
zig build: lock stderr while executing the build runner
andrewrk May 24, 2024
516366f
std.Progress: skip printing root node when it is empty
andrewrk May 24, 2024
ca03c9c
std.Progress: fix race condition with IPC nodes
andrewrk May 24, 2024
9331da8
std.Build.Step.Run: don't create empty progress node
andrewrk May 24, 2024
acdf988
std.process.Child: prevent racing children from inheriting progress p…
mlugg May 26, 2024
d403d8c
Module: fix and improve progress reporting
mlugg May 26, 2024
d77f5e7
Progress: fix compile errors on windows
jacobly0 May 26, 2024
e8907f9
std.Progress: correct the top level doc comments
andrewrk May 26, 2024
e2e61f3
std.process.Child: comptime assert to protect prog_fileno
andrewrk May 26, 2024
e820173
Compilation: fix sub-compilations given wrong progress node
andrewrk May 26, 2024
eb718ce
std.process: fix compilation on 32-bit targets
andrewrk May 26, 2024
d3b03ed
frontend: fix use of undefined progress node
andrewrk May 26, 2024
7fe72d5
std.Progress: move global preallocations to thread memory
andrewrk May 26, 2024
807b613
std.Progress: move more global preallocations to thread memory
andrewrk May 26, 2024
52ed54d
std.Progress: truncate IPC data exceeding preallocated buffers
andrewrk May 26, 2024
11f8947
std.Progress: avoid scrolling the PS1 off the terminal
andrewrk May 27, 2024
ea7d8ec
std.Progress: smaller type for parents and robustify
andrewrk May 27, 2024
0ca2b4e
std.Progress: use std.log.debug rather than warn
andrewrk May 27, 2024
849693f
zig build: give a root progress name
andrewrk May 27, 2024
52ffdec
std.Progress: keep cursor on newline
andrewrk May 27, 2024
6145819
std.Progress: handle when terminal write buffer too small
andrewrk May 27, 2024
dc3a192
std.Progress: count newlines more accurately
andrewrk May 27, 2024
64c6a50
std.Progress: elide root node if empty
andrewrk May 27, 2024
c9587d3
CLI: add missing call to root progress node end()
andrewrk May 27, 2024
45b505c
std.process.cleanExit: lock stderr before exiting
andrewrk May 27, 2024
03073d6
build runner: use "configure" for the progress name
andrewrk May 27, 2024
0937992
resinator: update to new progress API
andrewrk May 27, 2024
a5e4fe5
std.Build.Step.Run: account for new environment variable
andrewrk May 27, 2024
eea7e5e
std.Progress: adjust the timings a little bit
andrewrk May 27, 2024
dcf9cae
std.Progress: handle big-endian targets
andrewrk May 27, 2024
2367a1f
std.Progress: handle short writes
andrewrk May 27, 2024
4438925
fix zig translate-c creating root progress node twice
andrewrk May 27, 2024
bb1f4d2
translate-c tests: skip_foreign_checks=true
andrewrk May 27, 2024
aca7feb
std.Progress: fix race condition with setIpcFd
andrewrk May 27, 2024
b7889f2
zig build: respect --color argument
andrewrk May 27, 2024
947a3a1
std.process.Child: fix spawning child proc with new cwd fd
andrewrk May 27, 2024
5bdfe22
CLI: actually fix translate-c creating root progress node twice
andrewrk May 28, 2024
65a0e14
std.Progress: relax some of the atomic orderings
andrewrk May 28, 2024
40afac4
std.Progress: Use Windows console API calls when ANSI escape codes ar…
squeek502 May 28, 2024
3a3d218
std.Progress: better Windows support
andrewrk May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resinator: update to new progress API
  • Loading branch information
andrewrk committed May 28, 2024
commit 0937992a14e9557da7d753f3c38070fe57583e33
4 changes: 2 additions & 2 deletions lib/compiler/resinator/cli.zig
Original file line number Diff line number Diff line change
@@ -108,8 +108,8 @@ pub const Diagnostics = struct {
}

pub fn renderToStdErr(self: *Diagnostics, args: []const []const u8, config: std.io.tty.Config) void {
std.debug.getStderrMutex().lock();
defer std.debug.getStderrMutex().unlock();
std.debug.lockStdErr();
defer std.debug.unlockStdErr();
const stderr = std.io.getStdErr().writer();
self.renderToWriter(args, stderr, config) catch return;
}
4 changes: 2 additions & 2 deletions lib/compiler/resinator/errors.zig
Original file line number Diff line number Diff line change
@@ -60,8 +60,8 @@ pub const Diagnostics = struct {
}

pub fn renderToStdErr(self: *Diagnostics, cwd: std.fs.Dir, source: []const u8, tty_config: std.io.tty.Config, source_mappings: ?SourceMappings) void {
std.debug.getStderrMutex().lock();
defer std.debug.getStderrMutex().unlock();
std.debug.lockStdErr();
defer std.debug.unlockStdErr();
const stderr = std.io.getStdErr().writer();
for (self.errors.items) |err_details| {
renderErrorMessage(self.allocator, stderr, tty_config, cwd, err_details, source, self.strings.items, source_mappings) catch return;
6 changes: 0 additions & 6 deletions lib/compiler/resinator/main.zig
Original file line number Diff line number Diff line change
@@ -50,12 +50,6 @@ pub fn main() !void {
},
};

if (zig_integration) {
// Send progress with a special string to indicate that the building of the
// resinator binary is finished and we've moved on to actually compiling the .rc file
try error_handler.server.serveStringMessage(.progress, "<resinator>");
}

var options = options: {
var cli_diagnostics = cli.Diagnostics.init(allocator);
defer cli_diagnostics.deinit();