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
Some checks failed
AWS-Zig Build / build-zig-0.11.0-amd64-host (push) Failing after 2m25s
This commit is contained in:
parent
b2c8fc5f3c
commit
99a61c0bd2
|
@ -16,7 +16,7 @@ jobs:
|
||||||
# container:
|
# container:
|
||||||
# image: alpine:3.15.0
|
# image: alpine:3.15.0
|
||||||
env:
|
env:
|
||||||
ZIG_VERSION: 0.11.0
|
ZIG_VERSION: 0.12.0
|
||||||
ARCH: x86_64
|
ARCH: x86_64
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
|
|
|
@ -144,7 +144,7 @@ pub fn build(b: *Builder) !void {
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
cg_cmd.addArg("--output");
|
cg_cmd.addArg("--output");
|
||||||
cg_cmd.addDirectoryArg(std.Build.LazyPath.relative("src/models"));
|
cg_cmd.addDirectoryArg(b.path("src/models"));
|
||||||
if (b.verbose)
|
if (b.verbose)
|
||||||
cg_cmd.addArg("--verbose");
|
cg_cmd.addArg("--verbose");
|
||||||
// cg_cmd.step.dependOn(&fetch_step.step);
|
// cg_cmd.step.dependOn(&fetch_step.step);
|
||||||
|
|
|
@ -77,13 +77,13 @@ pub fn hex64(x: u64) [16]u8 {
|
||||||
return result;
|
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;
|
_ = entry;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
fn excluded(entry: std.fs.Dir.Walker.WalkerEntry) bool {
|
fn excluded(entry: std.fs.Dir.Walker.Entry) bool {
|
||||||
_ = entry;
|
_ = entry;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -206,6 +206,6 @@ fn isExecutable(file: std.fs.File) !bool {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
const stat = try file.stat();
|
const stat = try file.stat();
|
||||||
return (stat.mode & std.os.S.IXUSR) != 0;
|
return (stat.mode & std.posix.S.IXUSR) != 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
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{
|
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 {
|
.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");
|
return std.mem.endsWith(u8, entry.basename, ".json");
|
||||||
}
|
}
|
||||||
}.include,
|
}.include,
|
||||||
.isExcluded = struct {
|
.isExcluded = struct {
|
||||||
pub fn exclude(entry: std.fs.Dir.Walker.WalkerEntry) bool {
|
pub fn exclude(entry: std.fs.Dir.Walker.Entry) bool {
|
||||||
_ = entry;
|
_ = entry;
|
||||||
return false;
|
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{
|
const output_hash = try Hasher.computeDirectoryHash(thread_pool, try output_dir.openDir(".", .{ .iterate = true }), @constCast(&Hasher.ComputeDirectoryOptions{
|
||||||
.isIncluded = struct {
|
.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");
|
return std.mem.endsWith(u8, entry.basename, ".zig");
|
||||||
}
|
}
|
||||||
}.include,
|
}.include,
|
||||||
.isExcluded = struct {
|
.isExcluded = struct {
|
||||||
pub fn exclude(entry: std.fs.Dir.Walker.WalkerEntry) bool {
|
pub fn exclude(entry: std.fs.Dir.Walker.Entry) bool {
|
||||||
_ = entry;
|
_ = entry;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -827,7 +827,7 @@ fn ServerResponse(comptime action: anytype) type {
|
||||||
};
|
};
|
||||||
const Result = @Type(.{
|
const Result = @Type(.{
|
||||||
.Struct = .{
|
.Struct = .{
|
||||||
.layout = .Auto,
|
.layout = .auto,
|
||||||
.fields = &[_]std.builtin.Type.StructField{
|
.fields = &[_]std.builtin.Type.StructField{
|
||||||
.{
|
.{
|
||||||
.name = action.action_name ++ "Result",
|
.name = action.action_name ++ "Result",
|
||||||
|
@ -850,7 +850,7 @@ fn ServerResponse(comptime action: anytype) type {
|
||||||
});
|
});
|
||||||
return @Type(.{
|
return @Type(.{
|
||||||
.Struct = .{
|
.Struct = .{
|
||||||
.layout = .Auto,
|
.layout = .auto,
|
||||||
.fields = &[_]std.builtin.Type.StructField{
|
.fields = &[_]std.builtin.Type.StructField{
|
||||||
.{
|
.{
|
||||||
.name = action.action_name ++ "Response",
|
.name = action.action_name ++ "Response",
|
||||||
|
|
|
@ -574,7 +574,7 @@ fn getHomeDir(allocator: std.mem.Allocator) ![]const u8 {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
.macos, .linux, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris => {
|
.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
|
// TODO look in /etc/passwd
|
||||||
return error.HomeDirUnavailable;
|
return error.HomeDirUnavailable;
|
||||||
};
|
};
|
||||||
|
|
10
src/json.zig
10
src/json.zig
|
@ -1361,7 +1361,7 @@ test "Value.jsonStringify" {
|
||||||
var buffer: [10]u8 = undefined;
|
var buffer: [10]u8 = undefined;
|
||||||
var fbs = std.io.fixedBufferStream(&buffer);
|
var fbs = std.io.fixedBufferStream(&buffer);
|
||||||
try (Value{ .Float = 42 }).jsonStringify(.{}, fbs.writer());
|
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;
|
var buffer: [10]u8 = undefined;
|
||||||
|
@ -2808,7 +2808,7 @@ pub fn stringify(
|
||||||
const T = @TypeOf(value);
|
const T = @TypeOf(value);
|
||||||
switch (@typeInfo(T)) {
|
switch (@typeInfo(T)) {
|
||||||
.Float, .ComptimeFloat => {
|
.Float, .ComptimeFloat => {
|
||||||
return std.fmt.formatFloatScientific(value, std.fmt.FormatOptions{}, out_stream);
|
return std.fmt.format(out_stream, "{e}", .{value});
|
||||||
},
|
},
|
||||||
.Int, .ComptimeInt => {
|
.Int, .ComptimeInt => {
|
||||||
return std.fmt.formatIntValue(value, "", std.fmt.FormatOptions{}, out_stream);
|
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(?u8, null), StringifyOptions{});
|
||||||
try teststringify("null", @as(?*u32, null), StringifyOptions{});
|
try teststringify("null", @as(?*u32, null), StringifyOptions{});
|
||||||
try teststringify("42", 42, 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(u8, 42), StringifyOptions{});
|
||||||
try teststringify("42", @as(u128, 42), StringifyOptions{});
|
try teststringify("42", @as(u128, 42), StringifyOptions{});
|
||||||
try teststringify("4.2e+01", @as(f32, 42), StringifyOptions{});
|
try teststringify("4.2e1", @as(f32, 42), StringifyOptions{});
|
||||||
try teststringify("4.2e+01", @as(f64, 42), StringifyOptions{});
|
try teststringify("4.2e1", @as(f64, 42), StringifyOptions{});
|
||||||
try teststringify("\"ItBroke\"", @as(anyerror, error.ItBroke), StringifyOptions{});
|
try teststringify("\"ItBroke\"", @as(anyerror, error.ItBroke), StringifyOptions{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ pub fn Services(comptime service_imports: anytype) type {
|
||||||
// finally, generate the type
|
// finally, generate the type
|
||||||
return @Type(.{
|
return @Type(.{
|
||||||
.Struct = .{
|
.Struct = .{
|
||||||
.layout = .Auto, // will be .auto in the future
|
.layout = .auto,
|
||||||
.fields = &fields,
|
.fields = &fields,
|
||||||
.decls = &[_]std.builtin.Type.Declaration{},
|
.decls = &[_]std.builtin.Type.Declaration{},
|
||||||
.is_tuple = false,
|
.is_tuple = false,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user