| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const Maker = @This(); |
| 2 | |
| 2 | 3 | const builtin = @import("builtin"); |
| 3 | 4 | const native_os = builtin.os.tag; |
| 4 | 5 | |
| ... | ... | @@ -263,10 +264,17 @@ pub fn main(init: process.Init.Minimal) !void { |
| 263 | 264 | configure_argv.appendAssumeCapacity(arg); // Intentionally "--system" only; not the path. |
| 264 | 265 | } else if (mem.cutPrefix(u8, arg, "--color=")) |rest| { |
| 265 | 266 | color = stringToEnum(Color, rest) orelse |
| 266 | | fatal("expected --color=[auto|on|off]; found {q}", .{arg}); |
| 267 | fatalWithHint("expected --color=[auto|on|off]; found {q}", .{arg}); |
| 267 | 268 | |
| 268 | 269 | try cached_passthru_configure.append(arena, @intCast(configure_argv.items.len)); |
| 269 | 270 | configure_argv.appendAssumeCapacity(arg); |
| 271 | } else if (mem.eql(u8, arg, "--color")) { |
| 272 | const next_arg = nextArgOrFatal(args, &arg_i); |
| 273 | color = stringToEnum(Color, next_arg) orelse |
| 274 | fatalWithHint("expected [auto|on|off] found {q}", .{next_arg}); |
| 275 | |
| 276 | try cached_passthru_configure.append(arena, @intCast(configure_argv.items.len)); |
| 277 | configure_argv.appendAssumeCapacity(try allocPrint(arena, "--color={t}", .{color})); |
| 270 | 278 | } else if (mem.eql(u8, arg, "--cache-poison")) { |
| 271 | 279 | cache_poison = .poisoned; |
| 272 | 280 | configure_argv.appendAssumeCapacity("--cache-poison=poisoned"); |
| ... | ... | @@ -280,12 +288,16 @@ pub fn main(init: process.Init.Minimal) !void { |
| 280 | 288 | // Intentionally is added both to make and configure but |
| 281 | 289 | // does not go into the cache hash. |
| 282 | 290 | configure_argv.appendAssumeCapacity(arg); |
| 291 | graph.verbose = true; |
| 283 | 292 | } else if (mem.eql(u8, arg, "--search-prefix")) { |
| 284 | 293 | const prefix = nextArgOrFatal(args, &arg_i); |
| 294 | |
| 285 | 295 | // This argument is cache poisonous: it does not go into |
| 286 | 296 | // the cache and configurer must set the poison bit when |
| 287 | 297 | // choosing to observe it. |
| 288 | 298 | configure_argv.addManyAsArrayAssumeCapacity(2).* = .{ arg, prefix }; |
| 299 | |
| 300 | try graph.search_prefixes.append(arena, prefix); |
| 289 | 301 | } else if (mem.eql(u8, arg, "--cache-dir")) { |
| 290 | 302 | override_local_cache_dir = nextArgOrFatal(args, &arg_i); |
| 291 | 303 | } else if (mem.eql(u8, arg, "--pkg-dir")) { |
| ... | ... | @@ -361,18 +373,8 @@ pub fn main(init: process.Init.Minimal) !void { |
| 361 | 373 | .{ timeout_str, num_str, err }, |
| 362 | 374 | ); |
| 363 | 375 | test_timeout_ns = std.math.lossyCast(u64, unit_factor * num_parsed); |
| 364 | | } else if (mem.eql(u8, arg, "--search-prefix")) { |
| 365 | | try graph.search_prefixes.append(arena, nextArgOrFatal(args, &arg_i)); |
| 366 | 376 | } else if (mem.eql(u8, arg, "--libc")) { |
| 367 | 377 | graph.libc_file = nextArgOrFatal(args, &arg_i); |
| 368 | | } else if (mem.eql(u8, arg, "--color")) { |
| 369 | | const next_arg = nextArg(args, &arg_i) orelse |
| 370 | | fatalWithHint("expected [auto|on|off] after {q}", .{arg}); |
| 371 | | color = stringToEnum(Color, next_arg) orelse { |
| 372 | | fatalWithHint("expected [auto|on|off] after {q}, found {q}", .{ |
| 373 | | arg, next_arg, |
| 374 | | }); |
| 375 | | }; |
| 376 | 378 | } else if (mem.eql(u8, arg, "--error-style")) { |
| 377 | 379 | const next_arg = nextArg(args, &arg_i) orelse |
| 378 | 380 | fatalWithHint("expected style after {q}", .{arg}); |
| ... | ... | @@ -429,15 +431,13 @@ pub fn main(init: process.Init.Minimal) !void { |
| 429 | 431 | } else if (mem.eql(u8, arg, "--debug-rt")) { |
| 430 | 432 | graph.debug_compiler_runtime_libs = .Debug; |
| 431 | 433 | } else if (mem.cutPrefix(u8, arg, "--debug-rt=")) |rest| { |
| 432 | | graph.debug_compiler_runtime_libs = stringToEnum(std.builtin.OptimizeMode, rest) orelse |
| 434 | graph.debug_compiler_runtime_libs = stringToEnum(std.lang.OptimizeMode, rest) orelse |
| 433 | 435 | fatal("unrecognized optimization mode: {s}", .{rest}); |
| 434 | 436 | } else if (is_debug_mode and mem.eql(u8, arg, "--debug-maker-leaks")) { |
| 435 | 437 | debug_maker_leaks = true; |
| 436 | 438 | } else if (mem.eql(u8, arg, "--libc-runtimes") or mem.eql(u8, arg, "--glibc-runtimes")) { |
| 437 | 439 | // --glibc-runtimes was the old name of the flag; kept for compatibility for now. |
| 438 | 440 | graph.libc_runtimes_dir = nextArgOrFatal(args, &arg_i); |
| 439 | | } else if (mem.eql(u8, arg, "--verbose")) { |
| 440 | | graph.verbose = true; |
| 441 | 441 | } else if (mem.eql(u8, arg, "--verbose-air")) { |
| 442 | 442 | graph.verbose_air = true; |
| 443 | 443 | } else if (mem.eql(u8, arg, "--verbose-cc")) { |