authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-09-03 01:18:49 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-09-03 01:27:26 -07:00
logeecd2494c339e7dab2bdf312a0c69d2003b0bd6e
tree010a6247ad3d3eb199de476ccd98bf1c59e6f579
parent61403fb66c9687b7379e5f668656f66fe19a30b6

add another test repo


4 files changed, 19 insertions(+), 12 deletions(-)

.github/workflows/nightly.yml+1
......@@ -41,3 +41,4 @@ jobs:
4141 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-git-dep
4242 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-hg-dep
4343 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-http-dep
44 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-systemlib-dep
.github/workflows/push.yml+1
......@@ -46,6 +46,7 @@ jobs:
4646 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-git-dep
4747 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-hg-dep
4848 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-http-dep
49 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-systemlib-dep
4950
5051 # Github Release
5152 - run: ./changelog.sh
src/cmd/fetch.zig+16-12
......@@ -63,6 +63,10 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
6363 \\ const module = pkg.module(exe);
6464 \\ exe.root_module.addImport(pkg.import.?[0], module);
6565 \\ }
66 \\ for (package_data._root.system_libs) |libname| {
67 \\ exe.linkSystemLibrary(libname);
68 \\ exe.linkLibC();
69 \\ }
6670 \\}
6771 \\
6872 \\var link_lib_c = false;
......@@ -82,11 +86,8 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
8286 \\ return cached;
8387 \\ }
8488 \\ const b = exe.step.owner;
85 \\ const result = b.createModule(.{});
86 \\ const dummy_library = b.addStaticLibrary(.{
87 \\ .name = "dummy",
89 \\ const result = b.createModule(.{
8890 \\ .target = exe.root_module.resolved_target orelse b.host,
89 \\ .optimize = exe.root_module.optimize.?,
9091 \\ });
9192 \\ if (self.import) |capture| {
9293 \\ result.root_source_file = capture[1];
......@@ -105,25 +106,26 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
105106 \\ }
106107 \\ for (self.c_include_dirs) |item| {
107108 \\ result.addIncludePath(b.path(b.fmt("{s}/{s}", .{ self.directory, item })));
108 \\ dummy_library.addIncludePath(b.path(b.fmt("{s}/{s}", .{ self.directory, item })));
109 \\ exe.addIncludePath(b.path(b.fmt("{s}/{s}", .{ self.directory, item })));
109110 \\ link_lib_c = true;
110111 \\ }
111112 \\ for (self.c_source_files) |item| {
112 \\ dummy_library.addCSourceFile(.{ .file = b.path(b.fmt("{s}/{s}", .{ self.directory, item })), .flags = self.c_source_flags });
113 \\ exe.addCSourceFile(.{ .file = b.path(b.fmt("{s}/{s}", .{ self.directory, item })), .flags = self.c_source_flags });
114 \\ link_lib_c = true;
113115 \\ }
114116 \\ for (self.system_libs) |item| {
115 \\ dummy_library.linkSystemLibrary(item);
117 \\ result.linkSystemLibrary(item, .{});
118 \\ exe.linkSystemLibrary(item);
119 \\ link_lib_c = true;
116120 \\ }
117121 \\ for (self.frameworks) |item| {
118 \\ dummy_library.linkFramework(item);
119 \\ }
120 \\ if (self.c_source_files.len > 0 or self.system_libs.len > 0 or self.frameworks.len > 0) {
121 \\ dummy_library.linkLibC();
122 \\ exe.root_module.linkLibrary(dummy_library);
122 \\ result.linkFramework(item, .{});
123 \\ exe.linkFramework(item);
123124 \\ link_lib_c = true;
124125 \\ }
125126 \\ if (link_lib_c) {
126127 \\ result.link_libc = true;
128 \\ exe.linkLibC();
127129 \\ }
128130 \\ self.module_memo = result;
129131 \\ return result;
......@@ -339,6 +341,8 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul
339341 try w.writeAll(" .dependencies =");
340342 try w.writeAll(" &.{");
341343 for (mod.deps, 0..) |moddep, j| {
344 if (moddep.type == .system_lib) continue;
345 if (moddep.type == .framework) continue;
342346 try w.print(" &_{s}", .{moddep.id[0..12]});
343347 if (j != mod.deps.len - 1) try w.writeAll(",");
344348 }
test_repo_all.sh+1
......@@ -6,3 +6,4 @@ set -ex
66./test_repo.sh https://github.com/nektro/zigmod-test-git-dep
77./test_repo.sh https://github.com/nektro/zigmod-test-hg-dep
88./test_repo.sh https://github.com/nektro/zigmod-test-http-dep
9./test_repo.sh https://github.com/nektro/zigmod-test-systemlib-dep