diff --git a/lib/compiler/Maker.zig b/lib/compiler/Maker.zig index 12df472dea24af6477265bbd9e922542db8a8757..bde0e08ef07b36ef113e0500238ec2101802c726 100644 --- a/lib/compiler/Maker.zig +++ b/lib/compiler/Maker.zig @@ -23,6 +23,7 @@ const Color = std.zig.Color; const Client = std.zig.Client; const Server = std.zig.Server; const EnvVar = std.zig.EnvVar; +const ErrorBundle = std.zig.ErrorBundle; const default_local_zig_cache_basename = std.zig.default_local_zig_cache_basename; const stringToEnum = std.meta.stringToEnum; @@ -35,6 +36,7 @@ const ScannedConfig = @import("Maker/ScannedConfig.zig"); const PkgConfig = @import("Maker/PkgConfig.zig"); const Fetch = @import("Maker/Fetch.zig"); const Package = @import("Maker/Package.zig"); +const Manifest = Package.Manifest; pub const std_options: std.Options = .{ .side_channels_mitigations = .none, @@ -601,10 +603,16 @@ pub fn main(init: process.Init.Minimal) !void { const cwd_path = std.zig.getResolvedCwd(io, arena) catch |err| fatal("resolving current directory path failed: {t}", .{err}); - var build_root = try findBuildRoot(arena, io, .{ + var build_root = findBuildRoot(arena, io, .{ .cwd_path = cwd_path, .build_file = build_file, - }); + }) catch |err| switch (err) { + error.BuildZigNotFound => { + if (help_menu) printUsageWithoutConfiguration(&graph, "build.zig not found"); + process.exit(1); + }, + else => |e| return e, + }; defer build_root.deinit(io); graph.build_root_directory = build_root.directory; @@ -740,7 +748,7 @@ pub fn main(init: process.Init.Minimal) !void { var configure_source_files: Cache.Manifest.SelfContainedFiles = .empty; defer configure_source_files.deinit(gpa); - var configure_error_bundle: std.zig.ErrorBundle = .empty; + var configure_error_bundle: ErrorBundle = .empty; defer configure_error_bundle.deinit(gpa); // If this fails, we can still start the server and wait for user @@ -1042,7 +1050,10 @@ pub fn main(init: process.Init.Minimal) !void { } else |err| { const can_fs_watch = switch (err) { error.AlreadyReported => false, - error.FailedButCacheIntact => true, + error.FailedButCacheIntact => c: { + if (help_menu) printUsageWithoutConfiguration(&graph, "build.zig compilation failure"); + break :c true; + }, else => |e| w: { log.err("configuration failed: {t}", .{e}); break :w false; @@ -1064,6 +1075,17 @@ pub fn main(init: process.Init.Minimal) !void { } } +fn printUsageWithoutConfiguration(graph: *Graph, reason: []const u8) noreturn { + const io = graph.io; + _ = io.lockStderr(&.{}, graph.stderr_mode) catch {}; + const writer = initStdoutWriter(io); + ScannedConfig.printUsageWithoutConfiguration(graph.zig_exe, writer, reason) catch |err| switch (err) { + error.WriteFailed => fatal("failed writing to stdout: {t}", .{stdout_writer_allocation.err.?}), + }; + stdout_writer_allocation.flush() catch |err| fatal("failed writing to stdout: {t}", .{err}); + return process.exit(0); +} + /// Temporarily adds the reconfigure pseudostep to step_stack, calls /// `Watch.update`, and then pops it again. fn updateWatch(maker: *Maker, watch: *Watch) !void { @@ -1091,7 +1113,7 @@ const ConfigureOptions = struct { print_configuration: PrintConfiguration, forks: []Fork, src_files: *Cache.Manifest.SelfContainedFiles, - error_bundle: ?*std.zig.ErrorBundle = null, + error_bundle: ?*ErrorBundle = null, }; fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig { @@ -1402,7 +1424,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig { for (fetches) |f| { if (!f.have_manifest) continue; if (config_man) |man| { - const manifest_path = try f.package_root.join(arena, Package.Manifest.basename); + const manifest_path = try f.package_root.join(arena, Manifest.basename); _ = try man.addInputPath(manifest_path, .{}); } const mod = f.cli_module orelse continue; @@ -1932,8 +1954,8 @@ fn cmdFetch(gpa: Allocator, graph: *Graph, args: []const []const u8) !void { try ast.render(gpa, &aw.writer, fixups); const rendered = aw.written(); - build_root.directory.handle.writeFile(io, .{ .sub_path = Package.Manifest.basename, .data = rendered }) catch |err| { - fatal("unable to write {s} file: {t}", .{ Package.Manifest.basename, err }); + build_root.directory.handle.writeFile(io, .{ .sub_path = Manifest.basename, .data = rendered }) catch |err| { + fatal("unable to write {s} file: {t}", .{ Manifest.basename, err }); }; return process.cleanExit(io); @@ -2135,7 +2157,7 @@ fn cmdInit(gpa: Allocator, graph: *Graph, args: []const []const u8) !void { const s = Dir.path.sep_str; const template_paths = [_][]const u8{ default_build_zig_basename, - Package.Manifest.basename, + Manifest.basename, "src" ++ s ++ "main.zig", "src" ++ s ++ "root.zig", }; @@ -2159,7 +2181,7 @@ fn cmdInit(gpa: Allocator, graph: *Graph, args: []const []const u8) !void { return process.cleanExit(io); }, .minimal => { - Templates.writeSimpleFile(io, Io.Dir.cwd(), Package.Manifest.basename, + Templates.writeSimpleFile(io, Io.Dir.cwd(), Manifest.basename, \\.{{ \\ .name = .{s}, \\ .version = "0.0.1", @@ -2173,8 +2195,8 @@ fn cmdInit(gpa: Allocator, graph: *Graph, args: []const []const u8) !void { builtin.zig_version_string, fingerprint.int(), }) catch |err| switch (err) { - else => fatal("failed to create {q}: {t}", .{ Package.Manifest.basename, err }), - error.PathAlreadyExists => fatal("refusing to overwrite {q}", .{Package.Manifest.basename}), + else => fatal("failed to create {q}: {t}", .{ Manifest.basename, err }), + error.PathAlreadyExists => fatal("refusing to overwrite {q}", .{Manifest.basename}), }; Templates.writeSimpleFile(io, Io.Dir.cwd(), default_build_zig_basename, \\const std = @import("std"); @@ -2189,12 +2211,12 @@ fn cmdInit(gpa: Allocator, graph: *Graph, args: []const []const u8) !void { // their `build.zig.zon` *after* writing their `build.zig`. So this one isn't fatal. error.PathAlreadyExists => { log.info("successfully populated {q}, preserving existing {q}", .{ - Package.Manifest.basename, default_build_zig_basename, + Manifest.basename, default_build_zig_basename, }); return process.cleanExit(io); }, }; - log.info("successfully populated {q} and {q}", .{ Package.Manifest.basename, default_build_zig_basename }); + log.info("successfully populated {q} and {q}", .{ Manifest.basename, default_build_zig_basename }); return process.cleanExit(io); }, } @@ -3277,7 +3299,7 @@ pub fn invalidateResult(maker: *Maker, step: *Step) error{MustReconfigure}!bool pub fn printErrorMessages( maker: *Maker, failing_step_index: Configuration.Step.Index, - options: std.zig.ErrorBundle.RenderOptions, + options: ErrorBundle.RenderOptions, stderr: Io.Terminal, error_style: ErrorStyle, multiline_errors: MultilineErrors, @@ -4037,7 +4059,9 @@ const FindBuildRootOptions = struct { cwd_path: []const u8, }; -fn findBuildRoot(arena: Allocator, io: Io, options: FindBuildRootOptions) !BuildRoot { +const FindBuildRootError = error{ OutOfMemory, BuildZigNotFound }; + +fn findBuildRoot(arena: Allocator, io: Io, options: FindBuildRootOptions) FindBuildRootError!BuildRoot { const build_zig_basename = if (options.build_file) |bf| Dir.path.basename(bf) else @@ -4088,11 +4112,12 @@ fn findBuildRoot(arena: Allocator, io: Io, options: FindBuildRootOptions) !Build dirname = Dir.path.dirname(dirname orelse options.cwd_path) orelse { log.info("initialize {s} template file with \"zig init\"", .{std.zig.build_zig_basename}); log.info("see \"zig --help\" for more options", .{}); - fatal("no build.zig file found, in the current directory or any parent directories", .{}); + log.err("no build.zig file found, in the current directory or any parent directories", .{}); + return error.BuildZigNotFound; }; continue; }, - else => |e| return e, + else => |e| fatal("accessing {q} while searching for build.zig file failed: {t}", .{ joined_path, e }), } } } @@ -4100,8 +4125,8 @@ fn findBuildRoot(arena: Allocator, io: Io, options: FindBuildRootOptions) !Build const Fork = struct { path: Path, manifest_ast: std.zig.Ast, - manifest: Package.Manifest, - error_bundle: std.zig.ErrorBundle.Wip, + manifest: Manifest, + error_bundle: ErrorBundle.Wip, failed: bool, arena_allocator: std.heap.ArenaAllocator, @@ -4134,12 +4159,12 @@ const Fork = struct { fork.arena_allocator = .init(gpa); const arena = fork.arena_allocator.allocator(); - var error_bundle: std.zig.ErrorBundle.Wip = try .init(gpa); + var error_bundle: ErrorBundle.Wip = try .init(gpa); defer error_bundle.deinit(); - const manifest_path = try fork.path.join(arena, Package.Manifest.basename); + const manifest_path = try fork.path.join(arena, Manifest.basename); - Package.Manifest.load( + Manifest.load( io, arena, manifest_path, @@ -4189,20 +4214,20 @@ fn loadManifest( arena: Allocator, io: Io, options: LoadManifestOptions, -) !struct { Package.Manifest, std.zig.Ast } { +) !struct { Manifest, std.zig.Ast } { const rng: std.Random.IoSource = .{ .io = io }; const manifest_bytes = while (true) { break options.dir.readFileAllocOptions( io, - Package.Manifest.basename, + Manifest.basename, arena, - .limited(Package.Manifest.max_bytes), + .limited(Manifest.max_bytes), .@"1", 0, ) catch |err| switch (err) { error.FileNotFound => { - Templates.writeSimpleFile(io, options.dir, Package.Manifest.basename, + Templates.writeSimpleFile(io, options.dir, Manifest.basename, \\.{{ \\ .name = .{s}, \\ .version = "0.0.1", @@ -4216,29 +4241,29 @@ fn loadManifest( builtin.zig_version_string, Package.Fingerprint.generate(rng.interface(), options.root_name).int(), }) catch |e| { - fatal("unable to write {s}: {t}", .{ Package.Manifest.basename, e }); + fatal("unable to write {s}: {t}", .{ Manifest.basename, e }); }; continue; }, - else => |e| fatal("unable to load {s}: {t}", .{ Package.Manifest.basename, e }), + else => |e| fatal("unable to load {s}: {t}", .{ Manifest.basename, e }), }; }; var ast = try std.zig.Ast.parse(gpa, manifest_bytes, .{ .mode = .zon }); errdefer ast.deinit(gpa); if (ast.errors.len > 0) { - try std.zig.printAstErrorsToStderr(gpa, io, ast, Package.Manifest.basename, options.color); + try std.zig.printAstErrorsToStderr(gpa, io, ast, Manifest.basename, options.color); process.exit(2); } - var manifest = try Package.Manifest.parse(gpa, &ast, rng.interface(), .{}); + var manifest = try Manifest.parse(gpa, &ast, rng.interface(), .{}); errdefer manifest.deinit(gpa); if (manifest.errors.len > 0) { - var wip_errors: std.zig.ErrorBundle.Wip = try .init(gpa); + var wip_errors: ErrorBundle.Wip = try .init(gpa); defer wip_errors.deinit(); - const src_path = try wip_errors.addString(Package.Manifest.basename); + const src_path = try wip_errors.addString(Manifest.basename); try manifest.copyErrorsIntoBundle(ast, src_path, &wip_errors); var error_bundle = try wip_errors.toOwnedBundle(""); @@ -4262,8 +4287,8 @@ fn sanitizeExampleName(arena: Allocator, bytes: []const u8) error{OutOfMemory}![ else => continue, }; if (!std.zig.isValidId(result.items)) return "foo"; - if (result.items.len > Package.Manifest.max_name_len) - result.shrinkRetainingCapacity(Package.Manifest.max_name_len); + if (result.items.len > Manifest.max_name_len) + result.shrinkRetainingCapacity(Manifest.max_name_len); return result.toOwnedSlice(arena); } diff --git a/lib/compiler/Maker/ScannedConfig.zig b/lib/compiler/Maker/ScannedConfig.zig index 0b98a78d877b69c06f9b8fdd5da3d9efa178abb2..0508ba14cac46577cf87e964cb82fcf1448df189 100644 --- a/lib/compiler/Maker/ScannedConfig.zig +++ b/lib/compiler/Maker/ScannedConfig.zig @@ -238,6 +238,18 @@ pub fn printSteps(sc: *const ScannedConfig, graph: *Graph, w: *Writer) !void { } } +pub fn printUsageWithoutConfiguration(zig_exe: []const u8, w: *Writer, reason: []const u8) Writer.Error!void { + try w.print( + \\Usage: {s} build [steps] [options] + \\ + \\Steps: (unavailable due to {s}) + \\Project-Specific Options: (unavailable due to {s}) + \\{s} + \\ (unavailable due to {s}) + \\{s} + , .{ zig_exe, reason, reason, system_integration_usage, reason, general_usage }); +} + pub fn printUsage(sc: *const ScannedConfig, graph: *Graph, w: *Writer) !void { const arena = graph.arena; @@ -274,37 +286,7 @@ pub fn printUsage(sc: *const ScannedConfig, graph: *Graph, w: *Writer) !void { } } - try w.writeAll( - \\ - \\System Integration Options: - \\ --search-prefix [path] Add a path to look for binaries, libraries, headers - \\ --sysroot [path] Set the system root directory (usually /) - \\ --libc [file] Provide a file which specifies libc paths - \\ - \\ --system [pkgdir] Disable package fetching; enable all integrations - \\ -fsys=[name] Enable a system integration - \\ -fno-sys=[name] Disable a system integration - \\ - \\ -fdarling, -fno-darling Integration with system-installed Darling to - \\ execute macOS programs on Linux hosts - \\ (default: no) - \\ -fqemu, -fno-qemu Integration with system-installed QEMU to execute - \\ foreign-architecture programs on Linux hosts - \\ (default: no) - \\ --libc-runtimes [path] Enhances QEMU integration by providing dynamic libc - \\ (e.g. glibc or musl) built for multiple foreign - \\ architectures, allowing execution of non-native - \\ programs that link with libc. - \\ -frosetta, -fno-rosetta Rely on Rosetta to execute x86_64 programs on - \\ ARM64 macOS hosts. (default: no) - \\ -fwasmtime, -fno-wasmtime Integration with system-installed wasmtime to - \\ execute WASI binaries. (default: no) - \\ -fwine, -fno-wine Integration with system-installed Wine to execute - \\ Windows programs on Linux hosts. (default: no) - \\ - \\ Available System Integrations: Enabled: - \\ - ); + try w.writeAll(system_integration_usage); if (sc.configuration.system_integrations.len == 0) { try w.writeAll(" (none) -\n"); } else { @@ -318,92 +300,127 @@ pub fn printUsage(sc: *const ScannedConfig, graph: *Graph, w: *Writer) !void { } } - try w.writeAll( - \\ - \\General Options: - \\ -h, --help Print this help to stdout and exit - \\ -l, --list-steps Print available steps to stdout and exit - \\ - \\ -p, --prefix [path] Where to install files (default: zig-out) - \\ --prefix-lib-dir [path] Where to install libraries - \\ --prefix-exe-dir [path] Where to install executables - \\ --prefix-include-dir [path] Where to install C header files - \\ --release[=mode] Request release mode, optionally specifying a - \\ preferred optimization mode: fast, safe, small - \\ - \\ --verbose Print commands before executing them - \\ --color [auto|off|on] Enable or disable colored error messages - \\ --error-style [style] Control how build errors are printed - \\ verbose (Default) Report errors with full context - \\ minimal Report errors after summary, excluding context like command lines - \\ verbose_clear Like 'verbose', but clear the terminal at the start of each update - \\ minimal_clear Like 'minimal', but clear the terminal at the start of each update - \\ --multiline-errors [style] Control how multi-line error messages are printed - \\ indent (Default) Indent non-initial lines to align with initial line - \\ newline Include a leading newline so that the error message is on its own lines - \\ none Print as usual so the first line is misaligned - \\ --summary [mode] Control the printing of the build summary - \\ all Print the build summary in its entirety - \\ new Omit cached steps - \\ failures (Default if short-lived) Only print failed steps - \\ line (Default if long-lived) Only print the single-line summary - \\ none Do not print the build summary - \\ -j Limit concurrent jobs (default is to use all CPU cores) - \\ --maxrss Limit memory usage (default is to use available memory) - \\ --skip-oom-steps Instead of failing, skip steps that would exceed --maxrss - \\ --test-timeout Limit execution time of unit tests, terminating if exceeded. - \\ The timeout must include a unit: ns, us, ms, s, m, h - \\ --watch Continuously rebuild when source files are modified - \\ --debounce Delay before rebuilding after changed file detected - \\ --webui[=ip] Enable the web interface on the given IP address - \\ --fuzz[=limit] Continuously search for unit test failures with an optional - \\ limit to the max number of iterations. The argument supports - \\ an optional 'K', 'M', or 'G' suffix (e.g. '10K'). Implies - \\ '--webui' when no limit is specified. - \\ --listen=- Enable the build server protocol on stdio - \\ --time-report Force full rebuild and provide detailed information on - \\ compilation time of Zig source code (implies '--webui') - \\ -fincremental Enable incremental compilation - \\ -fno-incremental Disable incremental compilation - \\ - \\Package Management Options: - \\ --fetch[=mode] Fetch dependency tree (optionally choose laziness) and exit - \\ needed (Default) Lazy dependencies are fetched as needed - \\ all Lazy dependencies are always fetched - \\ --fork=[path], --fork [path] Override one or more projects from dependency tree - \\ - \\Advanced Options: - \\ -freference-trace[=num] How many lines of reference trace should be shown per compile error - \\ -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 - \\ --zig-lib=[arg] Override path to Zig lib directory - \\ --seed [integer] For shuffling dependency traversal order (default: random) - \\ --cache-poison[=mode] Override configuration caching behavior - \\ pure (default) Avoid false positive cache hits - \\ poisoned Don't cache the configuration - \\ disallowed Panics when cache would be poisoned - \\ ignored A little poison never hurt anybody - \\ --print-configuration Render configuration as .zon to stdout - \\ --print-configuration-path Print the path to the binary configuration file to stdout - \\ --build-id[=style] At a minor link-time expense, embeds a build ID in binaries - \\ fast 8-byte non-cryptographic hash (COFF, ELF, WASM) - \\ sha1, tree 20-byte cryptographic hash (ELF, WASM) - \\ md5 16-byte cryptographic hash (ELF) - \\ uuid 16-byte random UUID (ELF, WASM) - \\ 0x[hexstring] Constant ID, maximum 32 bytes (ELF, WASM) - \\ none (default) No build ID - \\ --debug-log [scope] Enable debugging the compiler - \\ --debug-pkg-config Fail if unknown pkg-config flags encountered - \\ --verbose-link Enable compiler debug output for linking - \\ --verbose-air Enable compiler debug output for Zig AIR - \\ --verbose-llvm-ir Enable compiler debug output for LLVM IR - \\ --verbose-cimport Enable compiler debug output for C imports - \\ --verbose-cc Enable compiler debug output for C compilation - \\ --verbose-llvm-cpu-features Enable compiler debug output for LLVM CPU features - \\ - ); + try w.writeAll(general_usage); +} + +const system_integration_usage = + \\ + \\System Integration Options: + \\ --search-prefix [path] Add a path to look for binaries, libraries, headers + \\ --sysroot [path] Set the system root directory (usually /) + \\ --libc [file] Provide a file which specifies libc paths + \\ + \\ --system [pkgdir] Disable package fetching; enable all integrations + \\ -fsys=[name] Enable a system integration + \\ -fno-sys=[name] Disable a system integration + \\ + \\ -fdarling, -fno-darling Integration with system-installed Darling to + \\ execute macOS programs on Linux hosts + \\ (default: no) + \\ -fqemu, -fno-qemu Integration with system-installed QEMU to execute + \\ foreign-architecture programs on Linux hosts + \\ (default: no) + \\ --libc-runtimes [path] Enhances QEMU integration by providing dynamic libc + \\ (e.g. glibc or musl) built for multiple foreign + \\ architectures, allowing execution of non-native + \\ programs that link with libc. + \\ -frosetta, -fno-rosetta Rely on Rosetta to execute x86_64 programs on + \\ ARM64 macOS hosts. (default: no) + \\ -fwasmtime, -fno-wasmtime Integration with system-installed wasmtime to + \\ execute WASI binaries. (default: no) + \\ -fwine, -fno-wine Integration with system-installed Wine to execute + \\ Windows programs on Linux hosts. (default: no) + \\ + \\ Available System Integrations: Enabled: + \\ +; + +const general_usage = + \\ + \\General Options: + \\ -h, --help Print this help to stdout and exit + \\ -l, --list-steps Print available steps to stdout and exit + \\ + \\ -p, --prefix [path] Where to install files (default: zig-out) + \\ --prefix-lib-dir [path] Where to install libraries + \\ --prefix-exe-dir [path] Where to install executables + \\ --prefix-include-dir [path] Where to install C header files + \\ --release[=mode] Request release mode, optionally specifying a + \\ preferred optimization mode: fast, safe, small + \\ + \\ --verbose Print commands before executing them + \\ --color [auto|off|on] Enable or disable colored error messages + \\ --error-style [style] Control how build errors are printed + \\ verbose (Default) Report errors with full context + \\ minimal Report errors after summary, excluding context like command lines + \\ verbose_clear Like 'verbose', but clear the terminal at the start of each update + \\ minimal_clear Like 'minimal', but clear the terminal at the start of each update + \\ --multiline-errors [style] Control how multi-line error messages are printed + \\ indent (Default) Indent non-initial lines to align with initial line + \\ newline Include a leading newline so that the error message is on its own lines + \\ none Print as usual so the first line is misaligned + \\ --summary [mode] Control the printing of the build summary + \\ all Print the build summary in its entirety + \\ new Omit cached steps + \\ failures (Default if short-lived) Only print failed steps + \\ line (Default if long-lived) Only print the single-line summary + \\ none Do not print the build summary + \\ -j Limit concurrent jobs (default is to use all CPU cores) + \\ --maxrss Limit memory usage (default is to use available memory) + \\ --skip-oom-steps Instead of failing, skip steps that would exceed --maxrss + \\ --test-timeout Limit execution time of unit tests, terminating if exceeded. + \\ The timeout must include a unit: ns, us, ms, s, m, h + \\ --watch Continuously rebuild when source files are modified + \\ --debounce Delay before rebuilding after changed file detected + \\ --webui[=ip] Enable the web interface on the given IP address + \\ --fuzz[=limit] Continuously search for unit test failures with an optional + \\ limit to the max number of iterations. The argument supports + \\ an optional 'K', 'M', or 'G' suffix (e.g. '10K'). Implies + \\ '--webui' when no limit is specified. + \\ --listen=- Enable the build server protocol on stdio + \\ --time-report Force full rebuild and provide detailed information on + \\ compilation time of Zig source code (implies '--webui') + \\ -fincremental Enable incremental compilation + \\ -fno-incremental Disable incremental compilation + \\ + \\Package Management Options: + \\ --fetch[=mode] Fetch dependency tree (optionally choose laziness) and exit + \\ needed (Default) Lazy dependencies are fetched as needed + \\ all Lazy dependencies are always fetched + \\ --fork=[path], --fork [path] Override one or more projects from dependency tree + \\ + \\Advanced Options: + \\ -freference-trace[=num] How many lines of reference trace should be shown per compile error + \\ -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 + \\ --zig-lib=[arg] Override path to Zig lib directory + \\ --seed [integer] For shuffling dependency traversal order (default: random) + \\ --cache-poison[=mode] Override configuration caching behavior + \\ pure (default) Avoid false positive cache hits + \\ poisoned Don't cache the configuration + \\ disallowed Panics when cache would be poisoned + \\ ignored A little poison never hurt anybody + \\ --print-configuration Render configuration as .zon to stdout + \\ --print-configuration-path Print the path to the binary configuration file to stdout + \\ --build-id[=style] At a minor link-time expense, embeds a build ID in binaries + \\ fast 8-byte non-cryptographic hash (COFF, ELF, WASM) + \\ sha1, tree 20-byte cryptographic hash (ELF, WASM) + \\ md5 16-byte cryptographic hash (ELF) + \\ uuid 16-byte random UUID (ELF, WASM) + \\ 0x[hexstring] Constant ID, maximum 32 bytes (ELF, WASM) + \\ none (default) No build ID + \\ --debug-log [scope] Enable debugging the compiler + \\ --debug-pkg-config Fail if unknown pkg-config flags encountered + \\ --verbose-link Enable compiler debug output for linking + \\ --verbose-air Enable compiler debug output for Zig AIR + \\ --verbose-llvm-ir Enable compiler debug output for LLVM IR + \\ --verbose-cimport Enable compiler debug output for C imports + \\ --verbose-cc Enable compiler debug output for C compilation + \\ --verbose-llvm-cpu-features Enable compiler debug output for LLVM CPU features + \\ +; }