authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-07-04 01:08:32 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-07-04 01:08:32 -07:00
loga6a764265792dafc3bc09c84aedcebdb9df28997
tree270c3c15bb145806ac7d496fd9482c4cfae2f7e1
parent73b469c6961e50b57cea61814d39237efe25318c

updated to zig master version `0.9.0-dev.370`


13 files changed, 52 insertions(+), 29 deletions(-)

.circleci/config.yml+1-1
...@@ -15,7 +15,7 @@ jobs:...@@ -15,7 +15,7 @@ jobs:
15 - run: git submodule update --init --recursive15 - run: git submodule update --init --recursive
1616
17 - run: apt -y install xz-utils jq17 - run: apt -y install xz-utils jq
18 - run: ./download_zig.sh 0.9.0-dev.197+1f29b75f018 - run: ./download_zig.sh 0.9.0-dev.370+8a863381d
19 - run: zig version19 - run: zig version
20 - run: zig env20 - run: zig env
21 - run: zig build -Dbootstrap21 - run: zig build -Dbootstrap
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 `0.9.0-dev.197+1f29b75f0`20- Zig master `0.9.0-dev.370+8a863381d`
2121
22### Build from Source22### Build from Source
23Initially,23Initially,
docs/README.md+1-1
...@@ -8,7 +8,7 @@ You can learn more about Zig here:...@@ -8,7 +8,7 @@ You can learn more about Zig here:
88
9The rest of this documentation will assume you already have Zig installed.9The 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. The most recent release Zigmod was verified to work with is `0.9.0-dev.197+1f29b75f0`.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. The most recent release Zigmod was verified to work with is `0.9.0-dev.370+8a863381d`.
1212
13## Download13## Download
14You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source.14You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source.
src/cmd/aquila/update.zig+2-1
...@@ -8,7 +8,8 @@ const aq = @import("./../aq.zig");...@@ -8,7 +8,8 @@ const aq = @import("./../aq.zig");
8//8//
99
10pub fn execute(args: [][]u8) !void {10pub fn execute(args: [][]u8) !void {
11 //11 _ = args;
12
12 const mod = try u.ModFile.init(gpa, "zig.mod");13 const mod = try u.ModFile.init(gpa, "zig.mod");
1314
14 for (mod.deps) |d| {15 for (mod.deps) |d| {
src/cmd/fetch.zig+7-3
...@@ -136,6 +136,8 @@ fn print_paths(w: std.fs.File.Writer, list: []u.Module) !void {...@@ -136,6 +136,8 @@ fn print_paths(w: std.fs.File.Writer, list: []u.Module) !void {
136}136}
137137
138fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, array: bool) !void {138fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, array: bool) !void {
139 _ = dir;
140
139 if (m.has_no_zig_deps() and tabs > 0) {141 if (m.has_no_zig_deps() and tabs > 0) {
140 try w.print("null", .{});142 try w.print("null", .{});
141 return;143 return;
...@@ -152,8 +154,8 @@ fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, ar...@@ -152,8 +154,8 @@ fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, ar
152 continue;154 continue;
153 }155 }
154 if (!array) {156 if (!array) {
155 const r1 = std.mem.replaceOwned(u8, gpa, d.name, "-", "_");157 const r1 = try std.mem.replaceOwned(u8, gpa, d.name, "-", "_");
156 const r2 = std.mem.replaceOwned(u8, gpa, d.name, "/", "_");158 const r2 = try std.mem.replaceOwned(u8, gpa, r1, "/", "_");
157 try w.print(" pub const {s} = packages[{}];\n", .{ r2, i });159 try w.print(" pub const {s} = packages[{}];\n", .{ r2, i });
158 } else {160 } else {
159 try w.print(" package_data._{s},\n", .{d.id[0..12]});161 try w.print(" package_data._{s},\n", .{d.id[0..12]});
...@@ -193,7 +195,7 @@ fn print_csrc_dirs_to(w: std.fs.File.Writer, list: []u.Module) !void {...@@ -193,7 +195,7 @@ fn print_csrc_dirs_to(w: std.fs.File.Writer, list: []u.Module) !void {
193}195}
194196
195fn print_csrc_flags_to(w: std.fs.File.Writer, list: []u.Module) !void {197fn print_csrc_flags_to(w: std.fs.File.Writer, list: []u.Module) !void {
196 for (list) |mod, i| {198 for (list) |mod| {
197 if (mod.is_sys_lib) {199 if (mod.is_sys_lib) {
198 continue;200 continue;
199 }201 }
...@@ -209,6 +211,8 @@ fn print_csrc_flags_to(w: std.fs.File.Writer, list: []u.Module) !void {...@@ -209,6 +211,8 @@ fn print_csrc_flags_to(w: std.fs.File.Writer, list: []u.Module) !void {
209}211}
210212
211fn print_sys_libs_to(w: std.fs.File.Writer, list: []u.Module, list2: *std.ArrayList([]const u8)) !void {213fn print_sys_libs_to(w: std.fs.File.Writer, list: []u.Module, list2: *std.ArrayList([]const u8)) !void {
214 _ = list2;
215
212 for (list) |mod| {216 for (list) |mod| {
213 if (!mod.is_sys_lib) {217 if (!mod.is_sys_lib) {
214 continue;218 continue;
src/cmd/license.zig+2-1
...@@ -15,7 +15,8 @@ const Map = std.StringArrayHashMap(*List);...@@ -15,7 +15,8 @@ const Map = std.StringArrayHashMap(*List);
15// https://github.com/onur/cargo-license15// https://github.com/onur/cargo-license
1616
17pub fn execute(args: [][]u8) !void {17pub fn execute(args: [][]u8) !void {
18 //18 _ = args;
19
19 const dir = try std.fs.path.join(gpa, &.{ ".zigmod", "deps" });20 const dir = try std.fs.path.join(gpa, &.{ ".zigmod", "deps" });
2021
21 const top_module = try common.collect_deps_deep(dir, "zig.mod", .{22 const top_module = try common.collect_deps_deep(dir, "zig.mod", .{
src/cmd/sum.zig+2-1
...@@ -10,7 +10,8 @@ const common = @import("./../common.zig");...@@ -10,7 +10,8 @@ const common = @import("./../common.zig");
10//10//
1111
12pub fn execute(args: [][]u8) !void {12pub fn execute(args: [][]u8) !void {
13 //13 _ = args;
14
14 const dir = try std.fs.path.join(gpa, &.{ ".zigmod", "deps" });15 const dir = try std.fs.path.join(gpa, &.{ ".zigmod", "deps" });
1516
16 const top_module = try common.collect_deps_deep(dir, "zig.mod", .{17 const top_module = try common.collect_deps_deep(dir, "zig.mod", .{
src/cmd/zpm/search.zig+2
...@@ -12,6 +12,8 @@ const zpm = @import("./../zpm.zig");...@@ -12,6 +12,8 @@ const zpm = @import("./../zpm.zig");
12//12//
1313
14pub fn execute(args: [][]u8) !void {14pub fn execute(args: [][]u8) !void {
15 _ = args;
16
15 const out = std.io.getStdOut().writer();17 const out = std.io.getStdOut().writer();
1618
17 const url = try std.mem.join(gpa, "/", &.{ zpm.server_root, "packages" });19 const url = try std.mem.join(gpa, "/", &.{ zpm.server_root, "packages" });
src/cmd/zpm/tags.zig+2
...@@ -12,6 +12,8 @@ const zpm = @import("./../zpm.zig");...@@ -12,6 +12,8 @@ const zpm = @import("./../zpm.zig");
12//12//
1313
14pub fn execute(args: [][]u8) !void {14pub fn execute(args: [][]u8) !void {
15 _ = args;
16
15 const out = std.io.getStdOut().writer();17 const out = std.io.getStdOut().writer();
1618
17 const url = try std.mem.join(gpa, "/", &.{ zpm.server_root, "tags" });19 const url = try std.mem.join(gpa, "/", &.{ zpm.server_root, "tags" });
src/util/dep_type.zig+2
...@@ -56,6 +56,8 @@ pub const DepType = enum {...@@ -56,6 +56,8 @@ pub const DepType = enum {
56 }56 }
5757
58 pub fn update(self: DepType, dpath: []const u8, rpath: []const u8) !void {58 pub fn update(self: DepType, dpath: []const u8, rpath: []const u8) !void {
59 _ = rpath;
60
59 switch (self) {61 switch (self) {
60 .local => {},62 .local => {},
61 .system_lib => {},63 .system_lib => {},
src/util/module.zig+1
...@@ -66,6 +66,7 @@ pub const Module = struct {...@@ -66,6 +66,7 @@ pub const Module = struct {
6666
67 std.sort.sort([]const u8, file_list_2.items, void{}, struct {67 std.sort.sort([]const u8, file_list_2.items, void{}, struct {
68 pub fn lt(context: void, lhs: []const u8, rhs: []const u8) bool {68 pub fn lt(context: void, lhs: []const u8, rhs: []const u8) bool {
69 _ = context;
69 return std.mem.lessThan(u8, lhs, rhs);70 return std.mem.lessThan(u8, lhs, rhs);
70 }71 }
71 }.lt);72 }.lt);
src/util/yaml.zig+23-14
...@@ -29,6 +29,9 @@ pub const Item = union(enum) {...@@ -29,6 +29,9 @@ pub const Item = union(enum) {
29 stream: Stream,29 stream: Stream,
3030
31 pub fn format(self: Item, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {31 pub fn format(self: Item, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {
32 _ = fmt;
33 _ = options;
34
32 try writer.writeAll("Item{");35 try writer.writeAll("Item{");
33 switch (self) {36 switch (self) {
34 .event => {37 .event => {
...@@ -68,6 +71,9 @@ pub const Value = union(enum) {...@@ -68,6 +71,9 @@ pub const Value = union(enum) {
68 sequence: Sequence,71 sequence: Sequence,
6972
70 pub fn format(self: Value, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {73 pub fn format(self: Value, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {
74 _ = fmt;
75 _ = options;
76
71 try writer.writeAll("Value{");77 try writer.writeAll("Value{");
72 switch (self) {78 switch (self) {
73 .string => {79 .string => {
...@@ -109,7 +115,7 @@ pub const Mapping = struct {...@@ -109,7 +115,7 @@ pub const Mapping = struct {
109 defer list.deinit();115 defer list.deinit();
110 if (self.get(k)) |val| {116 if (self.get(k)) |val| {
111 if (val == .sequence) {117 if (val == .sequence) {
112 for (val.sequence) |item, i| {118 for (val.sequence) |item| {
113 if (item != .string) {119 if (item != .string) {
114 continue;120 continue;
115 }121 }
...@@ -121,6 +127,9 @@ pub const Mapping = struct {...@@ -121,6 +127,9 @@ pub const Mapping = struct {
121 }127 }
122128
123 pub fn format(self: Mapping, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {129 pub fn format(self: Mapping, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {
130 _ = fmt;
131 _ = options;
132
124 try writer.writeAll("{ ");133 try writer.writeAll("{ ");
125 for (self.items) |it| {134 for (self.items) |it| {
126 try std.fmt.format(writer, "{s}: ", .{it.key});135 try std.fmt.format(writer, "{s}: ", .{it.key});
...@@ -152,7 +161,7 @@ pub fn parse(alloc: *std.mem.Allocator, input: []const u8) !Document {...@@ -152,7 +161,7 @@ pub fn parse(alloc: *std.mem.Allocator, input: []const u8) !Document {
152 break;161 break;
153 }162 }
154163
155 const et = @enumToInt(event.type);164 const et = event.type;
156 try all_events.append(event);165 try all_events.append(event);
157 c.yaml_event_delete(&event);166 c.yaml_event_delete(&event);
158167
...@@ -200,11 +209,11 @@ pub const Error =...@@ -200,11 +209,11 @@ pub const Error =
200fn parse_item(p: *Parser, start: ?Token) Error!Item {209fn parse_item(p: *Parser, start: ?Token) Error!Item {
201 const tok = start orelse p.next();210 const tok = start orelse p.next();
202 return switch (tok.?.type) {211 return switch (tok.?.type) {
203 .YAML_STREAM_START_EVENT => Item{ .stream = try parse_stream(p) },212 c.YAML_STREAM_START_EVENT => Item{ .stream = try parse_stream(p) },
204 .YAML_DOCUMENT_START_EVENT => Item{ .document = try parse_document(p) },213 c.YAML_DOCUMENT_START_EVENT => Item{ .document = try parse_document(p) },
205 .YAML_MAPPING_START_EVENT => Item{ .mapping = try parse_mapping(p) },214 c.YAML_MAPPING_START_EVENT => Item{ .mapping = try parse_mapping(p) },
206 .YAML_SEQUENCE_START_EVENT => Item{ .sequence = try parse_sequence(p) },215 c.YAML_SEQUENCE_START_EVENT => Item{ .sequence = try parse_sequence(p) },
207 .YAML_SCALAR_EVENT => Item{ .string = get_event_string(tok.?, p.lines) },216 c.YAML_SCALAR_EVENT => Item{ .string = get_event_string(tok.?, p.lines) },
208 else => unreachable,217 else => unreachable,
209 };218 };
210}219}
...@@ -215,10 +224,10 @@ fn parse_stream(p: *Parser) Error!Stream {...@@ -215,10 +224,10 @@ fn parse_stream(p: *Parser) Error!Stream {
215224
216 while (true) {225 while (true) {
217 const tok = p.next();226 const tok = p.next();
218 if (tok.?.type == .YAML_STREAM_END_EVENT) {227 if (tok.?.type == c.YAML_STREAM_END_EVENT) {
219 return Stream{ .docs = res.toOwnedSlice() };228 return Stream{ .docs = res.toOwnedSlice() };
220 }229 }
221 if (tok.?.type != .YAML_DOCUMENT_START_EVENT) {230 if (tok.?.type != c.YAML_DOCUMENT_START_EVENT) {
222 return error.YamlUnexpectedToken;231 return error.YamlUnexpectedToken;
223 }232 }
224 const item = try parse_item(p, tok);233 const item = try parse_item(p, tok);
...@@ -228,12 +237,12 @@ fn parse_stream(p: *Parser) Error!Stream {...@@ -228,12 +237,12 @@ fn parse_stream(p: *Parser) Error!Stream {
228237
229fn parse_document(p: *Parser) Error!Document {238fn parse_document(p: *Parser) Error!Document {
230 const tok = p.next();239 const tok = p.next();
231 if (tok.?.type != .YAML_MAPPING_START_EVENT) {240 if (tok.?.type != c.YAML_MAPPING_START_EVENT) {
232 return error.YamlUnexpectedToken;241 return error.YamlUnexpectedToken;
233 }242 }
234 const item = try parse_item(p, tok);243 const item = try parse_item(p, tok);
235244
236 if (p.next().?.type != .YAML_DOCUMENT_END_EVENT) {245 if (p.next().?.type != c.YAML_DOCUMENT_END_EVENT) {
237 return error.YamlUnexpectedToken;246 return error.YamlUnexpectedToken;
238 }247 }
239 return Document{ .mapping = item.mapping };248 return Document{ .mapping = item.mapping };
...@@ -245,10 +254,10 @@ fn parse_mapping(p: *Parser) Error!Mapping {...@@ -245,10 +254,10 @@ fn parse_mapping(p: *Parser) Error!Mapping {
245254
246 while (true) {255 while (true) {
247 const tok = p.next();256 const tok = p.next();
248 if (tok.?.type == .YAML_MAPPING_END_EVENT) {257 if (tok.?.type == c.YAML_MAPPING_END_EVENT) {
249 return Mapping{ .items = res.toOwnedSlice() };258 return Mapping{ .items = res.toOwnedSlice() };
250 }259 }
251 if (tok.?.type != .YAML_SCALAR_EVENT) {260 if (tok.?.type != c.YAML_SCALAR_EVENT) {
252 return error.YamlUnexpectedToken;261 return error.YamlUnexpectedToken;
253 }262 }
254 try res.append(Key{263 try res.append(Key{
...@@ -274,7 +283,7 @@ fn parse_sequence(p: *Parser) Error!Sequence {...@@ -274,7 +283,7 @@ fn parse_sequence(p: *Parser) Error!Sequence {
274283
275 while (true) {284 while (true) {
276 const tok = p.next();285 const tok = p.next();
277 if (tok.?.type == .YAML_SEQUENCE_END_EVENT) {286 if (tok.?.type == c.YAML_SEQUENCE_END_EVENT) {
278 return res.toOwnedSlice();287 return res.toOwnedSlice();
279 }288 }
280 try res.append(try parse_item(p, tok));289 try res.append(try parse_item(p, tok));
zig.sum+6-6
...@@ -1,11 +1,11 @@...@@ -1,11 +1,11 @@
1blake3-22472b867734926b202c055892fb0abb03f91556cd88998e2fe77addb003b1dd v/git/github.com/yaml/libyaml/tag-0.2.51blake3-22472b867734926b202c055892fb0abb03f91556cd88998e2fe77addb003b1dd v/git/github.com/yaml/libyaml/tag-0.2.5
2blake3-7fc0b46397932ea1f0726d42289606ca118cc745d88dd87c0d6a377ba7c6569f git/github.com/nektro/zig-ansi2blake3-7fc0b46397932ea1f0726d42289606ca118cc745d88dd87c0d6a377ba7c6569f git/github.com/nektro/zig-ansi
3blake3-e7d7348c05ca69eab697c8a902126b6dcb49ac396ef22750b79a3e575fb74b0e git/github.com/ziglibs/known-folders3blake3-35a1c330c9999876e71418a7d43ad24ca7d1e23c3b5576e5cb75667e3392cc10 git/github.com/ziglibs/known-folders
4blake3-77ce43ca22debd0e34b3b6b8dfc251e4242916b5eaf06bdefababda192bdec82 git/github.com/nektro/zig-licenses4blake3-77ce43ca22debd0e34b3b6b8dfc251e4242916b5eaf06bdefababda192bdec82 git/github.com/nektro/zig-licenses
5blake3-3076108a21d2651a6ac953bea11fc3d686e0a4d3159b42993092fdf491deaa7c git/github.com/truemedian/zfetch5blake3-ec191c4930c6fbaf059fadccb1470500b77d01d48f3fa390793822e403d7a3dc git/github.com/truemedian/zfetch
6blake3-bcb05a67cf2fbc9ca71005a781edde20e4df60ee9c83dcc32d9eca2b3ef619a3 git/github.com/truemedian/hzzp6blake3-98982125d0fbedc62e179e62081d2797a2b8a3623c42f9fd5d72cd56d6350714 git/github.com/truemedian/hzzp
7blake3-2e12f3177129efb0b5a8d10d1742f1b0c4e8d3e38790496462b29a10c9adcd7d git/github.com/alexnask/iguanaTLS7blake3-e6901bd7432450d5b22b01880cc7fa3fa2433e766a527206f18b29c67c1349bb git/github.com/alexnask/iguanaTLS
8blake3-51e4c8eed508968526ec7a4247f0ad40635c49228ba305e17607f6090ce1cb2a git/github.com/MasterQ32/zig-network8blake3-21f91e48333ac0ca7f4704c96352831c25216e7056d02ce24de95d03fc942246 git/github.com/MasterQ32/zig-network
9blake3-754b1b7e57b716ca042a9fc5c262e4931a804bddd52df695ec2b5476d0df0005 git/github.com/MasterQ32/zig-uri9blake3-754b1b7e57b716ca042a9fc5c262e4931a804bddd52df695ec2b5476d0df0005 git/github.com/MasterQ32/zig-uri
10blake3-155960bc30c27ccee4f6f10cfb0398d1bcec367abaabb16f18de6176bd92112c git/github.com/nektro/zig-json10blake3-d2a61dbaa3505a69473a9c63e34c9abd6ba8d93055796ad4b1e5f5eb9982c815 git/github.com/nektro/zig-json
11blake3-09698753782139ab4877d08f33235170836f68b73e482b65cdee5637a6addf86 v/http/aquila.red/1/nektro/range/v0.1.tar.gz/d2f72fdd11blake3-09698753782139ab4877d08f33235170836f68b73e482b65cdee5637a6addf86 v/http/aquila.red/1/nektro/range/v0.1.tar.gz/d2f72fdd