No brakes on the fix train
Some checks are pending
CI / Build mode ${{ matrix.build_mode }} () (push) Waiting to run
CI / Build mode ${{ matrix.build_mode }} (-Drelease-fast) (push) Waiting to run
CI / Build mode ${{ matrix.build_mode }} (-Drelease-safe) (push) Waiting to run
CI / Build mode ${{ matrix.build_mode }} (-Drelease-small) (push) Waiting to run

This commit is contained in:
Imbus 2024-06-24 21:10:31 +02:00
parent 98d876b18c
commit 66d15e8945
2 changed files with 10 additions and 10 deletions

View file

@ -4,10 +4,10 @@ const builtin = @import("builtin");
const rt = @import("test/runtime_test.zig"); const rt = @import("test/runtime_test.zig");
const RuntimeStep = rt.RuntimeStep; const RuntimeStep = rt.RuntimeStep;
const Allocator = std.mem.Allocator; const Allocator = std.mem.Allocator;
const Builder = std.build.Builder; // const Builder = std.build.Builder;
const Step = std.build.Step; const Step = std.build.Step;
const Target = std.Target; const Target = std.Target;
const CrossTarget = std.zig.CrossTarget; const CrossTarget = std.Target.Query;
const fs = std.fs; const fs = std.fs;
const File = fs.File; const File = fs.File;
const Mode = std.builtin.Mode; const Mode = std.builtin.Mode;
@ -16,12 +16,12 @@ const ArrayList = std.ArrayList;
const Fat32 = @import("mkfat32.zig").Fat32; const Fat32 = @import("mkfat32.zig").Fat32;
const x86_i686 = CrossTarget{ const x86_i686 = CrossTarget{
.cpu_arch = .i386, .cpu_arch = .x86,
.os_tag = .freestanding, .os_tag = .freestanding,
.cpu_model = .{ .explicit = &Target.x86.cpu.i686 }, .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 target = b.standardTargetOptions(.{ .whitelist = &[_]CrossTarget{x86_i686}, .default_target = x86_i686 });
const arch = switch (target.getCpuArch()) { const arch = switch (target.getCpuArch()) {
.i386 => "x86", .i386 => "x86",
@ -197,7 +197,7 @@ const Fat32BuilderStep = struct {
step: Step, step: Step,
/// The builder pointer, also all you need to know /// The builder pointer, also all you need to know
builder: *Builder, builder: *std.Build,
/// The path to where the ramdisk will be written to. /// The path to where the ramdisk will be written to.
out_file_path: []const u8, out_file_path: []const u8,
@ -237,7 +237,7 @@ const Fat32BuilderStep = struct {
/// Return: *Fat32BuilderStep /// Return: *Fat32BuilderStep
/// The FAT32 builder step pointer to add to the build process. /// 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; const fat32_builder_step = builder.allocator.create(Fat32BuilderStep) catch unreachable;
fat32_builder_step.* = .{ fat32_builder_step.* = .{
.step = Step.init(.custom, builder.fmt("Fat32BuilderStep", .{}), builder.allocator, make), .step = Step.init(.custom, builder.fmt("Fat32BuilderStep", .{}), builder.allocator, make),
@ -255,7 +255,7 @@ const RamdiskStep = struct {
step: Step, step: Step,
/// The builder pointer, also all you need to know /// The builder pointer, also all you need to know
builder: *Builder, builder: *std.Build,
/// The target for the build /// The target for the build
target: CrossTarget, target: CrossTarget,
@ -352,7 +352,7 @@ const RamdiskStep = struct {
/// Return: *RamdiskStep /// Return: *RamdiskStep
/// The ramdisk step pointer to add to the build process. /// 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; const ramdisk_step = builder.allocator.create(RamdiskStep) catch unreachable;
ramdisk_step.* = .{ ramdisk_step.* = .{
.step = Step.init(.custom, builder.fmt("Ramdisk", .{}), builder.allocator, make), .step = Step.init(.custom, builder.fmt("Ramdisk", .{}), builder.allocator, make),

View file

@ -193,7 +193,7 @@ pub const RuntimeStep = struct {
/// Error.TestFailed - The error if the test failed. /// Error.TestFailed - The error if the test failed.
/// ///
fn make(step: *Step) (Thread.SpawnError || ChildProcess.SpawnError || Allocator.Error || Error)!void { 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 // Create the qemu process
self.os_proc = try ChildProcess.init(self.argv, self.builder.allocator); self.os_proc = try ChildProcess.init(self.argv, self.builder.allocator);
@ -254,7 +254,7 @@ pub const RuntimeStep = struct {
}; };
// put line in the queue // 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 }; node.* = .{ .next = null, .data = line };
self.msg_queue.put(node); self.msg_queue.put(node);
} }