update aws-zig to zig 0.12.0 (example will still fail)
Some checks failed
AWS-Zig Build / build-zig-0.11.0-amd64-host (push) Failing after 2m25s

This commit is contained in:
Emil Lerch 2024-04-22 08:19:24 -07:00
parent b2c8fc5f3c
commit 99a61c0bd2
Signed by: lobo
GPG Key ID: A7B62D657EF764F8
8 changed files with 19 additions and 19 deletions

View File

@ -16,7 +16,7 @@ jobs:
# container:
# image: alpine:3.15.0
env:
ZIG_VERSION: 0.11.0
ZIG_VERSION: 0.12.0
ARCH: x86_64
steps:
- name: Check out repository code

View File

@ -144,7 +144,7 @@ pub fn build(b: *Builder) !void {
},
));
cg_cmd.addArg("--output");
cg_cmd.addDirectoryArg(std.Build.LazyPath.relative("src/models"));
cg_cmd.addDirectoryArg(b.path("src/models"));
if (b.verbose)
cg_cmd.addArg("--verbose");
// cg_cmd.step.dependOn(&fetch_step.step);

View File

@ -77,13 +77,13 @@ pub fn hex64(x: u64) [16]u8 {
return result;
}
pub const walkerFn = *const fn (std.fs.Dir.Walker.WalkerEntry) bool;
pub const walkerFn = *const fn (std.fs.Dir.Walker.Entry) bool;
fn included(entry: std.fs.Dir.Walker.WalkerEntry) bool {
fn included(entry: std.fs.Dir.Walker.Entry) bool {
_ = entry;
return true;
}
fn excluded(entry: std.fs.Dir.Walker.WalkerEntry) bool {
fn excluded(entry: std.fs.Dir.Walker.Entry) bool {
_ = entry;
return false;
}
@ -206,6 +206,6 @@ fn isExecutable(file: std.fs.File) !bool {
return false;
} else {
const stat = try file.stat();
return (stat.mode & std.os.S.IXUSR) != 0;
return (stat.mode & std.posix.S.IXUSR) != 0;
}
}

View File

@ -134,12 +134,12 @@ var model_digest: ?[Hasher.hex_multihash_len]u8 = null;
fn calculateDigests(models_dir: std.fs.Dir, output_dir: std.fs.Dir, thread_pool: *std.Thread.Pool) !OutputManifest {
const model_hash = if (model_digest) |m| m[0..Hasher.digest_len].* else try Hasher.computeDirectoryHash(thread_pool, models_dir, @constCast(&Hasher.ComputeDirectoryOptions{
.isIncluded = struct {
pub fn include(entry: std.fs.Dir.Walker.WalkerEntry) bool {
pub fn include(entry: std.fs.Dir.Walker.Entry) bool {
return std.mem.endsWith(u8, entry.basename, ".json");
}
}.include,
.isExcluded = struct {
pub fn exclude(entry: std.fs.Dir.Walker.WalkerEntry) bool {
pub fn exclude(entry: std.fs.Dir.Walker.Entry) bool {
_ = entry;
return false;
}
@ -150,12 +150,12 @@ fn calculateDigests(models_dir: std.fs.Dir, output_dir: std.fs.Dir, thread_pool:
const output_hash = try Hasher.computeDirectoryHash(thread_pool, try output_dir.openDir(".", .{ .iterate = true }), @constCast(&Hasher.ComputeDirectoryOptions{
.isIncluded = struct {
pub fn include(entry: std.fs.Dir.Walker.WalkerEntry) bool {
pub fn include(entry: std.fs.Dir.Walker.Entry) bool {
return std.mem.endsWith(u8, entry.basename, ".zig");
}
}.include,
.isExcluded = struct {
pub fn exclude(entry: std.fs.Dir.Walker.WalkerEntry) bool {
pub fn exclude(entry: std.fs.Dir.Walker.Entry) bool {
_ = entry;
return false;
}

View File

@ -827,7 +827,7 @@ fn ServerResponse(comptime action: anytype) type {
};
const Result = @Type(.{
.Struct = .{
.layout = .Auto,
.layout = .auto,
.fields = &[_]std.builtin.Type.StructField{
.{
.name = action.action_name ++ "Result",
@ -850,7 +850,7 @@ fn ServerResponse(comptime action: anytype) type {
});
return @Type(.{
.Struct = .{
.layout = .Auto,
.layout = .auto,
.fields = &[_]std.builtin.Type.StructField{
.{
.name = action.action_name ++ "Response",

View File

@ -574,7 +574,7 @@ fn getHomeDir(allocator: std.mem.Allocator) ![]const u8 {
};
},
.macos, .linux, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris => {
const home_dir = std.os.getenv("HOME") orelse {
const home_dir = std.posix.getenv("HOME") orelse {
// TODO look in /etc/passwd
return error.HomeDirUnavailable;
};

View File

@ -1361,7 +1361,7 @@ test "Value.jsonStringify" {
var buffer: [10]u8 = undefined;
var fbs = std.io.fixedBufferStream(&buffer);
try (Value{ .Float = 42 }).jsonStringify(.{}, fbs.writer());
try testing.expectEqualSlices(u8, fbs.getWritten(), "4.2e+01");
try testing.expectEqualSlices(u8, fbs.getWritten(), "4.2e1");
}
{
var buffer: [10]u8 = undefined;
@ -2808,7 +2808,7 @@ pub fn stringify(
const T = @TypeOf(value);
switch (@typeInfo(T)) {
.Float, .ComptimeFloat => {
return std.fmt.formatFloatScientific(value, std.fmt.FormatOptions{}, out_stream);
return std.fmt.format(out_stream, "{e}", .{value});
},
.Int, .ComptimeInt => {
return std.fmt.formatIntValue(value, "", std.fmt.FormatOptions{}, out_stream);
@ -3057,11 +3057,11 @@ test "stringify basic types" {
try teststringify("null", @as(?u8, null), StringifyOptions{});
try teststringify("null", @as(?*u32, null), StringifyOptions{});
try teststringify("42", 42, StringifyOptions{});
try teststringify("4.2e+01", 42.0, StringifyOptions{});
try teststringify("4.2e1", 42.0, StringifyOptions{});
try teststringify("42", @as(u8, 42), StringifyOptions{});
try teststringify("42", @as(u128, 42), StringifyOptions{});
try teststringify("4.2e+01", @as(f32, 42), StringifyOptions{});
try teststringify("4.2e+01", @as(f64, 42), StringifyOptions{});
try teststringify("4.2e1", @as(f32, 42), StringifyOptions{});
try teststringify("4.2e1", @as(f64, 42), StringifyOptions{});
try teststringify("\"ItBroke\"", @as(anyerror, error.ItBroke), StringifyOptions{});
}

View File

@ -21,7 +21,7 @@ pub fn Services(comptime service_imports: anytype) type {
// finally, generate the type
return @Type(.{
.Struct = .{
.layout = .Auto, // will be .auto in the future
.layout = .auto,
.fields = &fields,
.decls = &[_]std.builtin.Type.Declaration{},
.is_tuple = false,