| author | |
| committer | |
| log | a6a764265792dafc3bc09c84aedcebdb9df28997 |
| tree | 270c3c15bb145806ac7d496fd9482c4cfae2f7e1 |
| parent | 73b469c6961e50b57cea61814d39237efe25318c |
13 files changed, 52 insertions(+), 29 deletions(-)
.circleci/config.yml+1-1| ... | ... | @@ -15,7 +15,7 @@ jobs: |
| 15 | 15 | - run: git submodule update --init --recursive |
| 16 | 16 | |
| 17 | 17 | - 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 | |
| 19 | 19 | - run: zig version |
| 20 | 20 | - run: zig env |
| 21 | 21 | - run: zig build -Dbootstrap |
README.md+1-1| ... | ... | @@ -17,7 +17,7 @@ A package manager for the Zig programming language. |
| 17 | 17 | - https://github.com/nektro/zigmod/releases |
| 18 | 18 | |
| 19 | 19 | ## Built With |
| 20 | - Zig master `0.9.0-dev.197+1f29b75f0` | |
| 20 | - Zig master `0.9.0-dev.370+8a863381d` | |
| 21 | 21 | |
| 22 | 22 | ### Build from Source |
| 23 | 23 | Initially, |
docs/README.md+1-1| ... | ... | @@ -8,7 +8,7 @@ You can learn more about Zig here: |
| 8 | 8 | |
| 9 | 9 | The rest of this documentation will assume you already have Zig installed. |
| 10 | 10 | |
| 11 | 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`. | |
| 11 | 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`. | |
| 12 | 12 | |
| 13 | 13 | ## Download |
| 14 | 14 | You 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 | 8 | // |
| 9 | 9 | |
| 10 | 10 | pub fn execute(args: [][]u8) !void { |
| 11 | // | |
| 11 | _ = args; | |
| 12 | ||
| 12 | 13 | const mod = try u.ModFile.init(gpa, "zig.mod"); |
| 13 | 14 | |
| 14 | 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 | 136 | } |
| 137 | 137 | |
| 138 | 138 | fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, array: bool) !void { |
| 139 | _ = dir; | |
| 140 | ||
| 139 | 141 | if (m.has_no_zig_deps() and tabs > 0) { |
| 140 | 142 | try w.print("null", .{}); |
| 141 | 143 | return; |
| ... | ... | @@ -152,8 +154,8 @@ fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, ar |
| 152 | 154 | continue; |
| 153 | 155 | } |
| 154 | 156 | 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, "/", "_"); | |
| 157 | 159 | try w.print(" pub const {s} = packages[{}];\n", .{ r2, i }); |
| 158 | 160 | } else { |
| 159 | 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 | 195 | } |
| 194 | 196 | |
| 195 | 197 | fn print_csrc_flags_to(w: std.fs.File.Writer, list: []u.Module) !void { |
| 196 | for (list) |mod, i| { | |
| 198 | for (list) |mod| { | |
| 197 | 199 | if (mod.is_sys_lib) { |
| 198 | 200 | continue; |
| 199 | 201 | } |
| ... | ... | @@ -209,6 +211,8 @@ fn print_csrc_flags_to(w: std.fs.File.Writer, list: []u.Module) !void { |
| 209 | 211 | } |
| 210 | 212 | |
| 211 | 213 | fn print_sys_libs_to(w: std.fs.File.Writer, list: []u.Module, list2: *std.ArrayList([]const u8)) !void { |
| 214 | _ = list2; | |
| 215 | ||
| 212 | 216 | for (list) |mod| { |
| 213 | 217 | if (!mod.is_sys_lib) { |
| 214 | 218 | continue; |
src/cmd/license.zig+2-1| ... | ... | @@ -15,7 +15,8 @@ const Map = std.StringArrayHashMap(*List); |
| 15 | 15 | // https://github.com/onur/cargo-license |
| 16 | 16 | |
| 17 | 17 | pub fn execute(args: [][]u8) !void { |
| 18 | // | |
| 18 | _ = args; | |
| 19 | ||
| 19 | 20 | const dir = try std.fs.path.join(gpa, &.{ ".zigmod", "deps" }); |
| 20 | 21 | |
| 21 | 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 | 10 | // |
| 11 | 11 | |
| 12 | 12 | pub fn execute(args: [][]u8) !void { |
| 13 | // | |
| 13 | _ = args; | |
| 14 | ||
| 14 | 15 | const dir = try std.fs.path.join(gpa, &.{ ".zigmod", "deps" }); |
| 15 | 16 | |
| 16 | 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 | 12 | // |
| 13 | 13 | |
| 14 | 14 | pub fn execute(args: [][]u8) !void { |
| 15 | _ = args; | |
| 16 | ||
| 15 | 17 | const out = std.io.getStdOut().writer(); |
| 16 | 18 | |
| 17 | 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 | 12 | // |
| 13 | 13 | |
| 14 | 14 | pub fn execute(args: [][]u8) !void { |
| 15 | _ = args; | |
| 16 | ||
| 15 | 17 | const out = std.io.getStdOut().writer(); |
| 16 | 18 | |
| 17 | 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 | 56 | } |
| 57 | 57 | |
| 58 | 58 | pub fn update(self: DepType, dpath: []const u8, rpath: []const u8) !void { |
| 59 | _ = rpath; | |
| 60 | ||
| 59 | 61 | switch (self) { |
| 60 | 62 | .local => {}, |
| 61 | 63 | .system_lib => {}, |
src/util/module.zig+1| ... | ... | @@ -66,6 +66,7 @@ pub const Module = struct { |
| 66 | 66 | |
| 67 | 67 | std.sort.sort([]const u8, file_list_2.items, void{}, struct { |
| 68 | 68 | pub fn lt(context: void, lhs: []const u8, rhs: []const u8) bool { |
| 69 | _ = context; | |
| 69 | 70 | return std.mem.lessThan(u8, lhs, rhs); |
| 70 | 71 | } |
| 71 | 72 | }.lt); |
src/util/yaml.zig+23-14| ... | ... | @@ -29,6 +29,9 @@ pub const Item = union(enum) { |
| 29 | 29 | stream: Stream, |
| 30 | 30 | |
| 31 | 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 | 35 | try writer.writeAll("Item{"); |
| 33 | 36 | switch (self) { |
| 34 | 37 | .event => { |
| ... | ... | @@ -68,6 +71,9 @@ pub const Value = union(enum) { |
| 68 | 71 | sequence: Sequence, |
| 69 | 72 | |
| 70 | 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 | 77 | try writer.writeAll("Value{"); |
| 72 | 78 | switch (self) { |
| 73 | 79 | .string => { |
| ... | ... | @@ -109,7 +115,7 @@ pub const Mapping = struct { |
| 109 | 115 | defer list.deinit(); |
| 110 | 116 | if (self.get(k)) |val| { |
| 111 | 117 | if (val == .sequence) { |
| 112 | for (val.sequence) |item, i| { | |
| 118 | for (val.sequence) |item| { | |
| 113 | 119 | if (item != .string) { |
| 114 | 120 | continue; |
| 115 | 121 | } |
| ... | ... | @@ -121,6 +127,9 @@ pub const Mapping = struct { |
| 121 | 127 | } |
| 122 | 128 | |
| 123 | 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 | 133 | try writer.writeAll("{ "); |
| 125 | 134 | for (self.items) |it| { |
| 126 | 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 | 161 | break; |
| 153 | 162 | } |
| 154 | 163 | |
| 155 | const et = @enumToInt(event.type); | |
| 164 | const et = event.type; | |
| 156 | 165 | try all_events.append(event); |
| 157 | 166 | c.yaml_event_delete(&event); |
| 158 | 167 | |
| ... | ... | @@ -200,11 +209,11 @@ pub const Error = |
| 200 | 209 | fn parse_item(p: *Parser, start: ?Token) Error!Item { |
| 201 | 210 | const tok = start orelse p.next(); |
| 202 | 211 | 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) }, | |
| 208 | 217 | else => unreachable, |
| 209 | 218 | }; |
| 210 | 219 | } |
| ... | ... | @@ -215,10 +224,10 @@ fn parse_stream(p: *Parser) Error!Stream { |
| 215 | 224 | |
| 216 | 225 | while (true) { |
| 217 | 226 | const tok = p.next(); |
| 218 | if (tok.?.type == .YAML_STREAM_END_EVENT) { | |
| 227 | if (tok.?.type == c.YAML_STREAM_END_EVENT) { | |
| 219 | 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 | 231 | return error.YamlUnexpectedToken; |
| 223 | 232 | } |
| 224 | 233 | const item = try parse_item(p, tok); |
| ... | ... | @@ -228,12 +237,12 @@ fn parse_stream(p: *Parser) Error!Stream { |
| 228 | 237 | |
| 229 | 238 | fn parse_document(p: *Parser) Error!Document { |
| 230 | 239 | const tok = p.next(); |
| 231 | if (tok.?.type != .YAML_MAPPING_START_EVENT) { | |
| 240 | if (tok.?.type != c.YAML_MAPPING_START_EVENT) { | |
| 232 | 241 | return error.YamlUnexpectedToken; |
| 233 | 242 | } |
| 234 | 243 | const item = try parse_item(p, tok); |
| 235 | 244 | |
| 236 | if (p.next().?.type != .YAML_DOCUMENT_END_EVENT) { | |
| 245 | if (p.next().?.type != c.YAML_DOCUMENT_END_EVENT) { | |
| 237 | 246 | return error.YamlUnexpectedToken; |
| 238 | 247 | } |
| 239 | 248 | return Document{ .mapping = item.mapping }; |
| ... | ... | @@ -245,10 +254,10 @@ fn parse_mapping(p: *Parser) Error!Mapping { |
| 245 | 254 | |
| 246 | 255 | while (true) { |
| 247 | 256 | const tok = p.next(); |
| 248 | if (tok.?.type == .YAML_MAPPING_END_EVENT) { | |
| 257 | if (tok.?.type == c.YAML_MAPPING_END_EVENT) { | |
| 249 | 258 | return Mapping{ .items = res.toOwnedSlice() }; |
| 250 | 259 | } |
| 251 | if (tok.?.type != .YAML_SCALAR_EVENT) { | |
| 260 | if (tok.?.type != c.YAML_SCALAR_EVENT) { | |
| 252 | 261 | return error.YamlUnexpectedToken; |
| 253 | 262 | } |
| 254 | 263 | try res.append(Key{ |
| ... | ... | @@ -274,7 +283,7 @@ fn parse_sequence(p: *Parser) Error!Sequence { |
| 274 | 283 | |
| 275 | 284 | while (true) { |
| 276 | 285 | const tok = p.next(); |
| 277 | if (tok.?.type == .YAML_SEQUENCE_END_EVENT) { | |
| 286 | if (tok.?.type == c.YAML_SEQUENCE_END_EVENT) { | |
| 278 | 287 | return res.toOwnedSlice(); |
| 279 | 288 | } |
| 280 | 289 | try res.append(try parse_item(p, tok)); |
zig.sum+6-6| ... | ... | @@ -1,11 +1,11 @@ |
| 1 | 1 | blake3-22472b867734926b202c055892fb0abb03f91556cd88998e2fe77addb003b1dd v/git/github.com/yaml/libyaml/tag-0.2.5 |
| 2 | 2 | blake3-7fc0b46397932ea1f0726d42289606ca118cc745d88dd87c0d6a377ba7c6569f git/github.com/nektro/zig-ansi |
| 3 | blake3-e7d7348c05ca69eab697c8a902126b6dcb49ac396ef22750b79a3e575fb74b0e git/github.com/ziglibs/known-folders | |
| 3 | blake3-35a1c330c9999876e71418a7d43ad24ca7d1e23c3b5576e5cb75667e3392cc10 git/github.com/ziglibs/known-folders | |
| 4 | 4 | blake3-77ce43ca22debd0e34b3b6b8dfc251e4242916b5eaf06bdefababda192bdec82 git/github.com/nektro/zig-licenses |
| 5 | blake3-3076108a21d2651a6ac953bea11fc3d686e0a4d3159b42993092fdf491deaa7c git/github.com/truemedian/zfetch | |
| 6 | blake3-bcb05a67cf2fbc9ca71005a781edde20e4df60ee9c83dcc32d9eca2b3ef619a3 git/github.com/truemedian/hzzp | |
| 7 | blake3-2e12f3177129efb0b5a8d10d1742f1b0c4e8d3e38790496462b29a10c9adcd7d git/github.com/alexnask/iguanaTLS | |
| 8 | blake3-51e4c8eed508968526ec7a4247f0ad40635c49228ba305e17607f6090ce1cb2a git/github.com/MasterQ32/zig-network | |
| 5 | blake3-ec191c4930c6fbaf059fadccb1470500b77d01d48f3fa390793822e403d7a3dc git/github.com/truemedian/zfetch | |
| 6 | blake3-98982125d0fbedc62e179e62081d2797a2b8a3623c42f9fd5d72cd56d6350714 git/github.com/truemedian/hzzp | |
| 7 | blake3-e6901bd7432450d5b22b01880cc7fa3fa2433e766a527206f18b29c67c1349bb git/github.com/alexnask/iguanaTLS | |
| 8 | blake3-21f91e48333ac0ca7f4704c96352831c25216e7056d02ce24de95d03fc942246 git/github.com/MasterQ32/zig-network | |
| 9 | 9 | blake3-754b1b7e57b716ca042a9fc5c262e4931a804bddd52df695ec2b5476d0df0005 git/github.com/MasterQ32/zig-uri |
| 10 | blake3-155960bc30c27ccee4f6f10cfb0398d1bcec367abaabb16f18de6176bd92112c git/github.com/nektro/zig-json | |
| 10 | blake3-d2a61dbaa3505a69473a9c63e34c9abd6ba8d93055796ad4b1e5f5eb9982c815 git/github.com/nektro/zig-json | |
| 11 | 11 | blake3-09698753782139ab4877d08f33235170836f68b73e482b65cdee5637a6addf86 v/http/aquila.red/1/nektro/range/v0.1.tar.gz/d2f72fdd |