Commit ca77c3bacc

Andrew Kelley <andrew@ziglang.org>
2023-12-19 02:18:02
std.Build.Step.Compile: restore previous step name
Print using the target query rather than the resolved target. This makes it print "native" when compiling for the native target.
1 parent 4b667e7
Changed files (1)
lib
std
Build
lib/std/Build/Step/Compile.zig
@@ -251,7 +251,8 @@ pub fn create(owner: *std.Build, options: Options) *Compile {
     else
         owner.fmt("{s} ", .{name});
 
-    const target = options.root_module.target.?.result;
+    const resolved_target = options.root_module.target.?;
+    const target = resolved_target.result;
 
     const step_name = owner.fmt("{s} {s}{s} {s}", .{
         switch (options.kind) {
@@ -262,7 +263,7 @@ pub fn create(owner: *std.Build, options: Options) *Compile {
         },
         name_adjusted,
         @tagName(options.root_module.optimize orelse .Debug),
-        target.zigTriple(owner.allocator) catch @panic("OOM"),
+        resolved_target.query.zigTriple(owner.allocator) catch @panic("OOM"),
     });
 
     const out_filename = std.zig.binNameAlloc(owner.allocator, .{