| ... | ... | @@ -83,7 +83,7 @@ pub fn create_depszig(dir: []const u8, top_module: u.Module, list: *std.ArrayLis |
| 83 | 83 | try w.writeAll("pub const package_data = struct {\n"); |
| 84 | 84 | const duped = &std.ArrayList(u.Module).init(gpa); |
| 85 | 85 | for (list.items) |mod| { |
| 86 | | if (std.mem.eql(u8, mod.id, "root")) { |
| 86 | if (mod.is_sys_lib) { |
| 87 | 87 | continue; |
| 88 | 88 | } |
| 89 | 89 | try duped.append(mod); |
| ... | ... | @@ -115,6 +115,7 @@ fn create_lockfile(list: *std.ArrayList(u.Module), dir: []const u8) !void { |
| 115 | 115 | if (md.type == .local) { |
| 116 | 116 | continue; |
| 117 | 117 | } |
| 118 | if (md.type == .system_lib) continue; |
| 118 | 119 | const mpath = try std.fs.path.join(gpa, &.{ dir, m.clean_path }); |
| 119 | 120 | const version = if (md.version.len > 0) md.version else (try md.type.exact_version(mpath)); |
| 120 | 121 | try wl.print("{s} {s} {s}\n", .{ @tagName(md.type), md.path, version }); |
| ... | ... | @@ -124,10 +125,12 @@ fn create_lockfile(list: *std.ArrayList(u.Module), dir: []const u8) !void { |
| 124 | 125 | |
| 125 | 126 | fn print_dirs(w: std.fs.File.Writer, list: []const u.Module) !void { |
| 126 | 127 | for (list) |mod| { |
| 128 | if (mod.is_sys_lib) continue; |
| 127 | 129 | if (std.mem.eql(u8, mod.id, "root")) { |
| 130 | try w.print(" pub const _root = \"\";\n", .{}); |
| 128 | 131 | continue; |
| 129 | 132 | } |
| 130 | | try w.print(" pub const _{s} = cache ++ \"/{}\";\n", .{ mod.id[0..12], std.zig.fmtEscapes(mod.clean_path) }); |
| 133 | try w.print(" pub const _{s} = cache ++ \"/{}\";\n", .{ mod.short_id(), std.zig.fmtEscapes(mod.clean_path) }); |
| 131 | 134 | } |
| 132 | 135 | } |
| 133 | 136 | |
| ... | ... | @@ -151,14 +154,14 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(u.Module), d |
| 151 | 154 | \\ pub const _{s} = Package{{ |
| 152 | 155 | \\ |
| 153 | 156 | , .{ |
| 154 | | mod.id[0..12], |
| 157 | mod.short_id(), |
| 155 | 158 | }); |
| 156 | | if (mod.main.len > 0) { |
| 159 | if (mod.main.len > 0 and !std.mem.eql(u8, mod.id, "root")) { |
| 157 | 160 | try w.print( |
| 158 | 161 | \\ .pkg = Pkg{{ .name = "{s}", .path = .{{ .path = dirs._{s} ++ "/{s}" }}, .dependencies = |
| 159 | 162 | , .{ |
| 160 | 163 | mod.name, |
| 161 | | mod.id[0..12], |
| 164 | mod.short_id(), |
| 162 | 165 | mod.main, |
| 163 | 166 | }); |
| 164 | 167 | if (mod.has_no_zig_deps()) { |
| ... | ... | @@ -200,7 +203,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(u.Module), d |
| 200 | 203 | if (mod.has_syslib_deps()) { |
| 201 | 204 | try w.writeAll(" .system_libs = &.{"); |
| 202 | 205 | for (mod.deps) |item, j| { |
| 203 | | if (!mod.is_sys_lib) continue; |
| 206 | if (!item.is_sys_lib) continue; |
| 204 | 207 | try w.print(" \"{}\"", .{std.zig.fmtEscapes(item.name)}); |
| 205 | 208 | if (j != mod.deps.len - 1) try w.writeAll(","); |
| 206 | 209 | } |