| author | |
| committer | |
| log | fd63f57cd86ebcf1261b10d1a17e62d523e70981 |
| tree | 460fd0c0b77336e160a63cc969c8d40f9e9993d9 |
| parent | 7228dc0ef98633876344c00fbadcef319dd11257 |
makes the build system compile on 32 bit systems
bonus, also fix incorrectly passing advanced debug options to the maker
process which doesn't care about them6 files changed, 16 insertions(+), 7 deletions(-)
lib/compiler/Maker.zig+2-2| ... | ... | @@ -38,7 +38,7 @@ steps: []Step, |
| 38 | 38 | generated_files: []Path, |
| 39 | 39 | run_args: ?[]const []const u8, |
| 40 | 40 | |
| 41 | available_rss: usize, | |
| 41 | available_rss: u64, | |
| 42 | 42 | max_rss_is_default: bool, |
| 43 | 43 | max_rss_mutex: Io.Mutex, |
| 44 | 44 | skip_oom_steps: bool, |
| ... | ... | @@ -740,7 +740,7 @@ fn prepare(maker: *Maker, step_names: []const []const u8) !void { |
| 740 | 740 | { |
| 741 | 741 | // Check that we have enough memory to complete the build. |
| 742 | 742 | var any_problems = false; |
| 743 | var max_needed: usize = 0; | |
| 743 | var max_needed: u64 = 0; | |
| 744 | 744 | for (step_stack.keys()) |step_index| { |
| 745 | 745 | const make_step = maker.stepByIndex(step_index); |
| 746 | 746 | const conf_step = step_index.ptr(c); |
lib/compiler/Maker/Step/Run.zig+2-2| ... | ... | @@ -1460,7 +1460,7 @@ fn evalGeneric( |
| 1460 | 1460 | stderr_bytes = try multi_reader.toOwnedSlice(1); |
| 1461 | 1461 | } else { |
| 1462 | 1462 | var stdout_reader = stdout.readerStreaming(io, &.{}); |
| 1463 | const stdio_limit: Io.Limit = if (conf_run.stdio_limit.value) |x| .limited(x) else .unlimited; | |
| 1463 | const stdio_limit: Io.Limit = if (conf_run.stdio_limit.value) |x| .limited64(x) else .unlimited; | |
| 1464 | 1464 | stdout_bytes = stdout_reader.interface.allocRemaining(arena, stdio_limit) catch |err| switch (err) { |
| 1465 | 1465 | error.OutOfMemory => |e| return e, |
| 1466 | 1466 | error.ReadFailed => return stdout_reader.err.?, |
| ... | ... | @@ -1469,7 +1469,7 @@ fn evalGeneric( |
| 1469 | 1469 | } |
| 1470 | 1470 | } else if (child.stderr) |stderr| { |
| 1471 | 1471 | var stderr_reader = stderr.readerStreaming(io, &.{}); |
| 1472 | const stdio_limit: Io.Limit = if (conf_run.stdio_limit.value) |x| .limited(x) else .unlimited; | |
| 1472 | const stdio_limit: Io.Limit = if (conf_run.stdio_limit.value) |x| .limited64(x) else .unlimited; | |
| 1473 | 1473 | stderr_bytes = stderr_reader.interface.allocRemaining(arena, stdio_limit) catch |err| switch (err) { |
| 1474 | 1474 | error.OutOfMemory => |e| return e, |
| 1475 | 1475 | error.ReadFailed => return stderr_reader.err.?, |
lib/compiler/configurer.zig+1-1| ... | ... | @@ -1074,7 +1074,7 @@ fn serialize(b: *std.Build, wc: *Configuration.Wip, writer: *Io.Writer) !void { |
| 1074 | 1074 | } else null }, |
| 1075 | 1075 | .environ_map = .{ .value = try s.addEnvironMap(run.environ_map) }, |
| 1076 | 1076 | .expect_term_value = .{ .value = if (expect_term) |t| t.value else null }, |
| 1077 | .stdio_limit = .{ .value = run.stdio_limit.toInt() }, | |
| 1077 | .stdio_limit = .{ .value = run.stdio_limit.toInt64() }, | |
| 1078 | 1078 | .producer = .{ .value = if (run.producer) |cs| s.stepIndex(&cs.step) else null }, |
| 1079 | 1079 | .expect_stderr_exact = .{ .value = if (expect_stderr_exact) |bytes| bytes else null }, |
| 1080 | 1080 | .expect_stdout_exact = .{ .value = if (expect_stdout_exact) |bytes| bytes else null }, |
lib/std/Build/Configuration.zig+2-2| ... | ... | @@ -1458,12 +1458,12 @@ pub const MaxRss = enum(u32) { |
| 1458 | 1458 | none = 0, |
| 1459 | 1459 | _, |
| 1460 | 1460 | |
| 1461 | pub fn toBytes(mr: MaxRss) usize { | |
| 1461 | pub fn toBytes(mr: MaxRss) u64 { | |
| 1462 | 1462 | const x: usize = @intFromEnum(mr); |
| 1463 | 1463 | return x << 8; |
| 1464 | 1464 | } |
| 1465 | 1465 | |
| 1466 | pub fn fromBytes(bytes: usize) MaxRss { | |
| 1466 | pub fn fromBytes(bytes: u64) MaxRss { | |
| 1467 | 1467 | return @enumFromInt(bytes >> 8); |
| 1468 | 1468 | } |
| 1469 | 1469 | }; |
lib/std/Io.zig+7| ... | ... | @@ -689,6 +689,13 @@ pub const Limit = enum(usize) { |
| 689 | 689 | }; |
| 690 | 690 | } |
| 691 | 691 | |
| 692 | pub fn toInt64(l: Limit) ?u64 { | |
| 693 | return switch (l) { | |
| 694 | else => @intFromEnum(l), | |
| 695 | .unlimited => null, | |
| 696 | }; | |
| 697 | } | |
| 698 | ||
| 692 | 699 | /// Reduces a slice to account for the limit, leaving room for one extra |
| 693 | 700 | /// byte above the limit, allowing for the use case of differentiating |
| 694 | 701 | /// between end-of-stream and reaching the limit. |
src/main.zig+2| ... | ... | @@ -5133,6 +5133,7 @@ fn cmdBuild( |
| 5133 | 5133 | } else { |
| 5134 | 5134 | warn("Zig was compiled without debug extensions. --debug-target has no effect.", .{}); |
| 5135 | 5135 | } |
| 5136 | continue; | |
| 5136 | 5137 | } else if (mem.eql(u8, arg, "--debug-libc")) { |
| 5137 | 5138 | if (i + 1 >= args.len) fatal("expected argument after '{s}'", .{arg}); |
| 5138 | 5139 | i += 1; |
| ... | ... | @@ -5141,6 +5142,7 @@ fn cmdBuild( |
| 5141 | 5142 | } else { |
| 5142 | 5143 | warn("Zig was compiled without debug extensions. --debug-libc has no effect.", .{}); |
| 5143 | 5144 | } |
| 5145 | continue; | |
| 5144 | 5146 | } else if (mem.eql(u8, arg, "--verbose-link")) { |
| 5145 | 5147 | verbose_link = true; |
| 5146 | 5148 | } else if (mem.eql(u8, arg, "--verbose-cc")) { |