authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-12-19 16:01:15-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-01 17:51:21-07:00
log3b36c4d0b30285ceb3576e621a4dc2b98a30d424
tree544c73f6f88584e373a6851cdf47bf0da67c0ea9
parent056f04c1ff71fe6e4cf18d7b46bc821b12d874f1

zig build: pass resolved_target to Module.create

it's now required to pass this for the root module

1 files changed, 10 insertions(+), 8 deletions(-)

src/main.zig+10-8
...@@ -5234,11 +5234,15 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi...@@ -5234,11 +5234,15 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
5234 gimmeMoreOfThoseSweetSweetFileDescriptors();5234 gimmeMoreOfThoseSweetSweetFileDescriptors();
52355235
5236 const target_query: std.Target.Query = .{};5236 const target_query: std.Target.Query = .{};
5237 const target = resolveTargetQueryOrFatal(target_query);5237 const resolved_target: Package.Module.ResolvedTarget = .{
5238 .result = resolveTargetQueryOrFatal(target_query),
5239 .is_native_os = true,
5240 .is_native_abi = true,
5241 };
52385242
5239 const exe_basename = try std.zig.binNameAlloc(arena, .{5243 const exe_basename = try std.zig.binNameAlloc(arena, .{
5240 .root_name = "build",5244 .root_name = "build",
5241 .target = target,5245 .target = resolved_target.result,
5242 .output_mode = .Exe,5246 .output_mode = .Exe,
5243 });5247 });
5244 const emit_bin: Compilation.EmitLoc = .{5248 const emit_bin: Compilation.EmitLoc = .{
...@@ -5262,11 +5266,7 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi...@@ -5262,11 +5266,7 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
52625266
5263 const config = try Compilation.Config.resolve(.{5267 const config = try Compilation.Config.resolve(.{
5264 .output_mode = .Exe,5268 .output_mode = .Exe,
5265 .resolved_target = .{5269 .resolved_target = resolved_target,
5266 .result = target,
5267 .is_native_os = true,
5268 .is_native_abi = true,
5269 },
5270 .have_zcu = true,5270 .have_zcu = true,
5271 .emit_bin = true,5271 .emit_bin = true,
5272 .is_test = false,5272 .is_test = false,
...@@ -5277,7 +5277,9 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi...@@ -5277,7 +5277,9 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
5277 .paths = main_mod_paths,5277 .paths = main_mod_paths,
5278 .fully_qualified_name = "root",5278 .fully_qualified_name = "root",
5279 .cc_argv = &.{},5279 .cc_argv = &.{},
5280 .inherited = .{},5280 .inherited = .{
5281 .resolved_target = resolved_target,
5282 },
5281 .global = config,5283 .global = config,
5282 .parent = null,5284 .parent = null,
5283 .builtin_mod = null,5285 .builtin_mod = null,