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:...@@ -41,3 +41,4 @@ jobs:
41 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-git-dep41 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-git-dep
42 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-hg-dep42 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-hg-dep
43 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-http-dep43 - 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:...@@ -46,6 +46,7 @@ jobs:
46 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-git-dep46 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-git-dep
47 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-hg-dep47 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-hg-dep
48 - run: ./test_repo.sh https://github.com/nektro/zigmod-test-http-dep48 - 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
50 # Github Release51 # Github Release
51 - run: ./changelog.sh52 - 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...@@ -63,6 +63,10 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
63 \\ const module = pkg.module(exe);63 \\ const module = pkg.module(exe);
64 \\ exe.root_module.addImport(pkg.import.?[0], module);64 \\ exe.root_module.addImport(pkg.import.?[0], module);
65 \\ }65 \\ }
66 \\ for (package_data._root.system_libs) |libname| {
67 \\ exe.linkSystemLibrary(libname);
68 \\ exe.linkLibC();
69 \\ }
66 \\}70 \\}
67 \\71 \\
68 \\var link_lib_c = false;72 \\var link_lib_c = false;
...@@ -82,11 +86,8 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -82,11 +86,8 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
82 \\ return cached;86 \\ return cached;
83 \\ }87 \\ }
84 \\ const b = exe.step.owner;88 \\ const b = exe.step.owner;
85 \\ const result = b.createModule(.{});89 \\ const result = b.createModule(.{
86 \\ const dummy_library = b.addStaticLibrary(.{
87 \\ .name = "dummy",
88 \\ .target = exe.root_module.resolved_target orelse b.host,90 \\ .target = exe.root_module.resolved_target orelse b.host,
89 \\ .optimize = exe.root_module.optimize.?,
90 \\ });91 \\ });
91 \\ if (self.import) |capture| {92 \\ if (self.import) |capture| {
92 \\ result.root_source_file = capture[1];93 \\ result.root_source_file = capture[1];
...@@ -105,25 +106,26 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -105,25 +106,26 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
105 \\ }106 \\ }
106 \\ for (self.c_include_dirs) |item| {107 \\ for (self.c_include_dirs) |item| {
107 \\ result.addIncludePath(b.path(b.fmt("{s}/{s}", .{ self.directory, item })));108 \\ 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 })));
109 \\ link_lib_c = true;110 \\ link_lib_c = true;
110 \\ }111 \\ }
111 \\ for (self.c_source_files) |item| {112 \\ 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;
113 \\ }115 \\ }
114 \\ for (self.system_libs) |item| {116 \\ for (self.system_libs) |item| {
115 \\ dummy_library.linkSystemLibrary(item);117 \\ result.linkSystemLibrary(item, .{});
118 \\ exe.linkSystemLibrary(item);
119 \\ link_lib_c = true;
116 \\ }120 \\ }
117 \\ for (self.frameworks) |item| {121 \\ for (self.frameworks) |item| {
118 \\ dummy_library.linkFramework(item);122 \\ result.linkFramework(item, .{});
119 \\ }123 \\ exe.linkFramework(item);
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);
123 \\ link_lib_c = true;124 \\ link_lib_c = true;
124 \\ }125 \\ }
125 \\ if (link_lib_c) {126 \\ if (link_lib_c) {
126 \\ result.link_libc = true;127 \\ result.link_libc = true;
128 \\ exe.linkLibC();
127 \\ }129 \\ }
128 \\ self.module_memo = result;130 \\ self.module_memo = result;
129 \\ return result;131 \\ return result;
...@@ -339,6 +341,8 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul...@@ -339,6 +341,8 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul
339 try w.writeAll(" .dependencies =");341 try w.writeAll(" .dependencies =");
340 try w.writeAll(" &.{");342 try w.writeAll(" &.{");
341 for (mod.deps, 0..) |moddep, j| {343 for (mod.deps, 0..) |moddep, j| {
344 if (moddep.type == .system_lib) continue;
345 if (moddep.type == .framework) continue;
342 try w.print(" &_{s}", .{moddep.id[0..12]});346 try w.print(" &_{s}", .{moddep.id[0..12]});
343 if (j != mod.deps.len - 1) try w.writeAll(",");347 if (j != mod.deps.len - 1) try w.writeAll(",");
344 }348 }
test_repo_all.sh+1
...@@ -6,3 +6,4 @@ set -ex...@@ -6,3 +6,4 @@ set -ex
6./test_repo.sh https://github.com/nektro/zigmod-test-git-dep6./test_repo.sh https://github.com/nektro/zigmod-test-git-dep
7./test_repo.sh https://github.com/nektro/zigmod-test-hg-dep7./test_repo.sh https://github.com/nektro/zigmod-test-hg-dep
8./test_repo.sh https://github.com/nektro/zigmod-test-http-dep8./test_repo.sh https://github.com/nektro/zigmod-test-http-dep
9./test_repo.sh https://github.com/nektro/zigmod-test-systemlib-dep