mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-06-01 22:05:26 +03:00
zig build: make --error-limit globally configurable
still overridable by individual Compile steps
This commit is contained in:
@@ -390,6 +390,10 @@ pub fn main(init: process.Init.Minimal) !void {
|
||||
fatal("unable to parse reference_trace count {q}: {t}", .{ num, err });
|
||||
} else if (mem.eql(u8, arg, "-fno-reference-trace")) {
|
||||
graph.reference_trace = null;
|
||||
} else if (mem.eql(u8, arg, "--error-limit")) {
|
||||
const next_arg = nextArgOrFatal(args, &arg_idx);
|
||||
graph.error_limit = std.fmt.parseUnsigned(u32, next_arg, 0) catch |err|
|
||||
fatal("unable to parse error limit {q}: {t}", .{ next_arg, err });
|
||||
} else if (mem.cutPrefix(u8, arg, "-j")) |text| {
|
||||
const n = std.fmt.parseUnsigned(u32, text, 10) catch |err|
|
||||
fatal("unable to parse jobs count {q}: {t}", .{ text, err });
|
||||
@@ -1838,6 +1842,7 @@ const ScannedConfig = struct {
|
||||
\\ -fno-reference-trace Disable reference trace
|
||||
\\ -fallow-so-scripts Allows .so files to be GNU ld scripts
|
||||
\\ -fno-allow-so-scripts (default) .so files must be ELF files
|
||||
\\ --error-limit [num] Set the maximum amount of distinct error values
|
||||
\\ --build-file [file] Override path to build.zig
|
||||
\\ --cache-dir [path] Override path to local Zig cache directory
|
||||
\\ --global-cache-dir [path] Override path to global Zig cache directory
|
||||
|
||||
@@ -43,3 +43,4 @@ libc_file: ?[]const u8 = null,
|
||||
sysroot: ?[]const u8 = null,
|
||||
search_prefixes: std.ArrayList([]const u8) = .empty,
|
||||
build_id: ?std.zig.BuildId = null,
|
||||
error_limit: ?u32 = null,
|
||||
|
||||
@@ -759,7 +759,7 @@ fn lowerZigArgs(
|
||||
try zig_args.append(gpa, "-municode");
|
||||
}
|
||||
|
||||
if (compile.error_limit) |err_limit| try zig_args.appendSlice(gpa, &.{
|
||||
if (compile.error_limit orelse graph.error_limit) |err_limit| try zig_args.appendSlice(gpa, &.{
|
||||
"--error-limit", try allocPrint(arena, "{d}", .{err_limit}),
|
||||
});
|
||||
|
||||
|
||||
@@ -224,8 +224,8 @@ generated_llvm_bc: ?*GeneratedFile,
|
||||
generated_llvm_ir: ?*GeneratedFile,
|
||||
generated_h: ?*GeneratedFile,
|
||||
|
||||
/// The maximum number of distinct errors within a compilation step
|
||||
/// Defaults to `std.math.maxInt(u16)`
|
||||
/// The maximum number of distinct errors within a compilation step Defaults to
|
||||
/// `std.math.maxInt(u16)`. Overrides the argument passed to `zig build`.
|
||||
error_limit: ?u32 = null,
|
||||
|
||||
/// Computed during make().
|
||||
|
||||
Reference in New Issue
Block a user