cleanup main, re-enable riscv64-linux

This commit is contained in:
Emil Lerch 2024-10-17 12:00:20 -07:00
parent 4fa30a70cc
commit 97b784f8e3
Signed by: lobo
GPG Key ID: A7B62D657EF764F8
3 changed files with 7 additions and 14 deletions

View File

@ -17,7 +17,7 @@ Current executable size for the demo is 980k after compiling with -Doptimize=Rel
in x86_linux, and will vary based on services used. Tested targets: in x86_linux, and will vary based on services used. Tested targets:
* x86_64-linux * x86_64-linux
* riscv64-linux\* * riscv64-linux
* aarch64-linux * aarch64-linux
* x86_64-windows * x86_64-windows
* arm-linux * arm-linux
@ -26,9 +26,6 @@ in x86_linux, and will vary based on services used. Tested targets:
Tested targets are built, but not continuously tested, by CI. Tested targets are built, but not continuously tested, by CI.
\* On Zig 0.12/0.13, riscv64-linux disabled due to [LLLM's O(N^2) codegen](https://github.com/ziglang/zig/issues/18872)
Zig-Develop Branch Zig-Develop Branch
------------------ ------------------

View File

@ -10,11 +10,7 @@ const test_targets = [_]std.Target.Query{
.{}, // native .{}, // native
.{ .cpu_arch = .x86_64, .os_tag = .linux }, .{ .cpu_arch = .x86_64, .os_tag = .linux },
.{ .cpu_arch = .aarch64, .os_tag = .linux }, .{ .cpu_arch = .aarch64, .os_tag = .linux },
// The test executable linking process just spins forever in LLVM using nominated zig 0.13 May 2024 .{ .cpu_arch = .riscv64, .os_tag = .linux },
// This is likely a LLVM problem unlikely to be fixed in zig 0.13
// Potentially this issue: https://github.com/llvm/llvm-project/issues/81440
// Zig tracker: https://github.com/ziglang/zig/issues/18872
// .{ .cpu_arch = .riscv64, .os_tag = .linux },
.{ .cpu_arch = .arm, .os_tag = .linux }, .{ .cpu_arch = .arm, .os_tag = .linux },
.{ .cpu_arch = .x86_64, .os_tag = .windows }, .{ .cpu_arch = .x86_64, .os_tag = .windows },
.{ .cpu_arch = .aarch64, .os_tag = .macos }, .{ .cpu_arch = .aarch64, .os_tag = .macos },

View File

@ -97,7 +97,7 @@ pub fn main() anyerror!void {
} }
continue; continue;
} }
inline for (@typeInfo(Tests).Enum.fields) |f| { inline for (@typeInfo(Tests).@"enum".fields) |f| {
if (std.mem.eql(u8, f.name, arg)) { if (std.mem.eql(u8, f.name, arg)) {
try tests.append(@field(Tests, f.name)); try tests.append(@field(Tests, f.name));
break; break;
@ -105,7 +105,7 @@ pub fn main() anyerror!void {
} }
} }
if (tests.items.len == 0) { if (tests.items.len == 0) {
inline for (@typeInfo(Tests).Enum.fields) |f| inline for (@typeInfo(Tests).@"enum".fields) |f|
try tests.append(@field(Tests, f.name)); try tests.append(@field(Tests, f.name));
} }
@ -192,7 +192,7 @@ pub fn main() anyerror!void {
const func = fns[0]; const func = fns[0];
const arn = func.function_arn.?; const arn = func.function_arn.?;
// This is a bit ugly. Maybe a helper function in the library would help? // This is a bit ugly. Maybe a helper function in the library would help?
var tags = try std.ArrayList(@typeInfo(try typeForField(services.lambda.tag_resource.Request, "tags")).Pointer.child).initCapacity(allocator, 1); var tags = try std.ArrayList(@typeInfo(try typeForField(services.lambda.tag_resource.Request, "tags")).pointer.child).initCapacity(allocator, 1);
defer tags.deinit(); defer tags.deinit();
tags.appendAssumeCapacity(.{ .key = "Foo", .value = "Bar" }); tags.appendAssumeCapacity(.{ .key = "Foo", .value = "Bar" });
const req = services.lambda.tag_resource.Request{ .resource = arn, .tags = tags.items }; const req = services.lambda.tag_resource.Request{ .resource = arn, .tags = tags.items };
@ -380,8 +380,8 @@ fn proxyFromString(string: []const u8) !std.http.Client.Proxy {
fn typeForField(comptime T: type, comptime field_name: []const u8) !type { fn typeForField(comptime T: type, comptime field_name: []const u8) !type {
const ti = @typeInfo(T); const ti = @typeInfo(T);
switch (ti) { switch (ti) {
.Struct => { .@"struct" => {
inline for (ti.Struct.fields) |field| { inline for (ti.@"struct".fields) |field| {
if (std.mem.eql(u8, field.name, field_name)) if (std.mem.eql(u8, field.name, field_name))
return field.type; return field.type;
} }