From a6a764265792dafc3bc09c84aedcebdb9df28997 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sun, 4 Jul 2021 01:08:32 -0700 Subject: [PATCH] updated to zig master version `0.9.0-dev.370` --- .circleci/config.yml | 2 +- README.md | 2 +- docs/README.md | 2 +- src/cmd/aquila/update.zig | 3 ++- src/cmd/fetch.zig | 10 +++++++--- src/cmd/license.zig | 3 ++- src/cmd/sum.zig | 3 ++- src/cmd/zpm/search.zig | 2 ++ src/cmd/zpm/tags.zig | 2 ++ src/util/dep_type.zig | 2 ++ src/util/module.zig | 1 + src/util/yaml.zig | 37 +++++++++++++++++++++++-------------- zig.sum | 12 ++++++------ 13 files changed, 52 insertions(+), 29 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eeae69ef2a0775e2533fab36340ee9cdccbb7bdd..e66569aecb33074c6879bf7edabc3e30e3db3f94 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: - run: git submodule update --init --recursive - run: apt -y install xz-utils jq - - run: ./download_zig.sh 0.9.0-dev.197+1f29b75f0 + - run: ./download_zig.sh 0.9.0-dev.370+8a863381d - run: zig version - run: zig env - run: zig build -Dbootstrap diff --git a/README.md b/README.md index 02b8dbd55de7c88ed2ba3aed0946e28f1ece0e95..f57265cf56d7b9d539b7d90728fd88f4848e9362 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ A package manager for the Zig programming language. - https://github.com/nektro/zigmod/releases ## Built With -- Zig master `0.9.0-dev.197+1f29b75f0` +- Zig master `0.9.0-dev.370+8a863381d` ### Build from Source Initially, diff --git a/docs/README.md b/docs/README.md index 00b3a5db51682959db166cd7bca603ef07a00504..dec1de90c41b81e0d5549f60796f18e0c82c99e6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,7 +8,7 @@ You can learn more about Zig here: The rest of this documentation will assume you already have Zig installed. -As 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`. +As 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`. ## Download You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source. diff --git a/src/cmd/aquila/update.zig b/src/cmd/aquila/update.zig index 8fe062fcd46f3936d08c1deabb6e47bd533fc63e..708e0f482927506bb3f98db76c5b06c00535a9a5 100644 --- a/src/cmd/aquila/update.zig +++ b/src/cmd/aquila/update.zig @@ -8,7 +8,8 @@ const aq = @import("./../aq.zig"); // pub fn execute(args: [][]u8) !void { - // + _ = args; + const mod = try u.ModFile.init(gpa, "zig.mod"); for (mod.deps) |d| { diff --git a/src/cmd/fetch.zig b/src/cmd/fetch.zig index 60cf76310bba6ced28660055ba8d1ceb12aec032..8f7121b1f788589e2fb75ed97336e9ceaf9148dc 100644 --- a/src/cmd/fetch.zig +++ b/src/cmd/fetch.zig @@ -136,6 +136,8 @@ fn print_paths(w: std.fs.File.Writer, list: []u.Module) !void { } fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, array: bool) !void { + _ = dir; + if (m.has_no_zig_deps() and tabs > 0) { try w.print("null", .{}); return; @@ -152,8 +154,8 @@ fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, ar continue; } if (!array) { - const r1 = std.mem.replaceOwned(u8, gpa, d.name, "-", "_"); - const r2 = std.mem.replaceOwned(u8, gpa, d.name, "/", "_"); + const r1 = try std.mem.replaceOwned(u8, gpa, d.name, "-", "_"); + const r2 = try std.mem.replaceOwned(u8, gpa, r1, "/", "_"); try w.print(" pub const {s} = packages[{}];\n", .{ r2, i }); } else { 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 { } fn print_csrc_flags_to(w: std.fs.File.Writer, list: []u.Module) !void { - for (list) |mod, i| { + for (list) |mod| { if (mod.is_sys_lib) { continue; } @@ -209,6 +211,8 @@ fn print_csrc_flags_to(w: std.fs.File.Writer, list: []u.Module) !void { } fn print_sys_libs_to(w: std.fs.File.Writer, list: []u.Module, list2: *std.ArrayList([]const u8)) !void { + _ = list2; + for (list) |mod| { if (!mod.is_sys_lib) { continue; diff --git a/src/cmd/license.zig b/src/cmd/license.zig index 5bd12d8cf4d37ab7e70a5f03883a34be181ad5b1..7416649f07997e3562e426adc0ecd51f173f2e43 100644 --- a/src/cmd/license.zig +++ b/src/cmd/license.zig @@ -15,7 +15,8 @@ const Map = std.StringArrayHashMap(*List); // https://github.com/onur/cargo-license pub fn execute(args: [][]u8) !void { - // + _ = args; + const dir = try std.fs.path.join(gpa, &.{ ".zigmod", "deps" }); const top_module = try common.collect_deps_deep(dir, "zig.mod", .{ diff --git a/src/cmd/sum.zig b/src/cmd/sum.zig index a4235c96ca26e2ba67370877af0ae88ea92851c6..86faf3aa0e3823875725edb9d2f71264bc2259d8 100644 --- a/src/cmd/sum.zig +++ b/src/cmd/sum.zig @@ -10,7 +10,8 @@ const common = @import("./../common.zig"); // pub fn execute(args: [][]u8) !void { - // + _ = args; + const dir = try std.fs.path.join(gpa, &.{ ".zigmod", "deps" }); const top_module = try common.collect_deps_deep(dir, "zig.mod", .{ diff --git a/src/cmd/zpm/search.zig b/src/cmd/zpm/search.zig index 8ca76a27d10b08b27d2c3331f1dd81a9cbe9bb0c..0309bf3512ce075c5a6b5af273aa05aec7d12871 100644 --- a/src/cmd/zpm/search.zig +++ b/src/cmd/zpm/search.zig @@ -12,6 +12,8 @@ const zpm = @import("./../zpm.zig"); // pub fn execute(args: [][]u8) !void { + _ = args; + const out = std.io.getStdOut().writer(); const url = try std.mem.join(gpa, "/", &.{ zpm.server_root, "packages" }); diff --git a/src/cmd/zpm/tags.zig b/src/cmd/zpm/tags.zig index fc95cdd65560c47bb2355d9d125da4de0dba66d1..52ed18734836a63b7b10a438d9e4bf8fe0d2e51f 100644 --- a/src/cmd/zpm/tags.zig +++ b/src/cmd/zpm/tags.zig @@ -12,6 +12,8 @@ const zpm = @import("./../zpm.zig"); // pub fn execute(args: [][]u8) !void { + _ = args; + const out = std.io.getStdOut().writer(); const url = try std.mem.join(gpa, "/", &.{ zpm.server_root, "tags" }); diff --git a/src/util/dep_type.zig b/src/util/dep_type.zig index 3243f6de71ead921fc1b82b8df65b41ef8a829f5..0eedef3a1a8fdc9e046e400143bca60b4d150563 100644 --- a/src/util/dep_type.zig +++ b/src/util/dep_type.zig @@ -56,6 +56,8 @@ pub const DepType = enum { } pub fn update(self: DepType, dpath: []const u8, rpath: []const u8) !void { + _ = rpath; + switch (self) { .local => {}, .system_lib => {}, diff --git a/src/util/module.zig b/src/util/module.zig index aeade0e7348168f662cffdec64534f722b9070f4..3fbe32d16ce99380af8889cc3ad972196005cd20 100644 --- a/src/util/module.zig +++ b/src/util/module.zig @@ -66,6 +66,7 @@ pub const Module = struct { std.sort.sort([]const u8, file_list_2.items, void{}, struct { pub fn lt(context: void, lhs: []const u8, rhs: []const u8) bool { + _ = context; return std.mem.lessThan(u8, lhs, rhs); } }.lt); diff --git a/src/util/yaml.zig b/src/util/yaml.zig index 30deabb04733055c569d53c9da1b6d27fe59b25c..212dd968b34c1ce15cb30d260be762d0ca6f16ce 100644 --- a/src/util/yaml.zig +++ b/src/util/yaml.zig @@ -29,6 +29,9 @@ pub const Item = union(enum) { stream: Stream, pub fn format(self: Item, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void { + _ = fmt; + _ = options; + try writer.writeAll("Item{"); switch (self) { .event => { @@ -68,6 +71,9 @@ pub const Value = union(enum) { sequence: Sequence, pub fn format(self: Value, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void { + _ = fmt; + _ = options; + try writer.writeAll("Value{"); switch (self) { .string => { @@ -109,7 +115,7 @@ pub const Mapping = struct { defer list.deinit(); if (self.get(k)) |val| { if (val == .sequence) { - for (val.sequence) |item, i| { + for (val.sequence) |item| { if (item != .string) { continue; } @@ -121,6 +127,9 @@ pub const Mapping = struct { } pub fn format(self: Mapping, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void { + _ = fmt; + _ = options; + try writer.writeAll("{ "); for (self.items) |it| { try std.fmt.format(writer, "{s}: ", .{it.key}); @@ -152,7 +161,7 @@ pub fn parse(alloc: *std.mem.Allocator, input: []const u8) !Document { break; } - const et = @enumToInt(event.type); + const et = event.type; try all_events.append(event); c.yaml_event_delete(&event); @@ -200,11 +209,11 @@ pub const Error = fn parse_item(p: *Parser, start: ?Token) Error!Item { const tok = start orelse p.next(); return switch (tok.?.type) { - .YAML_STREAM_START_EVENT => Item{ .stream = try parse_stream(p) }, - .YAML_DOCUMENT_START_EVENT => Item{ .document = try parse_document(p) }, - .YAML_MAPPING_START_EVENT => Item{ .mapping = try parse_mapping(p) }, - .YAML_SEQUENCE_START_EVENT => Item{ .sequence = try parse_sequence(p) }, - .YAML_SCALAR_EVENT => Item{ .string = get_event_string(tok.?, p.lines) }, + c.YAML_STREAM_START_EVENT => Item{ .stream = try parse_stream(p) }, + c.YAML_DOCUMENT_START_EVENT => Item{ .document = try parse_document(p) }, + c.YAML_MAPPING_START_EVENT => Item{ .mapping = try parse_mapping(p) }, + c.YAML_SEQUENCE_START_EVENT => Item{ .sequence = try parse_sequence(p) }, + c.YAML_SCALAR_EVENT => Item{ .string = get_event_string(tok.?, p.lines) }, else => unreachable, }; } @@ -215,10 +224,10 @@ fn parse_stream(p: *Parser) Error!Stream { while (true) { const tok = p.next(); - if (tok.?.type == .YAML_STREAM_END_EVENT) { + if (tok.?.type == c.YAML_STREAM_END_EVENT) { return Stream{ .docs = res.toOwnedSlice() }; } - if (tok.?.type != .YAML_DOCUMENT_START_EVENT) { + if (tok.?.type != c.YAML_DOCUMENT_START_EVENT) { return error.YamlUnexpectedToken; } const item = try parse_item(p, tok); @@ -228,12 +237,12 @@ fn parse_stream(p: *Parser) Error!Stream { fn parse_document(p: *Parser) Error!Document { const tok = p.next(); - if (tok.?.type != .YAML_MAPPING_START_EVENT) { + if (tok.?.type != c.YAML_MAPPING_START_EVENT) { return error.YamlUnexpectedToken; } const item = try parse_item(p, tok); - if (p.next().?.type != .YAML_DOCUMENT_END_EVENT) { + if (p.next().?.type != c.YAML_DOCUMENT_END_EVENT) { return error.YamlUnexpectedToken; } return Document{ .mapping = item.mapping }; @@ -245,10 +254,10 @@ fn parse_mapping(p: *Parser) Error!Mapping { while (true) { const tok = p.next(); - if (tok.?.type == .YAML_MAPPING_END_EVENT) { + if (tok.?.type == c.YAML_MAPPING_END_EVENT) { return Mapping{ .items = res.toOwnedSlice() }; } - if (tok.?.type != .YAML_SCALAR_EVENT) { + if (tok.?.type != c.YAML_SCALAR_EVENT) { return error.YamlUnexpectedToken; } try res.append(Key{ @@ -274,7 +283,7 @@ fn parse_sequence(p: *Parser) Error!Sequence { while (true) { const tok = p.next(); - if (tok.?.type == .YAML_SEQUENCE_END_EVENT) { + if (tok.?.type == c.YAML_SEQUENCE_END_EVENT) { return res.toOwnedSlice(); } try res.append(try parse_item(p, tok)); diff --git a/zig.sum b/zig.sum index bd188528f766ac020630ab8e2b3b55550e795467..fddf66dfce625e1fd1909e8e3a4458f55f9b8040 100644 --- a/zig.sum +++ b/zig.sum @@ -1,11 +1,11 @@ blake3-22472b867734926b202c055892fb0abb03f91556cd88998e2fe77addb003b1dd v/git/github.com/yaml/libyaml/tag-0.2.5 blake3-7fc0b46397932ea1f0726d42289606ca118cc745d88dd87c0d6a377ba7c6569f git/github.com/nektro/zig-ansi -blake3-e7d7348c05ca69eab697c8a902126b6dcb49ac396ef22750b79a3e575fb74b0e git/github.com/ziglibs/known-folders +blake3-35a1c330c9999876e71418a7d43ad24ca7d1e23c3b5576e5cb75667e3392cc10 git/github.com/ziglibs/known-folders blake3-77ce43ca22debd0e34b3b6b8dfc251e4242916b5eaf06bdefababda192bdec82 git/github.com/nektro/zig-licenses -blake3-3076108a21d2651a6ac953bea11fc3d686e0a4d3159b42993092fdf491deaa7c git/github.com/truemedian/zfetch -blake3-bcb05a67cf2fbc9ca71005a781edde20e4df60ee9c83dcc32d9eca2b3ef619a3 git/github.com/truemedian/hzzp -blake3-2e12f3177129efb0b5a8d10d1742f1b0c4e8d3e38790496462b29a10c9adcd7d git/github.com/alexnask/iguanaTLS -blake3-51e4c8eed508968526ec7a4247f0ad40635c49228ba305e17607f6090ce1cb2a git/github.com/MasterQ32/zig-network +blake3-ec191c4930c6fbaf059fadccb1470500b77d01d48f3fa390793822e403d7a3dc git/github.com/truemedian/zfetch +blake3-98982125d0fbedc62e179e62081d2797a2b8a3623c42f9fd5d72cd56d6350714 git/github.com/truemedian/hzzp +blake3-e6901bd7432450d5b22b01880cc7fa3fa2433e766a527206f18b29c67c1349bb git/github.com/alexnask/iguanaTLS +blake3-21f91e48333ac0ca7f4704c96352831c25216e7056d02ce24de95d03fc942246 git/github.com/MasterQ32/zig-network blake3-754b1b7e57b716ca042a9fc5c262e4931a804bddd52df695ec2b5476d0df0005 git/github.com/MasterQ32/zig-uri -blake3-155960bc30c27ccee4f6f10cfb0398d1bcec367abaabb16f18de6176bd92112c git/github.com/nektro/zig-json +blake3-d2a61dbaa3505a69473a9c63e34c9abd6ba8d93055796ad4b1e5f5eb9982c815 git/github.com/nektro/zig-json blake3-09698753782139ab4877d08f33235170836f68b73e482b65cdee5637a6addf86 v/http/aquila.red/1/nektro/range/v0.1.tar.gz/d2f72fdd -- 2.54.0