@@ -4228,6 +4228,10 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
42284228 .root_src_path = "build_runner.zig" ,
42294229 };
42304230
4231+ var build_pkg : Package = .{
4232+ .root_src_directory = build_directory ,
4233+ .root_src_path = build_zig_basename ,
4234+ };
42314235 if (! build_options .omit_pkg_fetching_code ) {
42324236 var http_client : std.http.Client = .{ .allocator = gpa };
42334237 defer http_client .deinit ();
@@ -4249,7 +4253,8 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
42494253
42504254 // Here we borrow main package's table and will replace it with a fresh
42514255 // one after this process completes.
4252- main_pkg .fetchAndAddDependencies (
4256+ build_pkg .fetchAndAddDependencies (
4257+ & main_pkg ,
42534258 arena ,
42544259 & thread_pool ,
42554260 & http_client ,
@@ -4280,11 +4285,6 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
42804285 mem .swap (Package .Table , & main_pkg .table , & deps_pkg .table );
42814286 try main_pkg .add (gpa , "@dependencies" , deps_pkg );
42824287 }
4283-
4284- var build_pkg : Package = .{
4285- .root_src_directory = build_directory ,
4286- .root_src_path = build_zig_basename ,
4287- };
42884288 try main_pkg .add (gpa , "@build" , & build_pkg );
42894289
42904290 const comp = Compilation .create (gpa , .{
0 commit comments