| ... | ... | @@ -4951,6 +4951,7 @@ fn cmdBuild( |
| 4951 | 4951 | var debug_target: ?[]const u8 = null; |
| 4952 | 4952 | var debug_libc_paths_file: ?[]const u8 = null; |
| 4953 | 4953 | var cache_poison: std.Build.Graph.CachePoison = .pure; |
| 4954 | var print_configuration_path: bool = false; |
| 4954 | 4955 | |
| 4955 | 4956 | const self_exe_path = try process.executablePathAlloc(io, arena); |
| 4956 | 4957 | const default_seed = try std.fmt.allocPrint(arena, "0x{x}", .{randInt(io, u32)}); |
| ... | ... | @@ -5069,6 +5070,9 @@ fn cmdBuild( |
| 5069 | 5070 | i += 1; |
| 5070 | 5071 | override_global_cache_dir = args[i]; |
| 5071 | 5072 | continue; |
| 5073 | } else if (mem.eql(u8, arg, "--print-configuration-path")) { |
| 5074 | print_configuration_path = true; |
| 5075 | continue; |
| 5072 | 5076 | } else if (mem.eql(u8, arg, "-freference-trace")) { |
| 5073 | 5077 | reference_trace = 256; |
| 5074 | 5078 | } else if (mem.eql(u8, arg, "--fetch")) { |
| ... | ... | @@ -5266,7 +5270,7 @@ fn cmdBuild( |
| 5266 | 5270 | }; |
| 5267 | 5271 | |
| 5268 | 5272 | // Kick off an optimized compilation of the make runner. |
| 5269 | | var make_runner_task = io.async(compileMakeRunner, .{ gpa, arena, io, .{ |
| 5273 | var make_runner_task = if (print_configuration_path) undefined else io.async(compileMakeRunner, .{ gpa, arena, io, .{ |
| 5270 | 5274 | .dirs = .{ |
| 5271 | 5275 | .cwd = dirs.cwd, |
| 5272 | 5276 | .zig_lib = dirs.zig_lib, |
| ... | ... | @@ -5283,7 +5287,7 @@ fn cmdBuild( |
| 5283 | 5287 | .reference_trace = reference_trace, |
| 5284 | 5288 | .optimize_mode = maker_optimize_mode, |
| 5285 | 5289 | } }); |
| 5286 | | defer _ = make_runner_task.cancel(io) catch {}; |
| 5290 | defer _ = if (!print_configuration_path) make_runner_task.cancel(io) catch {}; |
| 5287 | 5291 | |
| 5288 | 5292 | const pkg_root: Path = if (override_pkg_dir) |p| |
| 5289 | 5293 | .initCwd(p) |
| ... | ... | @@ -5744,6 +5748,11 @@ fn cmdBuild( |
| 5744 | 5748 | var configuration_lock = if (!poisoned) config_man.toOwnedLock() else null; |
| 5745 | 5749 | defer if (configuration_lock) |*l| l.release(io); |
| 5746 | 5750 | |
| 5751 | if (print_configuration_path) { |
| 5752 | var stdout_writer = Io.File.stdout().writerStreaming(io, &.{}); |
| 5753 | configuration_path.format(&stdout_writer.interface) catch fatal("failed printing cache file path: {t}", .{stdout_writer.err.?}); |
| 5754 | return cleanExit(io); |
| 5755 | } |
| 5747 | 5756 | const make_runner = make_runner_task.await(io) catch |err| fatal("failed compiling maker: {t}", .{err}); |
| 5748 | 5757 | |
| 5749 | 5758 | make_argv.items[0] = try make_runner.exe_path.toString(arena); |