authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-04-26 12:43:48 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-04-26 12:43:48 -07:00
log046eb90846a97391398a469bad3e0bf37c96c700
tree7283684a111ebcba098cb08774de08ad37494097
parentbe789458ab55d45d818c1eee30bf99a9ab4ff755

meta: update to zig master


9 files changed, 35 insertions(+), 24 deletions(-)

.github/workflows/nightly.yml+1-1
...@@ -26,7 +26,7 @@ jobs:...@@ -26,7 +26,7 @@ jobs:
26 - name: Setup Zig26 - name: Setup Zig
27 uses: goto-bus-stop/setup-zig@v127 uses: goto-bus-stop/setup-zig@v1
28 with:28 with:
29 version: "0.11.0-dev.1898+1a4a0b5e9"29 version: "0.11.0-dev.2777+b95cdf0ae"
3030
31 - run: zig version31 - run: zig version
32 - run: zig env32 - run: zig env
.github/workflows/push.yml+1-1
...@@ -19,7 +19,7 @@ jobs:...@@ -19,7 +19,7 @@ jobs:
19 - name: Setup Zig19 - name: Setup Zig
20 uses: goto-bus-stop/setup-zig@v120 uses: goto-bus-stop/setup-zig@v1
21 with:21 with:
22 version: "0.11.0-dev.1898+1a4a0b5e9"22 version: "0.11.0-dev.2777+b95cdf0ae"
2323
24 - run: zig version24 - run: zig version
25 - run: zig env25 - run: zig env
README.md+1-1
...@@ -17,7 +17,7 @@ A package manager for the Zig programming language....@@ -17,7 +17,7 @@ A package manager for the Zig programming language.
17- https://github.com/nektro/zigmod/releases17- https://github.com/nektro/zigmod/releases
1818
19## Built With19## Built With
20- Zig master (at least `0.11.0-dev.1898+1a4a0b5e9`)20- Zig master (at least `0.11.0-dev.2777+b95cdf0ae`)
21- See [`zig.mod`](./zig.mod) and [`zigmod.lock`](./zigmod.lock)21- See [`zig.mod`](./zig.mod) and [`zigmod.lock`](./zigmod.lock)
2222
23### Build from Source23### Build from Source
build.zig+2-3
...@@ -4,7 +4,6 @@ const builtin = @import("builtin");...@@ -4,7 +4,6 @@ const builtin = @import("builtin");
4const deps = @import("./deps.zig");4const deps = @import("./deps.zig");
55
6pub fn build(b: *std.build.Builder) void {6pub fn build(b: *std.build.Builder) void {
7 b.prominent_compile_errors = true;
8 const target = b.standardTargetOptions(.{});7 const target = b.standardTargetOptions(.{});
9 const optimize = b.standardOptimizeOption(.{});8 const optimize = b.standardOptimizeOption(.{});
10 const use_full_name = b.option(bool, "use-full-name", "") orelse false;9 const use_full_name = b.option(bool, "use-full-name", "") orelse false;
...@@ -17,9 +16,9 @@ pub fn build(b: *std.build.Builder) void {...@@ -17,9 +16,9 @@ pub fn build(b: *std.build.Builder) void {
17 exe_options.addOption(string, "version", b.option(string, "tag", "") orelse "dev");16 exe_options.addOption(string, "version", b.option(string, "tag", "") orelse "dev");
1817
19 deps.addAllTo(exe);18 deps.addAllTo(exe);
20 exe.install();19 b.installArtifact(exe);
2120
22 const run_cmd = exe.run();21 const run_cmd = b.addRunArtifact(exe);
23 run_cmd.step.dependOn(b.getInstallStep());22 run_cmd.step.dependOn(b.getInstallStep());
24 if (b.args) |args| {23 if (b.args) |args| {
25 run_cmd.addArgs(args);24 run_cmd.addArgs(args);
deps.zig+13-7
...@@ -13,7 +13,12 @@ pub const GitExactStep = struct {...@@ -13,7 +13,12 @@ pub const GitExactStep = struct {
13 pub fn create(b: *std.build.Builder, url: string, commit: string) *GitExactStep {13 pub fn create(b: *std.build.Builder, url: string, commit: string) *GitExactStep {
14 var result = b.allocator.create(GitExactStep) catch @panic("memory");14 var result = b.allocator.create(GitExactStep) catch @panic("memory");
15 result.* = GitExactStep{15 result.* = GitExactStep{
16 .step = std.build.Step.init(.custom, b.fmt("git clone {s} @ {s}", .{ url, commit }), b.allocator, make),16 .step = std.build.Step.init(.{
17 .id = .custom,
18 .name = b.fmt("git clone {s} @ {s}", .{ url, commit }),
19 .owner = b,
20 .makeFn = make,
21 }),
17 .builder = b,22 .builder = b,
18 .url = url,23 .url = url,
19 .commit = commit,24 .commit = commit,
...@@ -36,13 +41,14 @@ pub const GitExactStep = struct {...@@ -36,13 +41,14 @@ pub const GitExactStep = struct {
36 return result;41 return result;
37 }42 }
3843
39 fn make(step: *std.build.Step) !void {44 fn make(step: *std.build.Step, prog_node: *std.Progress.Node) !void {
40 _ = step;45 _ = step;
46 _ = prog_node;
41 }47 }
42};48};
4349
44pub fn fetch(exe: *std.build.LibExeObjStep) void {50pub fn fetch(exe: *std.build.LibExeObjStep) void {
45 const b = exe.builder;51 const b = exe.step.owner;
46 inline for (comptime std.meta.declarations(package_data)) |decl| {52 inline for (comptime std.meta.declarations(package_data)) |decl| {
47 const path = &@field(package_data, decl.name).entry;53 const path = &@field(package_data, decl.name).entry;
48 const root = if (@field(package_data, decl.name).store) |_| b.cache_root.path.? else ".";54 const root = if (@field(package_data, decl.name).store) |_| b.cache_root.path.? else ".";
...@@ -84,7 +90,7 @@ fn flip(foo: anytype) !void {...@@ -84,7 +90,7 @@ fn flip(foo: anytype) !void {
84pub fn addAllTo(exe: *std.build.LibExeObjStep) void {90pub fn addAllTo(exe: *std.build.LibExeObjStep) void {
85 checkMinZig(builtin.zig_version, exe);91 checkMinZig(builtin.zig_version, exe);
86 fetch(exe);92 fetch(exe);
87 const b = exe.builder;93 const b = exe.step.owner;
88 @setEvalBranchQuota(1_000_000);94 @setEvalBranchQuota(1_000_000);
89 for (packages) |pkg| {95 for (packages) |pkg| {
90 const moddep = pkg.zp(b);96 const moddep = pkg.zp(b);
...@@ -100,7 +106,7 @@ pub fn addAllTo(exe: *std.build.LibExeObjStep) void {...@@ -100,7 +106,7 @@ pub fn addAllTo(exe: *std.build.LibExeObjStep) void {
100 llc = true;106 llc = true;
101 }107 }
102 for (pkg.frameworks) |item| {108 for (pkg.frameworks) |item| {
103 if (!builtin.target.isDarwin()) @panic(exe.builder.fmt("a dependency is attempting to link to the framework {s}, which is only possible under Darwin", .{item}));109 if (!builtin.target.isDarwin()) @panic(exe.step.owner.fmt("a dependency is attempting to link to the framework {s}, which is only possible under Darwin", .{item}));
104 exe.linkFramework(item);110 exe.linkFramework(item);
105 llc = true;111 llc = true;
106 }112 }
...@@ -152,8 +158,8 @@ pub const Package = struct {...@@ -152,8 +158,8 @@ pub const Package = struct {
152};158};
153159
154fn checkMinZig(current: std.SemanticVersion, exe: *std.build.LibExeObjStep) void {160fn checkMinZig(current: std.SemanticVersion, exe: *std.build.LibExeObjStep) void {
155 const min = std.SemanticVersion.parse("0.11.0-dev.1681+0bb178bbb") catch return;161 const min = std.SemanticVersion.parse("0.11.0-dev.2777+b95cdf0ae") catch return;
156 if (current.order(min).compare(.lt)) @panic(exe.builder.fmt("Your Zig version v{} does not meet the minimum build requirement of v{}", .{current, min}));162 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}));
157}163}
158164
159pub const package_data = struct {165pub const package_data = struct {
docs/README.md+1-1
...@@ -10,7 +10,7 @@ The rest of this documentation will assume you already have Zig installed....@@ -10,7 +10,7 @@ The rest of this documentation will assume you already have Zig installed.
1010
11As 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.11As 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.11.0-dev.1898+1a4a0b5e9`.13The earliest Zig release this Zigmod was verified to work with is `0.11.0-dev.2777+b95cdf0ae`.
1414
15## Download15## Download
16You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source.16You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source.
src/cmd/fetch.zig+3-3
...@@ -49,7 +49,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -49,7 +49,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
49 try w.writeAll(49 try w.writeAll(
50 \\pub fn addAllTo(exe: *std.build.LibExeObjStep) void {50 \\pub fn addAllTo(exe: *std.build.LibExeObjStep) void {
51 \\ checkMinZig(builtin.zig_version, exe);51 \\ checkMinZig(builtin.zig_version, exe);
52 \\ const b = exe.builder;52 \\ const b = exe.step.owner;
53 \\ @setEvalBranchQuota(1_000_000);53 \\ @setEvalBranchQuota(1_000_000);
54 \\ for (packages) |pkg| {54 \\ for (packages) |pkg| {
55 \\ const moddep = pkg.zp(b);55 \\ const moddep = pkg.zp(b);
...@@ -64,7 +64,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -64,7 +64,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
64 \\ llc = true;64 \\ llc = true;
65 \\ }65 \\ }
66 \\ for (pkg.frameworks) |item| {66 \\ for (pkg.frameworks) |item| {
67 \\ if (!builtin.target.isDarwin()) @panic(exe.builder.fmt("a dependency is attempting to link to the framework {s}, which is only possible under Darwin", .{item}));67 \\ if (!builtin.target.isDarwin()) @panic(b.fmt("a dependency is attempting to link to the framework {s}, which is only possible under Darwin", .{item}));
68 \\ exe.linkFramework(item);68 \\ exe.linkFramework(item);
69 \\ llc = true;69 \\ llc = true;
70 \\ }70 \\ }
...@@ -126,7 +126,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -126,7 +126,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
126 try w.print(126 try w.print(
127 \\fn checkMinZig(current: std.SemanticVersion, exe: *std.build.LibExeObjStep) void {{127 \\fn checkMinZig(current: std.SemanticVersion, exe: *std.build.LibExeObjStep) void {{
128 \\ const min = std.SemanticVersion.parse("{?}") catch return;128 \\ const min = std.SemanticVersion.parse("{?}") catch return;
129 \\ if (current.order(min).compare(.lt)) @panic(exe.builder.fmt("Your Zig version v{{}} does not meet the minimum build requirement of v{{}}", .{{current, min}}));129 \\ 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}}));
130 \\}}130 \\}}
131 \\131 \\
132 \\132 \\
src/cmd/generate.zig+12-6
...@@ -52,7 +52,12 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -52,7 +52,12 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
52 \\ pub fn create(b: *std.build.Builder, url: string, commit: string) *GitExactStep {52 \\ pub fn create(b: *std.build.Builder, url: string, commit: string) *GitExactStep {
53 \\ var result = b.allocator.create(GitExactStep) catch @panic("memory");53 \\ var result = b.allocator.create(GitExactStep) catch @panic("memory");
54 \\ result.* = GitExactStep{54 \\ result.* = GitExactStep{
55 \\ .step = std.build.Step.init(.custom, b.fmt("git clone {s} @ {s}", .{ url, commit }), b.allocator, make),55 \\ .step = std.build.Step.init(.{
56 \\ .id = .custom,
57 \\ .name = b.fmt("git clone {s} @ {s}", .{ url, commit }),
58 \\ .owner = b,
59 \\ .makeFn = make,
60 \\ }),
56 \\ .builder = b,61 \\ .builder = b,
57 \\ .url = url,62 \\ .url = url,
58 \\ .commit = commit,63 \\ .commit = commit,
...@@ -77,13 +82,14 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -77,13 +82,14 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
77 \\ return result;82 \\ return result;
78 \\ }83 \\ }
79 \\84 \\
80 \\ fn make(step: *std.build.Step) !void {85 \\ fn make(step: *std.build.Step, prog_node: *std.Progress.Node) !void {
81 \\ _ = step;86 \\ _ = step;
87 \\ _ = prog_node;
82 \\ }88 \\ }
83 \\};89 \\};
84 \\90 \\
85 \\pub fn fetch(exe: *std.build.LibExeObjStep) void {91 \\pub fn fetch(exe: *std.build.LibExeObjStep) void {
86 \\ const b = exe.builder;92 \\ const b = exe.step.owner;
87 \\ inline for (comptime std.meta.declarations(package_data)) |decl| {93 \\ inline for (comptime std.meta.declarations(package_data)) |decl| {
88 \\ const path = &@field(package_data, decl.name).entry;94 \\ const path = &@field(package_data, decl.name).entry;
89 \\ const root = if (@field(package_data, decl.name).store) |_| b.cache_root.path.? else ".";95 \\ const root = if (@field(package_data, decl.name).store) |_| b.cache_root.path.? else ".";
...@@ -119,7 +125,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -119,7 +125,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
119 \\pub fn addAllTo(exe: *std.build.LibExeObjStep) void {125 \\pub fn addAllTo(exe: *std.build.LibExeObjStep) void {
120 \\ checkMinZig(builtin.zig_version, exe);126 \\ checkMinZig(builtin.zig_version, exe);
121 \\ fetch(exe);127 \\ fetch(exe);
122 \\ const b = exe.builder;128 \\ const b = exe.step.owner;
123 \\ @setEvalBranchQuota(1_000_000);129 \\ @setEvalBranchQuota(1_000_000);
124 \\ for (packages) |pkg| {130 \\ for (packages) |pkg| {
125 \\ const moddep = pkg.zp(b);131 \\ const moddep = pkg.zp(b);
...@@ -135,7 +141,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -135,7 +141,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
135 \\ llc = true;141 \\ llc = true;
136 \\ }142 \\ }
137 \\ for (pkg.frameworks) |item| {143 \\ for (pkg.frameworks) |item| {
138 \\ if (!builtin.target.isDarwin()) @panic(exe.builder.fmt("a dependency is attempting to link to the framework {s}, which is only possible under Darwin", .{item}));144 \\ if (!builtin.target.isDarwin()) @panic(exe.step.owner.fmt("a dependency is attempting to link to the framework {s}, which is only possible under Darwin", .{item}));
139 \\ exe.linkFramework(item);145 \\ exe.linkFramework(item);
140 \\ llc = true;146 \\ llc = true;
141 \\ }147 \\ }
...@@ -192,7 +198,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -192,7 +198,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
192 try w.print(198 try w.print(
193 \\fn checkMinZig(current: std.SemanticVersion, exe: *std.build.LibExeObjStep) void {{199 \\fn checkMinZig(current: std.SemanticVersion, exe: *std.build.LibExeObjStep) void {{
194 \\ const min = std.SemanticVersion.parse("{?}") catch return;200 \\ const min = std.SemanticVersion.parse("{?}") catch return;
195 \\ if (current.order(min).compare(.lt)) @panic(exe.builder.fmt("Your Zig version v{{}} does not meet the minimum build requirement of v{{}}", .{{current, min}}));201 \\ 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}}));
196 \\}}202 \\}}
197 \\203 \\
198 \\204 \\
zig.mod+1-1
...@@ -3,7 +3,7 @@ name: zigmod...@@ -3,7 +3,7 @@ name: zigmod
3main: src/lib.zig3main: src/lib.zig
4license: MIT4license: MIT
5description: A package manager for the Zig programming language.5description: A package manager for the Zig programming language.
6min_zig_version: 0.11.0-dev.1898+1a4a0b5e96min_zig_version: 0.11.0-dev.2777+b95cdf0ae
7dependencies:7dependencies:
8 - src: git https://github.com/nektro/zig-yaml8 - src: git https://github.com/nektro/zig-yaml
9 - src: git https://github.com/nektro/zig-ansi9 - src: git https://github.com/nektro/zig-ansi