diff --git a/build.zig b/build.zig index 82c68a8..b744903 100644 --- a/build.zig +++ b/build.zig @@ -4,10 +4,10 @@ const builtin = @import("builtin"); const rt = @import("test/runtime_test.zig"); const RuntimeStep = rt.RuntimeStep; const Allocator = std.mem.Allocator; -const Builder = std.build.Builder; +// const Builder = std.build.Builder; const Step = std.build.Step; const Target = std.Target; -const CrossTarget = std.zig.CrossTarget; +const CrossTarget = std.Target.Query; const fs = std.fs; const File = fs.File; const Mode = std.builtin.Mode; @@ -16,12 +16,12 @@ const ArrayList = std.ArrayList; const Fat32 = @import("mkfat32.zig").Fat32; const x86_i686 = CrossTarget{ - .cpu_arch = .i386, + .cpu_arch = .x86, .os_tag = .freestanding, .cpu_model = .{ .explicit = &Target.x86.cpu.i686 }, }; -pub fn build(b: *Builder) !void { +pub fn build(b: *std.Build) !void { const target = b.standardTargetOptions(.{ .whitelist = &[_]CrossTarget{x86_i686}, .default_target = x86_i686 }); const arch = switch (target.getCpuArch()) { .i386 => "x86", @@ -197,7 +197,7 @@ const Fat32BuilderStep = struct { step: Step, /// The builder pointer, also all you need to know - builder: *Builder, + builder: *std.Build, /// The path to where the ramdisk will be written to. out_file_path: []const u8, @@ -237,7 +237,7 @@ const Fat32BuilderStep = struct { /// Return: *Fat32BuilderStep /// The FAT32 builder step pointer to add to the build process. /// - pub fn create(builder: *Builder, options: Fat32.Options, out_file_path: []const u8) *Fat32BuilderStep { + pub fn create(builder: *std.Build, options: Fat32.Options, out_file_path: []const u8) *Fat32BuilderStep { const fat32_builder_step = builder.allocator.create(Fat32BuilderStep) catch unreachable; fat32_builder_step.* = .{ .step = Step.init(.custom, builder.fmt("Fat32BuilderStep", .{}), builder.allocator, make), @@ -255,7 +255,7 @@ const RamdiskStep = struct { step: Step, /// The builder pointer, also all you need to know - builder: *Builder, + builder: *std.Build, /// The target for the build target: CrossTarget, @@ -352,7 +352,7 @@ const RamdiskStep = struct { /// Return: *RamdiskStep /// The ramdisk step pointer to add to the build process. /// - pub fn create(builder: *Builder, target: CrossTarget, files: []const []const u8, out_file_path: []const u8) *RamdiskStep { + pub fn create(builder: *std.Build, target: CrossTarget, files: []const []const u8, out_file_path: []const u8) *RamdiskStep { const ramdisk_step = builder.allocator.create(RamdiskStep) catch unreachable; ramdisk_step.* = .{ .step = Step.init(.custom, builder.fmt("Ramdisk", .{}), builder.allocator, make), diff --git a/test/runtime_test.zig b/test/runtime_test.zig index 6795daf..c9a14e1 100644 --- a/test/runtime_test.zig +++ b/test/runtime_test.zig @@ -193,7 +193,7 @@ pub const RuntimeStep = struct { /// Error.TestFailed - The error if the test failed. /// fn make(step: *Step) (Thread.SpawnError || ChildProcess.SpawnError || Allocator.Error || Error)!void { - const self = @fieldParentPtr(RuntimeStep, "step", step); + const self: RuntimeStep = @fieldParentPtr("step", step); // Create the qemu process self.os_proc = try ChildProcess.init(self.argv, self.builder.allocator); @@ -254,7 +254,7 @@ pub const RuntimeStep = struct { }; // put line in the queue - var node = self.builder.allocator.create(Node) catch unreachable; + const node = self.builder.allocator.create(Node) catch unreachable; node.* = .{ .next = null, .data = line }; self.msg_queue.put(node); }