authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-08-10 01:28:28 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-08-10 01:28:28 -07:00
log50ccfe3d1d84b4f27a4bb66fd4321623663a0163
treeea506efe4f98adc203eccd6a583d1c8544cd3c6f
parent21b73b05d10bc8aaf98724c0970be67249c5a0bf

update to Zig 0.11.0


17 files changed, 66 insertions(+), 74 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@v227 uses: goto-bus-stop/setup-zig@v2
28 with:28 with:
29 version: "0.11.0-dev.3652+f5043ad6a"29 version: "0.11.0"
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@v220 uses: goto-bus-stop/setup-zig@v2
21 with:21 with:
22 version: "0.11.0-dev.3652+f5043ad6a"22 version: "0.11.0"
2323
24 - run: zig version24 - run: zig version
25 - run: zig env25 - run: zig env
README.md+1-1
...@@ -16,7 +16,7 @@ A package manager for the Zig programming language....@@ -16,7 +16,7 @@ A package manager for the Zig programming language.
16- https://github.com/nektro/zigmod/releases16- https://github.com/nektro/zigmod/releases
1717
18## Built With18## Built With
19- Zig master (at least `0.11.0-dev.3620+c76ce25a6`)19- Zig master (at least `0.11.0`)
20- See [`zig.mod`](./zig.mod) and [`zigmod.lock`](./zigmod.lock)20- See [`zig.mod`](./zig.mod) and [`zigmod.lock`](./zigmod.lock)
2121
22### Build from Source22### Build from Source
deps.zig+31-37
...@@ -55,23 +55,22 @@ pub fn fetch(exe: *std.build.LibExeObjStep) void {...@@ -55,23 +55,22 @@ pub fn fetch(exe: *std.build.LibExeObjStep) void {
55 const root = if (@field(package_data, decl.name).store) |_| b.cache_root.path.? else ".";55 const root = if (@field(package_data, decl.name).store) |_| b.cache_root.path.? else ".";
56 if (path.* != null) path.* = b.fmt("{s}/zigmod/deps{s}", .{ root, path.*.? });56 if (path.* != null) path.* = b.fmt("{s}/zigmod/deps{s}", .{ root, path.*.? });
57 }57 }
58 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/MasterQ32/zig-uri", "d4299ad6043ad19f2ce0676687b0bff57273eae2").step);58 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/marlersoft/zigwin32", "007649ade45ffb544de3aafbb112de25064d3d92").step);
59 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/marlersoft/zigwin32", "b70e7f818d77a0c0f39b0bd9c549e16439ff5780").step);59 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/arqv-ini", "ddbe89bb0d9085e939bcbc713caeb2b7cf852bae").step);
60 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/arqv-ini", "ee395fd34e152d9067def609d86b7af5382b83b1").step);60 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/iguanaTLS", "c932f557865abaa1d06cd88e9b22a9f3e583fa59").step);
61 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/iguanaTLS", "e70995575b397f33d798339d4f1656bcdf0ab82f").step);61 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zfetch", "f51277414a2309f776fb79f3d55f26e37f9a54da").step);
62 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-ansi", "faf9585bfe5980c24748ee8a3e6a22faaa50b437").step);62 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-ansi", "ac607e4e7ac36d46cc67c8786262578330543a36").step);
63 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-detect-license", "8f13721bd18c0e546841b6f2e11da839550d6287").step);63 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-detect-license", "8f13721bd18c0e546841b6f2e11da839550d6287").step);
64 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-extras", "ff267312e8d714c9b9d8c44ad3291f6e509dc12f").step);64 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-extras", "54abdc5bce0b243601ef4808bce1c29e1a46cdec").step);
65 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-inquirer", "5cc2a5565d04fe2c0085f0d6818590e800d9dcf7").step);65 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-inquirer", "5cc2a5565d04fe2c0085f0d6818590e800d9dcf7").step);
66 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-leven", "550cabd5a18ace5e67761bc5b867c10e926f4314").step);66 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-leven", "550cabd5a18ace5e67761bc5b867c10e926f4314").step);
67 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses", "c9b8cbf3565675a056ad4e9b57cb4f84020e7680").step);67 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses", "c9b8cbf3565675a056ad4e9b57cb4f84020e7680").step);
68 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses-text", "3c07c6e4eb0965dafd0b029c632f823631b3169c").step);68 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses-text", "3c07c6e4eb0965dafd0b029c632f823631b3169c").step);
69 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-range", "4b2f12808aa09be4b27a163efc424dd4e0415992").step);69 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-range", "4b2f12808aa09be4b27a163efc424dd4e0415992").step);
70 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-time", "ca9c0e6b644d74c1d549cc2c1ee22113aa021bd8").step);
71 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-yaml", "e56b9fed6c0afd1c4d29bedc08c3899ffe1165e9").step);70 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-yaml", "e56b9fed6c0afd1c4d29bedc08c3899ffe1165e9").step);
72 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/truemedian/hzzp", "501386e13b2f7849128f3b271d23de6127b1d9d7").step);71 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-time", "12fad367a5282827aad7e12f0e9cd36f672c4010").step);
73 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/truemedian/zfetch", "829973144f680cd16be16923041fa810c1dee417").step);72 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/truemedian/hzzp", "305aca97fce78eb3e787d57691a5eed5512bece7").step);
74 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/ziglibs/known-folders", "d13ba6137084e55f873f6afb67447fe8906cc951").step);73 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/ziglibs/known-folders", "fa75e1bc672952efa0cf06160bbd942b47f6d59b").step);
75 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/yaml/libyaml", "2c891fc7a770e8ba2fec34fc6b545c672beb37e6").step);74 exe.step.dependOn(&GitExactStep.create(b, "https://github.com/yaml/libyaml", "2c891fc7a770e8ba2fec34fc6b545c672beb37e6").step);
76}75}
7776
...@@ -111,11 +110,11 @@ pub fn addAllTo(exe: *std.build.LibExeObjStep) void {...@@ -111,11 +110,11 @@ pub fn addAllTo(exe: *std.build.LibExeObjStep) void {
111 llc = true;110 llc = true;
112 }111 }
113 for (pkg.c_include_dirs) |item| {112 for (pkg.c_include_dirs) |item| {
114 exe.addIncludePath(b.fmt("{s}/{s}", .{ root, item }));113 exe.addIncludePath(.{.path = b.fmt("{s}/{s}", .{ root, item })});
115 llc = true;114 llc = true;
116 }115 }
117 for (pkg.c_source_files) |item| {116 for (pkg.c_source_files) |item| {
118 exe.addCSourceFile(b.fmt("{s}/{s}", .{ root, item }), pkg.c_source_flags);117 exe.addCSourceFile(.{ .file = .{ .path = b.fmt("{s}/{s}", .{ root, item }) }, .flags = pkg.c_source_flags });
119 llc = true;118 llc = true;
120 }119 }
121 vcpkg = vcpkg or pkg.vcpkg;120 vcpkg = vcpkg or pkg.vcpkg;
...@@ -158,40 +157,35 @@ pub const Package = struct {...@@ -158,40 +157,35 @@ pub const Package = struct {
158};157};
159158
160fn checkMinZig(current: std.SemanticVersion, exe: *std.build.LibExeObjStep) void {159fn checkMinZig(current: std.SemanticVersion, exe: *std.build.LibExeObjStep) void {
161 const min = std.SemanticVersion.parse("0.11.0-dev.3620+c76ce25a6") catch return;160 const min = std.SemanticVersion.parse("0.11.0") catch return;
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}));161 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}));
163}162}
164163
165pub const package_data = struct {164pub const package_data = struct {
166 pub var _u9w9dpp6p804 = Package{
167 .store = "/git/github.com/MasterQ32/zig-uri/d4299ad6043ad19f2ce0676687b0bff57273eae2",
168 .name = "uri",
169 .entry = "/git/github.com/MasterQ32/zig-uri/d4299ad6043ad19f2ce0676687b0bff57273eae2/uri.zig",
170 };
171 pub var _o6ogpor87xc2 = Package{165 pub var _o6ogpor87xc2 = Package{
172 .store = "/git/github.com/marlersoft/zigwin32/b70e7f818d77a0c0f39b0bd9c549e16439ff5780",166 .store = "/git/github.com/marlersoft/zigwin32/007649ade45ffb544de3aafbb112de25064d3d92",
173 .name = "win32",167 .name = "win32",
174 .entry = "/git/github.com/marlersoft/zigwin32/b70e7f818d77a0c0f39b0bd9c549e16439ff5780/win32.zig",168 .entry = "/git/github.com/marlersoft/zigwin32/007649ade45ffb544de3aafbb112de25064d3d92/win32.zig",
175 };169 };
176 pub var _u7sysdckdymi = Package{170 pub var _u7sysdckdymi = Package{
177 .store = "/git/github.com/nektro/arqv-ini/ee395fd34e152d9067def609d86b7af5382b83b1",171 .store = "/git/github.com/nektro/arqv-ini/ddbe89bb0d9085e939bcbc713caeb2b7cf852bae",
178 .name = "ini",172 .name = "ini",
179 .entry = "/git/github.com/nektro/arqv-ini/ee395fd34e152d9067def609d86b7af5382b83b1/src/ini.zig",173 .entry = "/git/github.com/nektro/arqv-ini/ddbe89bb0d9085e939bcbc713caeb2b7cf852bae/src/ini.zig",
180 };174 };
181 pub var _csbnipaad8n7 = Package{175 pub var _csbnipaad8n7 = Package{
182 .store = "/git/github.com/nektro/iguanaTLS/e70995575b397f33d798339d4f1656bcdf0ab82f",176 .store = "/git/github.com/nektro/iguanaTLS/c932f557865abaa1d06cd88e9b22a9f3e583fa59",
183 .name = "iguanaTLS",177 .name = "iguanaTLS",
184 .entry = "/git/github.com/nektro/iguanaTLS/e70995575b397f33d798339d4f1656bcdf0ab82f/src/main.zig",178 .entry = "/git/github.com/nektro/iguanaTLS/c932f557865abaa1d06cd88e9b22a9f3e583fa59/src/main.zig",
185 };179 };
186 pub var _s84v9o48ucb0 = Package{180 pub var _s84v9o48ucb0 = Package{
187 .store = "/git/github.com/nektro/zig-ansi/faf9585bfe5980c24748ee8a3e6a22faaa50b437",181 .store = "/git/github.com/nektro/zig-ansi/ac607e4e7ac36d46cc67c8786262578330543a36",
188 .name = "ansi",182 .name = "ansi",
189 .entry = "/git/github.com/nektro/zig-ansi/faf9585bfe5980c24748ee8a3e6a22faaa50b437/src/lib.zig",183 .entry = "/git/github.com/nektro/zig-ansi/ac607e4e7ac36d46cc67c8786262578330543a36/src/lib.zig",
190 };184 };
191 pub var _f7dubzb7cyqe = Package{185 pub var _f7dubzb7cyqe = Package{
192 .store = "/git/github.com/nektro/zig-extras/ff267312e8d714c9b9d8c44ad3291f6e509dc12f",186 .store = "/git/github.com/nektro/zig-extras/54abdc5bce0b243601ef4808bce1c29e1a46cdec",
193 .name = "extras",187 .name = "extras",
194 .entry = "/git/github.com/nektro/zig-extras/ff267312e8d714c9b9d8c44ad3291f6e509dc12f/src/lib.zig",188 .entry = "/git/github.com/nektro/zig-extras/54abdc5bce0b243601ef4808bce1c29e1a46cdec/src/lib.zig",
195 };189 };
196 pub var _0npcrzfdlrvk = Package{190 pub var _0npcrzfdlrvk = Package{
197 .store = "/git/github.com/nektro/zig-licenses/c9b8cbf3565675a056ad4e9b57cb4f84020e7680",191 .store = "/git/github.com/nektro/zig-licenses/c9b8cbf3565675a056ad4e9b57cb4f84020e7680",
...@@ -227,9 +221,9 @@ pub const package_data = struct {...@@ -227,9 +221,9 @@ pub const package_data = struct {
227 .deps = &[_]*Package{ &_pt88y5d80m25, &_96h80ezrvj7i },221 .deps = &[_]*Package{ &_pt88y5d80m25, &_96h80ezrvj7i },
228 };222 };
229 pub var _iecwp4b3bsfm = Package{223 pub var _iecwp4b3bsfm = Package{
230 .store = "/git/github.com/nektro/zig-time/ca9c0e6b644d74c1d549cc2c1ee22113aa021bd8",224 .store = "/git/github.com/nektro/zig-time/12fad367a5282827aad7e12f0e9cd36f672c4010",
231 .name = "time",225 .name = "time",
232 .entry = "/git/github.com/nektro/zig-time/ca9c0e6b644d74c1d549cc2c1ee22113aa021bd8/time.zig",226 .entry = "/git/github.com/nektro/zig-time/12fad367a5282827aad7e12f0e9cd36f672c4010/time.zig",
233 .deps = &[_]*Package{ &_f7dubzb7cyqe },227 .deps = &[_]*Package{ &_f7dubzb7cyqe },
234 };228 };
235 pub var _g982zq6e8wsv = Package{229 pub var _g982zq6e8wsv = Package{
...@@ -239,20 +233,20 @@ pub const package_data = struct {...@@ -239,20 +233,20 @@ pub const package_data = struct {
239 .deps = &[_]*Package{ &_f7dubzb7cyqe },233 .deps = &[_]*Package{ &_f7dubzb7cyqe },
240 };234 };
241 pub var _9k24gimke1an = Package{235 pub var _9k24gimke1an = Package{
242 .store = "/git/github.com/truemedian/hzzp/501386e13b2f7849128f3b271d23de6127b1d9d7",236 .store = "/git/github.com/truemedian/hzzp/305aca97fce78eb3e787d57691a5eed5512bece7",
243 .name = "hzzp",237 .name = "hzzp",
244 .entry = "/git/github.com/truemedian/hzzp/501386e13b2f7849128f3b271d23de6127b1d9d7/src/main.zig",238 .entry = "/git/github.com/truemedian/hzzp/305aca97fce78eb3e787d57691a5eed5512bece7/src/main.zig",
245 };239 };
246 pub var _ejw82j2ipa0e = Package{240 pub var _ejw82j2ipa0e = Package{
247 .store = "/git/github.com/truemedian/zfetch/829973144f680cd16be16923041fa810c1dee417",241 .store = "/git/github.com/nektro/zfetch/f51277414a2309f776fb79f3d55f26e37f9a54da",
248 .name = "zfetch",242 .name = "zfetch",
249 .entry = "/git/github.com/truemedian/zfetch/829973144f680cd16be16923041fa810c1dee417/src/main.zig",243 .entry = "/git/github.com/nektro/zfetch/f51277414a2309f776fb79f3d55f26e37f9a54da/src/main.zig",
250 .deps = &[_]*Package{ &_9k24gimke1an, &_csbnipaad8n7, &_u9w9dpp6p804 },244 .deps = &[_]*Package{ &_9k24gimke1an, &_csbnipaad8n7 },
251 };245 };
252 pub var _2ta738wrqbaq = Package{246 pub var _2ta738wrqbaq = Package{
253 .store = "/git/github.com/ziglibs/known-folders/d13ba6137084e55f873f6afb67447fe8906cc951",247 .store = "/git/github.com/ziglibs/known-folders/fa75e1bc672952efa0cf06160bbd942b47f6d59b",
254 .name = "known-folders",248 .name = "known-folders",
255 .entry = "/git/github.com/ziglibs/known-folders/d13ba6137084e55f873f6afb67447fe8906cc951/known-folders.zig",249 .entry = "/git/github.com/ziglibs/known-folders/fa75e1bc672952efa0cf06160bbd942b47f6d59b/known-folders.zig",
256 };250 };
257 pub var _89ujp8gq842x = Package{251 pub var _89ujp8gq842x = Package{
258 .name = "zigmod",252 .name = "zigmod",
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.3620+c76ce25a6`.13The earliest Zig release this Zigmod was verified to work with is `0.11.0`.
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.
licenses.txt+1-2
...@@ -1,10 +1,10 @@...@@ -1,10 +1,10 @@
1MIT:1MIT:
2= https://spdx.org/licenses/MIT2= https://spdx.org/licenses/MIT
3- This3- This
4- git https://github.com/MasterQ32/zig-uri
5- git https://github.com/marlersoft/zigwin324- git https://github.com/marlersoft/zigwin32
6- git https://github.com/nektro/arqv-ini5- git https://github.com/nektro/arqv-ini
7- git https://github.com/nektro/iguanaTLS6- git https://github.com/nektro/iguanaTLS
7- git https://github.com/nektro/zfetch
8- git https://github.com/nektro/zig-ansi8- git https://github.com/nektro/zig-ansi
9- git https://github.com/nektro/zig-detect-license9- git https://github.com/nektro/zig-detect-license
10- git https://github.com/nektro/zig-extras10- git https://github.com/nektro/zig-extras
...@@ -16,6 +16,5 @@ MIT:...@@ -16,6 +16,5 @@ MIT:
16- git https://github.com/nektro/zig-time16- git https://github.com/nektro/zig-time
17- git https://github.com/nektro/zig-yaml17- git https://github.com/nektro/zig-yaml
18- git https://github.com/truemedian/hzzp18- git https://github.com/truemedian/hzzp
19- git https://github.com/truemedian/zfetch
20- git https://github.com/ziglibs/known-folders19- git https://github.com/ziglibs/known-folders
21- git https://github.com/yaml/libyaml20- git https://github.com/yaml/libyaml
src/cmd/aq.zig+2-2
...@@ -43,7 +43,7 @@ pub fn execute(args: [][]u8) !void {...@@ -43,7 +43,7 @@ pub fn execute(args: [][]u8) !void {
43 u.fail("unknown command \"{s}\" for \"zigmod aq\"", .{args[0]});43 u.fail("unknown command \"{s}\" for \"zigmod aq\"", .{args[0]});
44}44}
4545
46pub fn server_fetch(url: string) !std.json.ValueTree {46pub fn server_fetch(url: string) !std.json.Parsed(std.json.Value) {
47 const req = try zfetch.Request.init(gpa, url, null);47 const req = try zfetch.Request.init(gpa, url, null);
48 defer req.deinit();48 defer req.deinit();
4949
...@@ -57,7 +57,7 @@ pub fn server_fetch(url: string) !std.json.ValueTree {...@@ -57,7 +57,7 @@ pub fn server_fetch(url: string) !std.json.ValueTree {
57 const body_content = try r.readAllAlloc(gpa, std.math.maxInt(usize));57 const body_content = try r.readAllAlloc(gpa, std.math.maxInt(usize));
58 const val = try extras.parse_json(gpa, body_content);58 const val = try extras.parse_json(gpa, body_content);
5959
60 if (val.root.object.get("message")) |msg| {60 if (val.value.object.get("message")) |msg| {
61 std.log.err("server: {s}", .{msg.string});61 std.log.err("server: {s}", .{msg.string});
62 return error.AquilaBadResponse;62 return error.AquilaBadResponse;
63 }63 }
src/cmd/aquila/add.zig+2-2
...@@ -19,8 +19,8 @@ pub fn do(dir: std.fs.Dir, pkg_id: string) !string {...@@ -19,8 +19,8 @@ pub fn do(dir: std.fs.Dir, pkg_id: string) !string {
19 const val = try aq.server_fetch(url);19 const val = try aq.server_fetch(url);
2020
21 const pkg_url = try std.fmt.allocPrint(gpa, "https://{s}/{s}", .{21 const pkg_url = try std.fmt.allocPrint(gpa, "https://{s}/{s}", .{
22 val.root.object.get("repo").?.object.get("domain").?.string,22 val.value.object.get("repo").?.object.get("domain").?.string,
23 val.root.object.get("package").?.object.get("remote_name").?.string,23 val.value.object.get("package").?.object.get("remote_name").?.string,
24 });24 });
2525
26 const m = try zigmod.ModFile.from_dir(gpa, dir);26 const m = try zigmod.ModFile.from_dir(gpa, dir);
src/cmd/fetch.zig+2-2
...@@ -77,11 +77,11 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -77,11 +77,11 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
77 \\ llc = true;77 \\ llc = true;
78 \\ }78 \\ }
79 \\ for (pkg.c_include_dirs) |item| {79 \\ for (pkg.c_include_dirs) |item| {
80 \\ exe.addIncludePath(b.fmt("{s}/{s}", .{ @field(dirs, decl.name), item }));80 \\ exe.addIncludePath(.{.path = b.fmt("{s}/{s}", .{ @field(dirs, decl.name), item })});
81 \\ llc = true;81 \\ llc = true;
82 \\ }82 \\ }
83 \\ for (pkg.c_source_files) |item| {83 \\ for (pkg.c_source_files) |item| {
84 \\ exe.addCSourceFile(b.fmt("{s}/{s}", .{ @field(dirs, decl.name), item }), pkg.c_source_flags);84 \\ exe.addCSourceFile(.{ .file = .{ .path = b.fmt("{s}/{s}", .{ @field(dirs, decl.name), item }) }, .flags = pkg.c_source_flags });
85 \\ llc = true;85 \\ llc = true;
86 \\ }86 \\ }
87 \\ vcpkg = vcpkg or pkg.vcpkg;87 \\ vcpkg = vcpkg or pkg.vcpkg;
src/cmd/generate.zig+2-2
...@@ -147,11 +147,11 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -147,11 +147,11 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
147 \\ llc = true;147 \\ llc = true;
148 \\ }148 \\ }
149 \\ for (pkg.c_include_dirs) |item| {149 \\ for (pkg.c_include_dirs) |item| {
150 \\ exe.addIncludePath(b.fmt("{s}/{s}", .{ root, item }));150 \\ exe.addIncludePath(.{.path = b.fmt("{s}/{s}", .{ root, item })});
151 \\ llc = true;151 \\ llc = true;
152 \\ }152 \\ }
153 \\ for (pkg.c_source_files) |item| {153 \\ for (pkg.c_source_files) |item| {
154 \\ exe.addCSourceFile(b.fmt("{s}/{s}", .{ root, item }), pkg.c_source_flags);154 \\ exe.addCSourceFile(.{ .file = .{ .path = b.fmt("{s}/{s}", .{ root, item }) }, .flags = pkg.c_source_flags });
155 \\ llc = true;155 \\ llc = true;
156 \\ }156 \\ }
157 \\ vcpkg = vcpkg or pkg.vcpkg;157 \\ vcpkg = vcpkg or pkg.vcpkg;
src/cmd/init.zig+1-1
...@@ -118,7 +118,7 @@ pub fn execute(args: [][]u8) !void {...@@ -118,7 +118,7 @@ pub fn execute(args: [][]u8) !void {
118 if (run >= 79) {118 if (run >= 79) {
119 const s_ind = (std.mem.lastIndexOfScalar(u8, realtext[start..end], ' ') orelse end) + start;119 const s_ind = (std.mem.lastIndexOfScalar(u8, realtext[start..end], ' ') orelse end) + start;
120 const n_ind = (std.mem.lastIndexOfScalar(u8, realtext[start .. end - 1], '\n') orelse end) + start;120 const n_ind = (std.mem.lastIndexOfScalar(u8, realtext[start .. end - 1], '\n') orelse end) + start;
121 const ind = std.math.min(s_ind, n_ind);121 const ind = @min(s_ind, n_ind);
122 try w.print("{s}\n", .{realtext[start..ind]});122 try w.print("{s}\n", .{realtext[start..ind]});
123 end = ind + 1;123 end = ind + 1;
124 start = end;124 start = end;
src/cmd/zpm.zig+3-3
...@@ -55,7 +55,7 @@ pub fn execute(args: [][]u8) !void {...@@ -55,7 +55,7 @@ pub fn execute(args: [][]u8) !void {
55 u.fail("unknown command \"{s}\" for \"zigmod zpm\"", .{args[0]});55 u.fail("unknown command \"{s}\" for \"zigmod zpm\"", .{args[0]});
56}56}
5757
58pub fn server_fetch(url: string) !std.json.ValueTree {58pub fn server_fetch(url: string) !std.json.Parsed(std.json.Value) {
59 const req = try zfetch.Request.init(gpa, url, null);59 const req = try zfetch.Request.init(gpa, url, null);
60 defer req.deinit();60 defer req.deinit();
61 try req.do(.GET, null, null);61 try req.do(.GET, null, null);
...@@ -69,7 +69,7 @@ pub fn server_fetchArray(url: string) ![]const Package {...@@ -69,7 +69,7 @@ pub fn server_fetchArray(url: string) ![]const Package {
69 var list = std.ArrayList(Package).init(gpa);69 var list = std.ArrayList(Package).init(gpa);
70 errdefer list.deinit();70 errdefer list.deinit();
7171
72 for (val.root.array.items) |item| {72 for (val.value.array.items) |item| {
73 if (get(item, "root_file") == null) continue;73 if (get(item, "root_file") == null) continue;
74 try list.append(Package{74 try list.append(Package{
75 .name = item.object.get("name").?.string,75 .name = item.object.get("name").?.string,
...@@ -78,7 +78,7 @@ pub fn server_fetchArray(url: string) ![]const Package {...@@ -78,7 +78,7 @@ pub fn server_fetchArray(url: string) ![]const Package {
78 .tags = try valueStrArray(item.object.get("tags").?.array.items),78 .tags = try valueStrArray(item.object.get("tags").?.array.items),
79 .git = item.object.get("git").?.string,79 .git = item.object.get("git").?.string,
80 .root_file = item.object.get("root_file").?.string,80 .root_file = item.object.get("root_file").?.string,
81 .source = @intCast(u32, item.object.get("source").?.integer),81 .source = @intCast(item.object.get("source").?.integer),
82 .links = try valueLinks(item.object.get("links").?),82 .links = try valueLinks(item.object.get("links").?),
83 });83 });
84 }84 }
src/cmd/zpm/add.zig+2-2
...@@ -44,14 +44,14 @@ pub fn execute(args: [][]u8) !void {...@@ -44,14 +44,14 @@ pub fn execute(args: [][]u8) !void {
44 const _req = try zfetch.Request.init(gpa, _url, null);44 const _req = try zfetch.Request.init(gpa, _url, null);
45 defer _req.deinit();45 defer _req.deinit();
46 try _req.do(.GET, null, null);46 try _req.do(.GET, null, null);
47 break :blk _req.status.code == 200;47 break :blk @intFromEnum(_req.status) == 200;
48 };48 };
49 const has_zigmodyml = blk: {49 const has_zigmodyml = blk: {
50 const _url = try std.mem.join(gpa, "/", &.{ found.git, "blob", "HEAD", "zigmod.yml" });50 const _url = try std.mem.join(gpa, "/", &.{ found.git, "blob", "HEAD", "zigmod.yml" });
51 const _req = try zfetch.Request.init(gpa, _url, null);51 const _req = try zfetch.Request.init(gpa, _url, null);
52 defer _req.deinit();52 defer _req.deinit();
53 try _req.do(.GET, null, null);53 try _req.do(.GET, null, null);
54 break :blk _req.status.code == 200;54 break :blk @intFromEnum(_req.status) == 200;
55 };55 };
5656
57 const file = try zigmod.ModFile.openFile(std.fs.cwd(), .{ .mode = .read_write });57 const file = try zigmod.ModFile.openFile(std.fs.cwd(), .{ .mode = .read_write });
src/cmd/zpm/tags.zig+2-2
...@@ -17,7 +17,7 @@ pub fn execute(args: [][]u8) !void {...@@ -17,7 +17,7 @@ pub fn execute(args: [][]u8) !void {
1717
18 const name_col_width = blk: {18 const name_col_width = blk: {
19 var w: usize = 4;19 var w: usize = 4;
20 for (val.root.array.items) |tag| {20 for (val.value.array.items) |tag| {
21 const len = tag.object.get("name").?.string.len;21 const len = tag.object.get("name").?.string.len;
22 if (len > w) {22 if (len > w) {
23 w = len;23 w = len;
...@@ -30,7 +30,7 @@ pub fn execute(args: [][]u8) !void {...@@ -30,7 +30,7 @@ pub fn execute(args: [][]u8) !void {
30 try print_c_n(out, ' ', name_col_width - 4);30 try print_c_n(out, ' ', name_col_width - 4);
31 try out.writeAll("DESCRIPTION\n");31 try out.writeAll("DESCRIPTION\n");
3232
33 for (val.root.array.items) |tag| {33 for (val.value.array.items) |tag| {
34 const name = tag.object.get("name").?.string;34 const name = tag.object.get("name").?.string;
35 try out.writeAll(name);35 try out.writeAll(name);
36 try print_c_n(out, ' ', name_col_width - name.len);36 try print_c_n(out, ' ', name_col_width - name.len);
src/util/funcs.zig+3-3
...@@ -118,7 +118,7 @@ pub fn last(in: []string) !string {...@@ -118,7 +118,7 @@ pub fn last(in: []string) !string {
118const alphabet = "0123456789abcdefghijklmnopqrstuvwxyz";118const alphabet = "0123456789abcdefghijklmnopqrstuvwxyz";
119119
120pub fn random_string(alloc: std.mem.Allocator, len: usize) !string {120pub fn random_string(alloc: std.mem.Allocator, len: usize) !string {
121 const now = @intCast(u64, std.time.nanoTimestamp());121 const now: u64 = @intCast(std.time.nanoTimestamp());
122 var rand = std.rand.DefaultPrng.init(now);122 var rand = std.rand.DefaultPrng.init(now);
123 var r = rand.random();123 var r = rand.random();
124 var buf = try alloc.alloc(u8, len);124 var buf = try alloc.alloc(u8, len);
...@@ -191,8 +191,8 @@ pub fn git_rev_HEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !string {...@@ -191,8 +191,8 @@ pub fn git_rev_HEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !string {
191}191}
192192
193pub fn slice(comptime T: type, input: []const T, from: usize, to: usize) []const T {193pub fn slice(comptime T: type, input: []const T, from: usize, to: usize) []const T {
194 const f = std.math.max(from, 0);194 const f = @max(from, 0);
195 const t = std.math.min(to, input.len);195 const t = @min(to, input.len);
196 return input[f..t];196 return input[f..t];
197}197}
198198
zig.mod+2-2
...@@ -3,13 +3,13 @@ name: zigmod...@@ -3,13 +3,13 @@ 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.3620+c76ce25a66min_zig_version: 0.11.0
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
10 - src: git https://github.com/ziglibs/known-folders10 - src: git https://github.com/ziglibs/known-folders
11 - src: git https://github.com/nektro/zig-licenses11 - src: git https://github.com/nektro/zig-licenses
12 - src: git https://github.com/truemedian/zfetch12 - src: git https://github.com/nektro/zfetch
13 - src: git https://github.com/nektro/zig-detect-license13 - src: git https://github.com/nektro/zig-detect-license
14 - src: git https://github.com/nektro/zig-inquirer14 - src: git https://github.com/nektro/zig-inquirer
15 - src: git https://github.com/nektro/arqv-ini15 - src: git https://github.com/nektro/arqv-ini
zigmod.lock+9-10
...@@ -1,19 +1,18 @@...@@ -1,19 +1,18 @@
1212
2git https://github.com/MasterQ32/zig-uri commit-d4299ad6043ad19f2ce0676687b0bff57273eae22git https://github.com/marlersoft/zigwin32 commit-007649ade45ffb544de3aafbb112de25064d3d92
3git https://github.com/marlersoft/zigwin32 commit-b70e7f818d77a0c0f39b0bd9c549e16439ff57803git https://github.com/nektro/arqv-ini commit-ddbe89bb0d9085e939bcbc713caeb2b7cf852bae
4git https://github.com/nektro/arqv-ini commit-ee395fd34e152d9067def609d86b7af5382b83b14git https://github.com/nektro/iguanaTLS commit-c932f557865abaa1d06cd88e9b22a9f3e583fa59
5git https://github.com/nektro/iguanaTLS commit-e70995575b397f33d798339d4f1656bcdf0ab82f5git https://github.com/nektro/zfetch commit-f51277414a2309f776fb79f3d55f26e37f9a54da
6git https://github.com/nektro/zig-ansi commit-faf9585bfe5980c24748ee8a3e6a22faaa50b4376git https://github.com/nektro/zig-ansi commit-ac607e4e7ac36d46cc67c8786262578330543a36
7git https://github.com/nektro/zig-detect-license commit-8f13721bd18c0e546841b6f2e11da839550d62877git https://github.com/nektro/zig-detect-license commit-8f13721bd18c0e546841b6f2e11da839550d6287
8git https://github.com/nektro/zig-extras commit-ff267312e8d714c9b9d8c44ad3291f6e509dc12f8git https://github.com/nektro/zig-extras commit-54abdc5bce0b243601ef4808bce1c29e1a46cdec
9git https://github.com/nektro/zig-inquirer commit-5cc2a5565d04fe2c0085f0d6818590e800d9dcf79git https://github.com/nektro/zig-inquirer commit-5cc2a5565d04fe2c0085f0d6818590e800d9dcf7
10git https://github.com/nektro/zig-leven commit-550cabd5a18ace5e67761bc5b867c10e926f431410git https://github.com/nektro/zig-leven commit-550cabd5a18ace5e67761bc5b867c10e926f4314
11git https://github.com/nektro/zig-licenses commit-c9b8cbf3565675a056ad4e9b57cb4f84020e768011git https://github.com/nektro/zig-licenses commit-c9b8cbf3565675a056ad4e9b57cb4f84020e7680
12git https://github.com/nektro/zig-licenses-text commit-3c07c6e4eb0965dafd0b029c632f823631b3169c12git https://github.com/nektro/zig-licenses-text commit-3c07c6e4eb0965dafd0b029c632f823631b3169c
13git https://github.com/nektro/zig-range commit-4b2f12808aa09be4b27a163efc424dd4e041599213git https://github.com/nektro/zig-range commit-4b2f12808aa09be4b27a163efc424dd4e0415992
14git https://github.com/nektro/zig-time commit-ca9c0e6b644d74c1d549cc2c1ee22113aa021bd814git https://github.com/nektro/zig-time commit-12fad367a5282827aad7e12f0e9cd36f672c4010
15git https://github.com/nektro/zig-yaml commit-e56b9fed6c0afd1c4d29bedc08c3899ffe1165e915git https://github.com/nektro/zig-yaml commit-e56b9fed6c0afd1c4d29bedc08c3899ffe1165e9
16git https://github.com/truemedian/hzzp commit-501386e13b2f7849128f3b271d23de6127b1d9d716git https://github.com/truemedian/hzzp commit-305aca97fce78eb3e787d57691a5eed5512bece7
17git https://github.com/truemedian/zfetch commit-829973144f680cd16be16923041fa810c1dee41717git https://github.com/ziglibs/known-folders commit-fa75e1bc672952efa0cf06160bbd942b47f6d59b
18git https://github.com/ziglibs/known-folders commit-d13ba6137084e55f873f6afb67447fe8906cc951
19git https://github.com/yaml/libyaml tag-0.2.518git https://github.com/yaml/libyaml tag-0.2.5