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