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