From 02db8326778072c638b84293b30b55999f5ba585 Mon Sep 17 00:00:00 2001 From: "Simon 'Sze' L. Schlee" Date: Sun, 24 Aug 2025 03:08:17 +0200 Subject: [PATCH] pass -freference-trace to executed compile command Currently users executing `zig build` to run the exercises, may encounter compiler output that tells them to use `-freference-trace=[num]` to see more of the hidden reference traces, so we should pass this parameter to the zigling exercise being compiled, so that the learner can provide this parameter like they would normally, when using `zig build` directly in normal Zig programs. --- build.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.zig b/build.zig index e72dd4d..7e8bf7a 100644 --- a/build.zig +++ b/build.zig @@ -508,6 +508,10 @@ const ZiglingStep = struct { zig_args.append("-lc") catch @panic("OOM"); } + if (b.reference_trace) |rt| { + zig_args.append(b.fmt("-freference-trace={}", .{rt})) catch @panic("OOM"); + } + zig_args.append(b.pathFromRoot(path)) catch @panic("OOM"); zig_args.append("--cache-dir") catch @panic("OOM");