diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c2d234363aef74cc317deaac5891c5bb78f6b7b5..9c2a65792d5da15415aa9ff84bc0672594f713f7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -27,7 +27,7 @@ jobs: uses: mlugg/setup-zig@v1 with: mirror: "http://mirrors.nektro.net/s3cgi" - version: "0.12.0" + version: "0.13.0" - run: zig version - run: zig env diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b790f44febe29a2b4fd7bd5df8e84453704779c2..242c6543c6e1ff6c1a3e6a50e3a813c1da7eb05d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -20,7 +20,7 @@ jobs: uses: mlugg/setup-zig@v1 with: mirror: "http://mirrors.nektro.net/s3cgi" - version: "0.12.0" + version: "0.13.0" - run: zig version - run: zig env diff --git a/.gitignore b/.gitignore index f1b7c4e6ccaeae31245f3b0983be130f81f115f4..4190bf347ddad046b7185bcf61b5bab5ee9b11f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ -zig-* +zig-cache +.zig-cache +zig-out .zigmod bin diff --git a/README.md b/README.md index a7d20896cd88920ba8b388d3fba4e60884e1b75b..7ec64afcb67879a6d8c480ce1958cbc8d8ff969b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ A package manager for the Zig programming language. - https://github.com/nektro/zigmod/releases ## Built With -- Zig master (at least `0.12.0`) +- Zig `0.13.0` - See [`zig.mod`](./zig.mod) and [`zigmod.lock`](./zigmod.lock) ### Build from Source diff --git a/build.zig b/build.zig index cabb618f4a23e445461657e75773d528c03ead4a..43b9a1d8b6f6c5dcf03bba5575be8b79041ee7cc 100644 --- a/build.zig +++ b/build.zig @@ -11,7 +11,7 @@ pub fn build(b: *std.Build) void { const exe_name = b.fmt("{s}{s}", .{ "zigmod", if (use_full_name) with_arch_os else "" }); const exe = b.addExecutable(.{ .name = exe_name, - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = b.path("src/main.zig"), .target = target, .optimize = mode, }); diff --git a/deps.zig b/deps.zig index db843da6a8fbb8833cf6ac66c6d22d5b4bef7152..ebb82014301fff2d04be87c7b38865139299abca 100644 --- a/deps.zig +++ b/deps.zig @@ -40,7 +40,7 @@ pub const GitExactStep = struct { return result; } - fn make(step: *std.Build.Step, prog_node: *std.Progress.Node) !void { + fn make(step: *std.Build.Step, prog_node: std.Progress.Node) !void { _ = step; _ = prog_node; } @@ -126,7 +126,7 @@ pub const Package = struct { }); dummy_library.step.dependOn(fetch_step); if (self.entry) |capture| { - result.root_source_file = .{ .path = capture }; + result.root_source_file = .{ .cwd_relative = capture }; } for (self.deps) |item| { const module_dep = item.module(exe, fetch_step); @@ -168,7 +168,7 @@ pub const Package = struct { }; fn checkMinZig(current: std.SemanticVersion, exe: *std.Build.Step.Compile) void { - const min = std.SemanticVersion.parse("0.12.0") catch return; + const min = std.SemanticVersion.parse("0.13.0") catch return; if (current.order(min).compare(.lt)) @panic(exe.step.owner.fmt("Your Zig version v{} does not meet the minimum build requirement of v{}", .{current, min})); } diff --git a/docs/README.md b/docs/README.md index 7fb65fbd2eefd8ee793809a0157acff0a476c752..0205ee1d54674336571368a9c1c1057cb44049bf 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,7 +10,7 @@ The rest of this documentation will assume you already have Zig installed. As Zig is still in development itself, if you plan to contribute to Zigmod you will need a master download of Zig. Those can be obtained from https://ziglang.org/download/#release-master. -The earliest Zig release this Zigmod was verified to work with is `0.12.0`. +The earliest Zig release this Zigmod was verified to work with is `0.13.0`. ## Download You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source. diff --git a/src/cmd/aquila/install.zig b/src/cmd/aquila/install.zig index 459b0de22dac3e2d183dbff299eafbcebf3b5b7b..b5b27c5c73538799f1390511170dfae1836103f8 100644 --- a/src/cmd/aquila/install.zig +++ b/src/cmd/aquila/install.zig @@ -70,7 +70,7 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { "--prefix", try std.fs.path.join(gpa, &.{ homepath, ".zigmod" }), "--cache-dir", try std.fs.path.join(gpa, &.{ cache.?, "zigmod", "zig" }), }; - var proc = std.ChildProcess.init(argv, gpa); + var proc = std.process.Child.init(argv, gpa); proc.cwd = modpath; const term = try proc.spawnAndWait(); switch (term) { diff --git a/src/cmd/aquila/update.zig b/src/cmd/aquila/update.zig index ee3fd3d28d05963079f45d8f4810c8578a5b7c60..a989eda571aff084c4323fe9665d487b29dc3061 100644 --- a/src/cmd/aquila/update.zig +++ b/src/cmd/aquila/update.zig @@ -56,7 +56,7 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { "--prefix", try std.fs.path.join(gpa, &.{ homepath, ".zigmod" }), "--cache-dir", try std.fs.path.join(gpa, &.{ cache.?, "zigmod", "zig" }), }; - var proc = std.ChildProcess.init(argv, gpa); + var proc = std.process.Child.init(argv, gpa); proc.cwd = modpath; const term = try proc.spawnAndWait(); switch (term) { diff --git a/src/cmd/fetch.zig b/src/cmd/fetch.zig index 88474a0389d1fa7ba48dbcd49c87a64d53053b90..6e317ea8762608a6178c4105ec33a901672d653e 100644 --- a/src/cmd/fetch.zig +++ b/src/cmd/fetch.zig @@ -329,7 +329,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul }); if (mod.main.len > 0 and !std.mem.eql(u8, &mod.id, &zigmod.Module.ROOT)) { try w.print( - \\ .import = .{{ "{s}", .{{ .path = dirs._{s} ++ "/{s}" }} }}, + \\ .import = .{{ "{s}", .{{ .cwd_relative = dirs._{s} ++ "/{s}" }} }}, \\ , .{ mod.name, diff --git a/src/cmd/generate.zig b/src/cmd/generate.zig index 8807b50970feacfa5f4181b555609ba7a5acd8b1..29c8758c0cd0ce5234266171d6b1b160c70e404d 100644 --- a/src/cmd/generate.zig +++ b/src/cmd/generate.zig @@ -83,7 +83,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D \\ return result; \\ } \\ - \\ fn make(step: *std.Build.Step, prog_node: *std.Progress.Node) !void { + \\ fn make(step: *std.Build.Step, prog_node: std.Progress.Node) !void { \\ _ = step; \\ _ = prog_node; \\ } @@ -162,7 +162,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D \\ }); \\ dummy_library.step.dependOn(fetch_step); \\ if (self.entry) |capture| { - \\ result.root_source_file = .{ .path = capture }; + \\ result.root_source_file = .{ .cwd_relative = capture }; \\ } \\ for (self.deps) |item| { \\ const module_dep = item.module(exe, fetch_step); diff --git a/src/cmd/init.zig b/src/cmd/init.zig index 42fe43c5b23d9d3114d4722f5b38e99a7cafd6bc..1c34c715a49e9bc96ca6afba11e98e123d3fdf4c 100644 --- a/src/cmd/init.zig +++ b/src/cmd/init.zig @@ -147,7 +147,8 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { if (len > 0 and (try file.reader().readByte()) != '\n') { try w.writeAll("\n"); } - if (!exists) try w.writeAll("zig-*\n"); + if (!exists) try w.writeAll(".zig-cache\n"); + if (!exists) try w.writeAll("zig-out\n"); try w.writeAll(".zigmod\n"); try w.writeAll("deps.zig\n"); try w.writeAll("files.zig\n"); diff --git a/src/main.zig b/src/main.zig index 60c626992ffed57ec6a31a54da4b7c6e8ee968a0..d6b8ce6031a94b47a3511faa199f168dbe27e435 100644 --- a/src/main.zig +++ b/src/main.zig @@ -56,7 +56,7 @@ pub fn main() !void { for (args[1..]) |item| { try sub_cmd_args.append(item); } - const result = std.ChildProcess.run(.{ .allocator = gpa, .argv = sub_cmd_args.items }) catch |e| switch (e) { + const result = std.process.Child.run(.{ .allocator = gpa, .argv = sub_cmd_args.items }) catch |e| switch (e) { else => |ee| return ee, error.FileNotFound => { fail("unknown command \"{s}\" for \"zigmod\"", .{args[0]}); diff --git a/src/util/funcs.zig b/src/util/funcs.zig index 27f2751c5f8bbcc7ff9a7f1c32e469db0dcd1582..36659a5e1ee44b37281d3ec4a06ba571f36d8f1c 100644 --- a/src/util/funcs.zig +++ b/src/util/funcs.zig @@ -53,8 +53,8 @@ pub fn file_list(alloc: std.mem.Allocator, dpath: string) ![]const string { return try extras.fileList(alloc, dir); } -pub fn run_cmd_raw(alloc: std.mem.Allocator, dir: ?string, args: []const string) !std.ChildProcess.RunResult { - return std.ChildProcess.run(.{ .allocator = alloc, .cwd = dir, .argv = args, .max_output_bytes = std.math.maxInt(usize) }) catch |e| switch (e) { +pub fn run_cmd_raw(alloc: std.mem.Allocator, dir: ?string, args: []const string) !std.process.Child.RunResult { + return std.process.Child.run(.{ .allocator = alloc, .cwd = dir, .argv = args, .max_output_bytes = std.math.maxInt(usize) }) catch |e| switch (e) { error.FileNotFound => { u.fail("\"{s}\" command not found", .{args[0]}); }, diff --git a/zig.mod b/zig.mod index 3458c2ae4cf6b903c9e79913c18a6a687072ea72..2ccaa336fdb1d56d6199b29f53eed5ce39d2c1d7 100644 --- a/zig.mod +++ b/zig.mod @@ -3,7 +3,7 @@ name: zigmod main: src/lib.zig license: MIT description: A package manager for the Zig programming language. -min_zig_version: 0.12.0 +min_zig_version: 0.13.0 dependencies: - src: git https://github.com/nektro/zig-yaml - src: git https://github.com/nektro/zig-ansi