From 4f35f40441b195749b88352c1b7e6487541b03d7 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Wed, 10 Jul 2024 10:24:09 +0300 Subject: Update for zig 0.13.0 --- .gitignore | 4 ++-- build.zig | 10 ++++++++-- build.zig.zon | 12 ++++++------ src/Installation.zig | 2 +- src/main.zig | 4 ++-- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index d816eba..dabae4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *~ -zig-cache/** -zig-out/** +.zig-cache/ +zig-out/ README.html .DS_Store diff --git a/build.zig b/build.zig index fc642a7..f1159b0 100644 --- a/build.zig +++ b/build.zig @@ -20,7 +20,10 @@ pub fn build(b: *Build) void { const exe = b.addExecutable(.{ .name = "zup", .version = version, - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = .{ .src_path = .{ + .owner = b, + .sub_path = "src/main.zig", + } }, .target = target, .optimize = optimize, }); @@ -40,7 +43,10 @@ pub fn build(b: *Build) void { run_step.dependOn(&run_cmd.step); const exe_tests = b.addTest(.{ - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = .{ .src_path = .{ + .owner = b, + .sub_path = "src/main.zig", + } }, .target = target, .optimize = optimize, }); diff --git a/build.zig.zon b/build.zig.zon index aed6a59..2d7a69c 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -5,16 +5,16 @@ .paths = .{""}, .dependencies = .{ .clap = .{ - .url = "https://git.enes.lv/zig-clap/snapshot/zig-clap-0.8.0.tar.xz", - .hash = "1220949d4e88864579067b6d4cdad6476c6176f27e782782c2c39b7f2c4817a10efb", + .url = "https://git.enes.lv/zig-clap/snapshot/zig-clap-0.9.1.tar.xz", + .hash = "122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b", }, .libarchive = .{ - .url = "https://git.enes.lv/zig-libarchive/snapshot/zig-libarchive-0.3.0.tar.xz", - .hash = "1220d8262d35559168d67d60797829a36958320556b277cd0e701a34eb00880461ab", + .url = "https://git.enes.lv/zig-libarchive/snapshot/zig-libarchive-0.4.0.tar.xz", + .hash = "1220b21cc99fca50b7fa495191a17abe440dc8229aa3bc5a638c4a0f2ffdceccbdda", }, .xdg = .{ - .url = "https://git.enes.lv/zig-xdg/snapshot/zig-xdg-0.3.0.tar.xz", - .hash = "1220e214475ea8ff31ac110f593be121663eefdca27d19508d0c96bc49f47c31756f", + .url = "https://git.enes.lv/zig-xdg/snapshot/zig-xdg-0.4.0.tar.xz", + .hash = "12206c1b6e163e79b83eb1e6cb1d575b256e603a0bbf9c2726e6f3235028eabbff41", }, }, } diff --git a/src/Installation.zig b/src/Installation.zig index 6565263..6e2e120 100644 --- a/src/Installation.zig +++ b/src/Installation.zig @@ -5,7 +5,7 @@ const zup = @import("root"); const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAllocator; const Config = zup.Config; -const ChildProcess = std.ChildProcess; +const ChildProcess = std.process.Child; const EasyHttp = zup.EasyHttp; const JsonValue = std.json.Value; const SemanticVersion = std.SemanticVersion; diff --git a/src/main.zig b/src/main.zig index f5b6c1e..57baac1 100644 --- a/src/main.zig +++ b/src/main.zig @@ -16,8 +16,8 @@ const std = @import("std"); const zup_config = @import("zup-config"); const ArgIterator = std.process.ArgIterator; -const ComptimeStringMap = std.ComptimeStringMap; const GPA = std.heap.GeneralPurposeAllocator(.{}); +const StaticStringMap = std.StaticStringMap; const Tuple = std.meta.Tuple; pub fn main() !void { @@ -65,7 +65,7 @@ const CommandMap = blk: { idx += 1; } - break :blk ComptimeStringMap(Command, map_data); + break :blk StaticStringMap(Command).initComptime(map_data); }; fn dispatch( -- cgit v1.2.3