zig 16 update#201
Conversation
|
The error is a change in std.time. I'll check it and fix it later tonight or tomorrow. |
|
Hi, sorry for not responding earlier. Thank you for working on this. I'll try to do a first round of review at some point this week. |
|
I got a PR up on the fork with a fix for the time stuff: https://github.com/Queyrouzec/zig-sqlite/pull/1.diff |
Use Io.Clock instead of time.Instant in tests
|
Thanks for the help, and sorry for the delayed response. The std is getting a lot easier to understand, but I have no clue where anything is sometimes, and I'm not the best systems programmer. Looking through some of the std implementations, I think that there may also need to be a WASM test runner. I'm going to be messing with WASM some time this year, and I'll add it in then. |
Everything is moving (and breaking) very fast on master right now and it's a challenge to keep up. I just think it's cool that more people get their hands dirty. :) |
|
I tried cloning and applying the PR to my clone, but i get this error when i try to build: |
The |
|
This PR is important, and the project hasn't had updates in a couple of months |
| inline .@"struct", .@"union" => |TI| { | ||
| if (TI.layout == .@"packed" and !@hasField(FieldType, "readField")) { | ||
| const Backing = @Type(.{ .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(FieldType) } }); | ||
| const Backing = @TypeOf(.{ .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(FieldType) } }); |
There was a problem hiding this comment.
| const Backing = @TypeOf(.{ .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(FieldType) } }); | |
| const Backing = @Int(.unsigned, @bitSizeOf(FieldType)); |
| .@"union" => |info| { | ||
| if (info.layout == .@"packed") { | ||
| const Backing = @Type(.{ .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(FieldType) } }); | ||
| const Backing = @TypeOf(.{ .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(FieldType) } }); |
There was a problem hiding this comment.
| const Backing = @TypeOf(.{ .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(FieldType) } }); | |
| const Backing = @Int(.unsigned, @bitSizeOf(FieldType)); |
|
Hi. I appreciate the work but as it stands when running the full test suite with I tried fixing some issues in https://github.com/vrischmann/zig-sqlite/tree/update-zig-0.16.0 but it's not working yet, for some reason the tests break when cross compiling. If anyone figures out the issue that would be great. |
|
seems to be something with comptime memory, this fixes it though diff --git a/query.zig b/query.zig
index 506842a..eae9129 100644
--- a/query.zig
+++ b/query.zig
@@ -32,11 +32,12 @@ pub fn ParsedQuery(comptime tmp_query: []const u8) type {
const Self = @This();
const result = parse();
+ const result_query = result.query[0..Self.result.query_len].*;
pub const bind_markers = result.bind_markers[0..result.bind_markers_len];
pub fn getQuery() []const u8 {
- return Self.result.query[0..Self.result.query_len];
+ return &result_query;
}
const ParsedQueryResult = struct {
diff --git a/sqlite.zig b/sqlite.zig
index b51f9d9..bc1ab7d 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -1454,7 +1454,7 @@ pub fn Iterator(comptime Type: type) type {
},
inline .@"struct", .@"union" => |TI| {
if (TI.layout == .@"packed" and !@hasField(FieldType, "readField")) {
- const Backing = @TypeOf(.{ .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(FieldType) } });
+ const Backing = @Int(.unsigned, @bitSizeOf(FieldType));
return @bitCast(self.readInt(Backing, i));
}
@@ -1685,7 +1685,7 @@ pub const DynamicStatement = struct {
},
.@"union" => |info| {
if (info.layout == .@"packed") {
- const Backing = @TypeOf(.{ .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(FieldType) } });
+ const Backing = @Int(.unsigned, @bitSizeOf(FieldType));
try self.bindField(Backing, options, field_name, i, @as(Backing, @bitCast(field)));
return;
} |
|
Ok, i got it working. I can't push to this PR though, I'll close it and create a new one with all the changes. |
|
Thanks @nektro |
|
Follow up is in #205 |
Now works on the master branch
Updated IO in build file is now centralized to one variable so that it can be passed as a package argument later.
General writer and reader updates
Removed writer and reader from blob
General std updates
Updated Branch limit due to compile errors in personal use