authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-06-27 17:58:45-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-06-30 01:03:14-07:00
logf6d22629aa6a7fbc5a2f285c335e1580bd4a3e24
tree2526620c2e24e814a3290cec500c8bb47d0cfa3b
parent1d1193aa7b015174276b01ae17c68ca4271a0e1e

resinator: Make LazyIncludePaths actually retain resolved values

The libc paths were being detected twice because of this stupid mistake

1 files changed, 29 insertions(+), 28 deletions(-)

lib/compiler/resinator/main.zig+29-28
......@@ -555,34 +555,35 @@ const LazyIncludePaths = struct {
555555 ) ![]const []const u8 {
556556 const io = self.io;
557557
558 if (self.resolved_include_paths) |include_paths|
559 return include_paths;
560
561 return getIncludePaths(
562 self.arena,
563 io,
564 self.auto_includes_option,
565 self.zig_lib_dir,
566 self.target_machine_type,
567 environ_map,
568 ) catch |err| switch (err) {
569 error.OutOfMemory => |e| return e,
570 else => |e| {
571 switch (e) {
572 error.UnsupportedAutoIncludesMachineType => {
573 try error_handler.emitMessage(self.arena, io, .err, "automatic include path detection is not supported for target '{s}'", .{@tagName(self.target_machine_type)});
574 },
575 error.MsvcIncludesNotFound => {
576 try error_handler.emitMessage(self.arena, io, .err, "MSVC include paths could not be automatically detected", .{});
577 },
578 error.MingwIncludesNotFound => {
579 try error_handler.emitMessage(self.arena, io, .err, "MinGW include paths could not be automatically detected", .{});
580 },
581 }
582 try error_handler.emitMessage(self.arena, io, .note, "to disable auto includes, use the option /:auto-includes none", .{});
583 std.process.exit(1);
584 },
585 };
558 if (self.resolved_include_paths == null) {
559 self.resolved_include_paths = getIncludePaths(
560 self.arena,
561 io,
562 self.auto_includes_option,
563 self.zig_lib_dir,
564 self.target_machine_type,
565 environ_map,
566 ) catch |err| switch (err) {
567 error.OutOfMemory => |e| return e,
568 else => |e| {
569 switch (e) {
570 error.UnsupportedAutoIncludesMachineType => {
571 try error_handler.emitMessage(self.arena, io, .err, "automatic include path detection is not supported for target '{s}'", .{@tagName(self.target_machine_type)});
572 },
573 error.MsvcIncludesNotFound => {
574 try error_handler.emitMessage(self.arena, io, .err, "MSVC include paths could not be automatically detected", .{});
575 },
576 error.MingwIncludesNotFound => {
577 try error_handler.emitMessage(self.arena, io, .err, "MinGW include paths could not be automatically detected", .{});
578 },
579 }
580 try error_handler.emitMessage(self.arena, io, .note, "to disable auto includes, use the option /:auto-includes none", .{});
581 std.process.exit(1);
582 },
583 };
584 }
585
586 return self.resolved_include_paths.?;
586587 }
587588};
588589