Skip to content

Commit

Permalink
fix: zig 0.12.0-dev.2833+8802ec583
Browse files Browse the repository at this point in the history
  • Loading branch information
giann committed Feb 23, 2024
1 parent a74b63a commit 8003332
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fn getBuzzPrefix(b: *Build) []const u8 {
pub fn build(b: *Build) !void {
// Check minimum zig version
const current_zig = builtin.zig_version;
const min_zig = std.SemanticVersion.parse("0.12.0-dev.2250+7116b0221") catch return;
const min_zig = std.SemanticVersion.parse("0.12.0-dev.2833+8802ec583") catch return;
if (current_zig.order(min_zig).compare(.lt)) {
@panic(b.fmt("Your Zig version v{} does not meet the minimum build requirement of v{}", .{ current_zig, min_zig }));
}
Expand Down
6 changes: 4 additions & 2 deletions src/lib/buzz_fs.zig
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ pub export fn delete(ctx: *api.NativeCtx) c_int {
fn handleMoveError(ctx: *api.NativeCtx, err: anytype) void {
switch (err) {
error.AccessDenied,
error.AntivirusInterference,
error.BadPathName,
error.DiskQuota,
error.FileBusy,
Expand Down Expand Up @@ -121,9 +122,10 @@ fn handleMoveError(ctx: *api.NativeCtx, err: anytype) void {
fn handleRealpathError(ctx: *api.NativeCtx, err: anytype) void {
switch (err) {
error.AccessDenied,
error.UnrecognizedVolume,
error.AntivirusInterference,
error.BadPathName,
error.DeviceBusy,
error.FileBusy,
error.FileSystem,
error.FileTooBig,
error.InputOutput,
Expand All @@ -142,7 +144,6 @@ fn handleRealpathError(ctx: *api.NativeCtx, err: anytype) void {
error.SymLinkLoop,
error.SystemFdQuotaExceeded,
error.SystemResources,
error.WouldBlock,
error.FileNotFound,
error.NetworkNotFound,
=> ctx.vm.pushErrorEnum("errors.FileSystemError", @errorName(err)),
Expand Down Expand Up @@ -209,6 +210,7 @@ pub export fn move(ctx: *api.NativeCtx) c_int {
fn handleOpenDirAbsoluteError(ctx: *api.NativeCtx, err: anytype) void {
switch (err) {
error.AccessDenied,
error.AntivirusInterference,
error.BadPathName,
error.DeviceBusy,
error.FileBusy,
Expand Down
1 change: 1 addition & 0 deletions src/lib/buzz_io.zig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub export fn FileIsTTY(ctx: api.NativeCtx) c_int {
fn handleFileOpenError(ctx: *api.NativeCtx, err: anytype) void {
switch (err) {
error.AccessDenied,
error.AntivirusInterference,
error.BadPathName,
error.DeviceBusy,
error.FileBusy,
Expand Down
2 changes: 2 additions & 0 deletions src/lib/buzz_os.zig
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ pub export fn execute(ctx: *api.NativeCtx) c_int {
fn handleConnectError(ctx: *api.NativeCtx, err: anytype) void {
switch (err) {
error.AccessDenied,
error.AntivirusInterference,
error.AddressFamilyNotSupported,
error.AddressInUse,
error.AddressNotAvailable,
Expand Down Expand Up @@ -638,6 +639,7 @@ pub export fn SocketServerStart(ctx: *api.NativeCtx) c_int {
error.SharingViolation,
error.SymLinkLoop,
error.SystemResources,
error.AntivirusInterference,
error.WouldBlock,
error.NetworkNotFound,
error.SocketNotConnected,
Expand Down
2 changes: 2 additions & 0 deletions src/lib/errors.buzz
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export enum FileSystemError {
AccessDenied,
AntivirusInterference,
BadPathName,
DeviceBusy,
DiskQuota,
Expand Down Expand Up @@ -32,6 +33,7 @@ export enum FileSystemError {
SystemFdQuotaExceeded,
SystemResources,
WouldBlock,
UnrecognizedVolume,
}

export enum ExecError {
Expand Down

0 comments on commit 8003332

Please sign in to comment.