@@ -397,7 +397,7 @@ fn loadManifest(
397
397
color : std.zig.Color ,
398
398
required : bool ,
399
399
) ! struct { std .zig .Manifest , std .zig .Ast } {
400
- var buf : [std .fs .max_path_bytes ]u8 = undefined ;
400
+ var buf : [2 * std .fs .max_path_bytes ]u8 = undefined ;
401
401
var fba : std.heap.FixedBufferAllocator = .init (& buf );
402
402
const joined_path = root .join (fba .allocator (), std .zig .Manifest .basename ) catch
403
403
return error .NameTooLong ;
@@ -412,18 +412,15 @@ fn loadManifest(
412
412
if (! required ) {
413
413
if (err == error .FileNotFound ) return error .FileNotFound ;
414
414
}
415
- fatal ("unable to load package manifest '{s}': {s}" , .{
416
- try root .joinString (allocator , joined_path .sub_path ),
417
- @errorName (err ),
418
- });
415
+ fatal ("unable to load package manifest '{}': {s}" , .{ root , @errorName (err ) });
419
416
};
420
417
errdefer allocator .free (manifest_bytes );
421
418
422
419
var ast = try std .zig .Ast .parse (allocator , manifest_bytes , .zon );
423
420
errdefer ast .deinit (allocator );
424
421
425
422
if (ast .errors .len > 0 ) {
426
- const file_path = try root .joinString ( allocator , joined_path . sub_path );
423
+ const file_path = try root .toString ( fba . allocator () );
427
424
try std .zig .printAstErrorsToStderr (allocator , ast , file_path , color );
428
425
std .process .exit (1 );
429
426
}
@@ -440,10 +437,7 @@ fn loadManifest(
440
437
try wip_errors .init (allocator );
441
438
defer wip_errors .deinit ();
442
439
443
- const src_path = try wip_errors .addString (try root .joinString (
444
- allocator ,
445
- joined_path .sub_path ,
446
- ));
440
+ const src_path = try wip_errors .addString (try root .toString (fba .allocator ()));
447
441
try manifest .copyErrorsIntoBundle (ast , src_path , & wip_errors );
448
442
449
443
var eb = try wip_errors .toOwnedBundle ("" );
0 commit comments