authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-09-07 16:15:19 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-09-07 16:15:49 -07:00
log2c004d07b20f8b9d7369426721d4fc4b107a435f
tree2a6958185dcae4f34183fc0f5cbf8ac721a4eb66
parenta9c075a8176a61e1af28cc951a438915679e3c40

upgrade to Zig 0.13


15 files changed, 22 insertions(+), 19 deletions(-)

.github/workflows/nightly.yml+1-1
......@@ -27,7 +27,7 @@ jobs:
2727 uses: mlugg/setup-zig@v1
2828 with:
2929 mirror: "http://mirrors.nektro.net/s3cgi"
30 version: "0.12.0"
30 version: "0.13.0"
3131
3232 - run: zig version
3333 - run: zig env
.github/workflows/push.yml+1-1
......@@ -20,7 +20,7 @@ jobs:
2020 uses: mlugg/setup-zig@v1
2121 with:
2222 mirror: "http://mirrors.nektro.net/s3cgi"
23 version: "0.12.0"
23 version: "0.13.0"
2424
2525 - run: zig version
2626 - run: zig env
.gitignore+3-1
......@@ -1,3 +1,5 @@
1zig-*
1zig-cache
2.zig-cache
3zig-out
24.zigmod
35bin
README.md+1-1
......@@ -16,7 +16,7 @@ A package manager for the Zig programming language.
1616- https://github.com/nektro/zigmod/releases
1717
1818## Built With
19- Zig master (at least `0.12.0`)
19- Zig `0.13.0`
2020- See [`zig.mod`](./zig.mod) and [`zigmod.lock`](./zigmod.lock)
2121
2222### Build from Source
build.zig+1-1
......@@ -11,7 +11,7 @@ pub fn build(b: *std.Build) void {
1111 const exe_name = b.fmt("{s}{s}", .{ "zigmod", if (use_full_name) with_arch_os else "" });
1212 const exe = b.addExecutable(.{
1313 .name = exe_name,
14 .root_source_file = .{ .path = "src/main.zig" },
14 .root_source_file = b.path("src/main.zig"),
1515 .target = target,
1616 .optimize = mode,
1717 });
deps.zig+3-3
......@@ -40,7 +40,7 @@ pub const GitExactStep = struct {
4040 return result;
4141 }
4242
43 fn make(step: *std.Build.Step, prog_node: *std.Progress.Node) !void {
43 fn make(step: *std.Build.Step, prog_node: std.Progress.Node) !void {
4444 _ = step;
4545 _ = prog_node;
4646 }
......@@ -126,7 +126,7 @@ pub const Package = struct {
126126 });
127127 dummy_library.step.dependOn(fetch_step);
128128 if (self.entry) |capture| {
129 result.root_source_file = .{ .path = capture };
129 result.root_source_file = .{ .cwd_relative = capture };
130130 }
131131 for (self.deps) |item| {
132132 const module_dep = item.module(exe, fetch_step);
......@@ -168,7 +168,7 @@ pub const Package = struct {
168168};
169169
170170fn checkMinZig(current: std.SemanticVersion, exe: *std.Build.Step.Compile) void {
171 const min = std.SemanticVersion.parse("0.12.0") catch return;
171 const min = std.SemanticVersion.parse("0.13.0") catch return;
172172 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}));
173173}
174174
docs/README.md+1-1
......@@ -10,7 +10,7 @@ The rest of this documentation will assume you already have Zig installed.
1010
1111As 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.
1212
13The earliest Zig release this Zigmod was verified to work with is `0.12.0`.
13The earliest Zig release this Zigmod was verified to work with is `0.13.0`.
1414
1515## Download
1616You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source.
src/cmd/aquila/install.zig+1-1
......@@ -70,7 +70,7 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void {
7070 "--prefix", try std.fs.path.join(gpa, &.{ homepath, ".zigmod" }),
7171 "--cache-dir", try std.fs.path.join(gpa, &.{ cache.?, "zigmod", "zig" }),
7272 };
73 var proc = std.ChildProcess.init(argv, gpa);
73 var proc = std.process.Child.init(argv, gpa);
7474 proc.cwd = modpath;
7575 const term = try proc.spawnAndWait();
7676 switch (term) {
src/cmd/aquila/update.zig+1-1
......@@ -56,7 +56,7 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void {
5656 "--prefix", try std.fs.path.join(gpa, &.{ homepath, ".zigmod" }),
5757 "--cache-dir", try std.fs.path.join(gpa, &.{ cache.?, "zigmod", "zig" }),
5858 };
59 var proc = std.ChildProcess.init(argv, gpa);
59 var proc = std.process.Child.init(argv, gpa);
6060 proc.cwd = modpath;
6161 const term = try proc.spawnAndWait();
6262 switch (term) {
src/cmd/fetch.zig+1-1
......@@ -329,7 +329,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul
329329 });
330330 if (mod.main.len > 0 and !std.mem.eql(u8, &mod.id, &zigmod.Module.ROOT)) {
331331 try w.print(
332 \\ .import = .{{ "{s}", .{{ .path = dirs._{s} ++ "/{s}" }} }},
332 \\ .import = .{{ "{s}", .{{ .cwd_relative = dirs._{s} ++ "/{s}" }} }},
333333 \\
334334 , .{
335335 mod.name,
src/cmd/generate.zig+2-2
......@@ -83,7 +83,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
8383 \\ return result;
8484 \\ }
8585 \\
86 \\ fn make(step: *std.Build.Step, prog_node: *std.Progress.Node) !void {
86 \\ fn make(step: *std.Build.Step, prog_node: std.Progress.Node) !void {
8787 \\ _ = step;
8888 \\ _ = prog_node;
8989 \\ }
......@@ -162,7 +162,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
162162 \\ });
163163 \\ dummy_library.step.dependOn(fetch_step);
164164 \\ if (self.entry) |capture| {
165 \\ result.root_source_file = .{ .path = capture };
165 \\ result.root_source_file = .{ .cwd_relative = capture };
166166 \\ }
167167 \\ for (self.deps) |item| {
168168 \\ const module_dep = item.module(exe, fetch_step);
src/cmd/init.zig+2-1
......@@ -147,7 +147,8 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void {
147147 if (len > 0 and (try file.reader().readByte()) != '\n') {
148148 try w.writeAll("\n");
149149 }
150 if (!exists) try w.writeAll("zig-*\n");
150 if (!exists) try w.writeAll(".zig-cache\n");
151 if (!exists) try w.writeAll("zig-out\n");
151152 try w.writeAll(".zigmod\n");
152153 try w.writeAll("deps.zig\n");
153154 try w.writeAll("files.zig\n");
src/main.zig+1-1
......@@ -56,7 +56,7 @@ pub fn main() !void {
5656 for (args[1..]) |item| {
5757 try sub_cmd_args.append(item);
5858 }
59 const result = std.ChildProcess.run(.{ .allocator = gpa, .argv = sub_cmd_args.items }) catch |e| switch (e) {
59 const result = std.process.Child.run(.{ .allocator = gpa, .argv = sub_cmd_args.items }) catch |e| switch (e) {
6060 else => |ee| return ee,
6161 error.FileNotFound => {
6262 fail("unknown command \"{s}\" for \"zigmod\"", .{args[0]});
src/util/funcs.zig+2-2
......@@ -53,8 +53,8 @@ pub fn file_list(alloc: std.mem.Allocator, dpath: string) ![]const string {
5353 return try extras.fileList(alloc, dir);
5454}
5555
56pub fn run_cmd_raw(alloc: std.mem.Allocator, dir: ?string, args: []const string) !std.ChildProcess.RunResult {
57 return std.ChildProcess.run(.{ .allocator = alloc, .cwd = dir, .argv = args, .max_output_bytes = std.math.maxInt(usize) }) catch |e| switch (e) {
56pub fn run_cmd_raw(alloc: std.mem.Allocator, dir: ?string, args: []const string) !std.process.Child.RunResult {
57 return std.process.Child.run(.{ .allocator = alloc, .cwd = dir, .argv = args, .max_output_bytes = std.math.maxInt(usize) }) catch |e| switch (e) {
5858 error.FileNotFound => {
5959 u.fail("\"{s}\" command not found", .{args[0]});
6060 },
zig.mod+1-1
......@@ -3,7 +3,7 @@ name: zigmod
33main: src/lib.zig
44license: MIT
55description: A package manager for the Zig programming language.
6min_zig_version: 0.12.0
6min_zig_version: 0.13.0
77dependencies:
88 - src: git https://github.com/nektro/zig-yaml
99 - src: git https://github.com/nektro/zig-ansi