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:
1515 - run: git submodule update --init --recursive
1616
1717 - run: apt -y install xz-utils jq
18 - run: ./download_zig.sh 0.9.0-dev.197+1f29b75f0
18 - run: ./download_zig.sh 0.9.0-dev.370+8a863381d
1919 - run: zig version
2020 - run: zig env
2121 - run: zig build -Dbootstrap
README.md+1-1
......@@ -17,7 +17,7 @@ A package manager for the Zig programming language.
1717- https://github.com/nektro/zigmod/releases
1818
1919## Built With
20- Zig master `0.9.0-dev.197+1f29b75f0`
20- Zig master `0.9.0-dev.370+8a863381d`
2121
2222### Build from Source
2323Initially,
docs/README.md+1-1
......@@ -8,7 +8,7 @@ You can learn more about Zig here:
88
99The 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
1313## Download
1414You 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");
88//
99
1010pub fn execute(args: [][]u8) !void {
11 //
11 _ = args;
12
1213 const mod = try u.ModFile.init(gpa, "zig.mod");
1314
1415 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 {
136136}
137137
138138fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, array: bool) !void {
139 _ = dir;
140
139141 if (m.has_no_zig_deps() and tabs > 0) {
140142 try w.print("null", .{});
141143 return;
......@@ -152,8 +154,8 @@ fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, ar
152154 continue;
153155 }
154156 if (!array) {
155 const r1 = std.mem.replaceOwned(u8, gpa, d.name, "-", "_");
156 const r2 = std.mem.replaceOwned(u8, gpa, d.name, "/", "_");
157 const r1 = try std.mem.replaceOwned(u8, gpa, d.name, "-", "_");
158 const r2 = try std.mem.replaceOwned(u8, gpa, r1, "/", "_");
157159 try w.print(" pub const {s} = packages[{}];\n", .{ r2, i });
158160 } else {
159161 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 {
193195}
194196
195197fn print_csrc_flags_to(w: std.fs.File.Writer, list: []u.Module) !void {
196 for (list) |mod, i| {
198 for (list) |mod| {
197199 if (mod.is_sys_lib) {
198200 continue;
199201 }
......@@ -209,6 +211,8 @@ fn print_csrc_flags_to(w: std.fs.File.Writer, list: []u.Module) !void {
209211}
210212
211213fn print_sys_libs_to(w: std.fs.File.Writer, list: []u.Module, list2: *std.ArrayList([]const u8)) !void {
214 _ = list2;
215
212216 for (list) |mod| {
213217 if (!mod.is_sys_lib) {
214218 continue;
src/cmd/license.zig+2-1
......@@ -15,7 +15,8 @@ const Map = std.StringArrayHashMap(*List);
1515// https://github.com/onur/cargo-license
1616
1717pub fn execute(args: [][]u8) !void {
18 //
18 _ = args;
19
1920 const dir = try std.fs.path.join(gpa, &.{ ".zigmod", "deps" });
2021
2122 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");
1010//
1111
1212pub fn execute(args: [][]u8) !void {
13 //
13 _ = args;
14
1415 const dir = try std.fs.path.join(gpa, &.{ ".zigmod", "deps" });
1516
1617 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");
1212//
1313
1414pub fn execute(args: [][]u8) !void {
15 _ = args;
16
1517 const out = std.io.getStdOut().writer();
1618
1719 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");
1212//
1313
1414pub fn execute(args: [][]u8) !void {
15 _ = args;
16
1517 const out = std.io.getStdOut().writer();
1618
1719 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 {
5656 }
5757
5858 pub fn update(self: DepType, dpath: []const u8, rpath: []const u8) !void {
59 _ = rpath;
60
5961 switch (self) {
6062 .local => {},
6163 .system_lib => {},
src/util/module.zig+1
......@@ -66,6 +66,7 @@ pub const Module = struct {
6666
6767 std.sort.sort([]const u8, file_list_2.items, void{}, struct {
6868 pub fn lt(context: void, lhs: []const u8, rhs: []const u8) bool {
69 _ = context;
6970 return std.mem.lessThan(u8, lhs, rhs);
7071 }
7172 }.lt);
src/util/yaml.zig+23-14
......@@ -29,6 +29,9 @@ pub const Item = union(enum) {
2929 stream: Stream,
3030
3131 pub fn format(self: Item, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {
32 _ = fmt;
33 _ = options;
34
3235 try writer.writeAll("Item{");
3336 switch (self) {
3437 .event => {
......@@ -68,6 +71,9 @@ pub const Value = union(enum) {
6871 sequence: Sequence,
6972
7073 pub fn format(self: Value, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {
74 _ = fmt;
75 _ = options;
76
7177 try writer.writeAll("Value{");
7278 switch (self) {
7379 .string => {
......@@ -109,7 +115,7 @@ pub const Mapping = struct {
109115 defer list.deinit();
110116 if (self.get(k)) |val| {
111117 if (val == .sequence) {
112 for (val.sequence) |item, i| {
118 for (val.sequence) |item| {
113119 if (item != .string) {
114120 continue;
115121 }
......@@ -121,6 +127,9 @@ pub const Mapping = struct {
121127 }
122128
123129 pub fn format(self: Mapping, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {
130 _ = fmt;
131 _ = options;
132
124133 try writer.writeAll("{ ");
125134 for (self.items) |it| {
126135 try std.fmt.format(writer, "{s}: ", .{it.key});
......@@ -152,7 +161,7 @@ pub fn parse(alloc: *std.mem.Allocator, input: []const u8) !Document {
152161 break;
153162 }
154163
155 const et = @enumToInt(event.type);
164 const et = event.type;
156165 try all_events.append(event);
157166 c.yaml_event_delete(&event);
158167
......@@ -200,11 +209,11 @@ pub const Error =
200209fn parse_item(p: *Parser, start: ?Token) Error!Item {
201210 const tok = start orelse p.next();
202211 return switch (tok.?.type) {
203 .YAML_STREAM_START_EVENT => Item{ .stream = try parse_stream(p) },
204 .YAML_DOCUMENT_START_EVENT => Item{ .document = try parse_document(p) },
205 .YAML_MAPPING_START_EVENT => Item{ .mapping = try parse_mapping(p) },
206 .YAML_SEQUENCE_START_EVENT => Item{ .sequence = try parse_sequence(p) },
207 .YAML_SCALAR_EVENT => Item{ .string = get_event_string(tok.?, p.lines) },
212 c.YAML_STREAM_START_EVENT => Item{ .stream = try parse_stream(p) },
213 c.YAML_DOCUMENT_START_EVENT => Item{ .document = try parse_document(p) },
214 c.YAML_MAPPING_START_EVENT => Item{ .mapping = try parse_mapping(p) },
215 c.YAML_SEQUENCE_START_EVENT => Item{ .sequence = try parse_sequence(p) },
216 c.YAML_SCALAR_EVENT => Item{ .string = get_event_string(tok.?, p.lines) },
208217 else => unreachable,
209218 };
210219}
......@@ -215,10 +224,10 @@ fn parse_stream(p: *Parser) Error!Stream {
215224
216225 while (true) {
217226 const tok = p.next();
218 if (tok.?.type == .YAML_STREAM_END_EVENT) {
227 if (tok.?.type == c.YAML_STREAM_END_EVENT) {
219228 return Stream{ .docs = res.toOwnedSlice() };
220229 }
221 if (tok.?.type != .YAML_DOCUMENT_START_EVENT) {
230 if (tok.?.type != c.YAML_DOCUMENT_START_EVENT) {
222231 return error.YamlUnexpectedToken;
223232 }
224233 const item = try parse_item(p, tok);
......@@ -228,12 +237,12 @@ fn parse_stream(p: *Parser) Error!Stream {
228237
229238fn parse_document(p: *Parser) Error!Document {
230239 const tok = p.next();
231 if (tok.?.type != .YAML_MAPPING_START_EVENT) {
240 if (tok.?.type != c.YAML_MAPPING_START_EVENT) {
232241 return error.YamlUnexpectedToken;
233242 }
234243 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) {
237246 return error.YamlUnexpectedToken;
238247 }
239248 return Document{ .mapping = item.mapping };
......@@ -245,10 +254,10 @@ fn parse_mapping(p: *Parser) Error!Mapping {
245254
246255 while (true) {
247256 const tok = p.next();
248 if (tok.?.type == .YAML_MAPPING_END_EVENT) {
257 if (tok.?.type == c.YAML_MAPPING_END_EVENT) {
249258 return Mapping{ .items = res.toOwnedSlice() };
250259 }
251 if (tok.?.type != .YAML_SCALAR_EVENT) {
260 if (tok.?.type != c.YAML_SCALAR_EVENT) {
252261 return error.YamlUnexpectedToken;
253262 }
254263 try res.append(Key{
......@@ -274,7 +283,7 @@ fn parse_sequence(p: *Parser) Error!Sequence {
274283
275284 while (true) {
276285 const tok = p.next();
277 if (tok.?.type == .YAML_SEQUENCE_END_EVENT) {
286 if (tok.?.type == c.YAML_SEQUENCE_END_EVENT) {
278287 return res.toOwnedSlice();
279288 }
280289 try res.append(try parse_item(p, tok));
zig.sum+6-6
......@@ -1,11 +1,11 @@
11blake3-22472b867734926b202c055892fb0abb03f91556cd88998e2fe77addb003b1dd v/git/github.com/yaml/libyaml/tag-0.2.5
22blake3-7fc0b46397932ea1f0726d42289606ca118cc745d88dd87c0d6a377ba7c6569f git/github.com/nektro/zig-ansi
3blake3-e7d7348c05ca69eab697c8a902126b6dcb49ac396ef22750b79a3e575fb74b0e git/github.com/ziglibs/known-folders
3blake3-35a1c330c9999876e71418a7d43ad24ca7d1e23c3b5576e5cb75667e3392cc10 git/github.com/ziglibs/known-folders
44blake3-77ce43ca22debd0e34b3b6b8dfc251e4242916b5eaf06bdefababda192bdec82 git/github.com/nektro/zig-licenses
5blake3-3076108a21d2651a6ac953bea11fc3d686e0a4d3159b42993092fdf491deaa7c git/github.com/truemedian/zfetch
6blake3-bcb05a67cf2fbc9ca71005a781edde20e4df60ee9c83dcc32d9eca2b3ef619a3 git/github.com/truemedian/hzzp
7blake3-2e12f3177129efb0b5a8d10d1742f1b0c4e8d3e38790496462b29a10c9adcd7d git/github.com/alexnask/iguanaTLS
8blake3-51e4c8eed508968526ec7a4247f0ad40635c49228ba305e17607f6090ce1cb2a git/github.com/MasterQ32/zig-network
5blake3-ec191c4930c6fbaf059fadccb1470500b77d01d48f3fa390793822e403d7a3dc git/github.com/truemedian/zfetch
6blake3-98982125d0fbedc62e179e62081d2797a2b8a3623c42f9fd5d72cd56d6350714 git/github.com/truemedian/hzzp
7blake3-e6901bd7432450d5b22b01880cc7fa3fa2433e766a527206f18b29c67c1349bb git/github.com/alexnask/iguanaTLS
8blake3-21f91e48333ac0ca7f4704c96352831c25216e7056d02ce24de95d03fc942246 git/github.com/MasterQ32/zig-network
99blake3-754b1b7e57b716ca042a9fc5c262e4931a804bddd52df695ec2b5476d0df0005 git/github.com/MasterQ32/zig-uri
10blake3-155960bc30c27ccee4f6f10cfb0398d1bcec367abaabb16f18de6176bd92112c git/github.com/nektro/zig-json
10blake3-d2a61dbaa3505a69473a9c63e34c9abd6ba8d93055796ad4b1e5f5eb9982c815 git/github.com/nektro/zig-json
1111blake3-09698753782139ab4877d08f33235170836f68b73e482b65cdee5637a6addf86 v/http/aquila.red/1/nektro/range/v0.1.tar.gz/d2f72fdd