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