diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c6f657f7796719dd1c049b0cd9d9ada86d6e051c..150696e6ad0185a9351c3b6aa17d11b5d88fd754 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -29,12 +29,8 @@ jobs: # Build All - run: ./build_release.sh x86_64-linux-musl - - run: ./build_release.sh x86_64-macos-none - - run: ./build_release.sh x86_64-windows-gnu - run: ./build_release.sh aarch64-linux-musl - - run: ./build_release.sh aarch64-macos-none - - run: ./build_release.sh aarch64-windows-gnu - run: ./build_release.sh riscv64-linux-musl @@ -44,8 +40,6 @@ jobs: - run: ./build_release.sh s390x-linux-musl - - run: ./build_release.sh loongarch64-linux-musl - # Test - run: zigmod version - run: zigmod ci diff --git a/build_all_zig.sh b/build_all_zig.sh index 4ce75e77441ca232ad2468f29bb36a017b7a2f55..8857788a30c3f56de9028fdc3fd7826915f4f031 100755 --- a/build_all_zig.sh +++ b/build_all_zig.sh @@ -6,12 +6,8 @@ zig build targets=" x86_64-linux-musl -x86_64-macos-none -x86_64-windows-gnu aarch64-linux-musl -aarch64-macos-none -aarch64-windows-gnu riscv64-linux-musl @@ -20,8 +16,6 @@ powerpc64le-linux-musl mips64el-linux-muslabi64 s390x-linux-musl - -loongarch64-linux-musl " for item in $targets diff --git a/deps.zig b/deps.zig index b67c59ea9456e7776e5fa2b79bedbedc4175318e..9306b5be5263bf374f8c7026959f99d23ae2fe37 100644 --- a/deps.zig +++ b/deps.zig @@ -54,26 +54,30 @@ pub fn fetch(exe: *std.Build.Step.Compile) *std.Build.Step { const root = if (@field(package_data, decl.name).store) |_| b.cache_root.path.? else "."; if (path.* != null) path.* = b.fmt("{s}/zigmod/deps{s}", .{ root, path.*.? }); } - step.dependOn(&GitExactStep.create(b, "https://github.com/marlersoft/zigwin32", "d21b419d808215e1f82605fdaddc49750bfa3bca").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/arqv-ini", "f1a72055884bd5bc0ffb93ba706c9212139d61b9").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/iguanaTLS", "b0e810ba8508681935ea7a5af857cc197dcdd279").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zfetch", "ec3c02114dec5deff3310b590e69ce0aeb67b95b").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-ansi", "18c6c24d692df31a17f78299c4a539c935d1feb1").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-detect-license", "9b85f69e9adc28ec70a217c07b86046e331d3485").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-extras", "5c4543acadb6c24c05d68f79e4c9d2093457a629").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-git", "b206fa9978ef2cc06bab4d307c7ed07f1f3b88af").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-inquirer", "3bee7b28a37f3d0898119ef095687467fa907d4b").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-intrusive-parser", "eabd7f7b9b8defdbba5504d9ce2c93e1065ca34b").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-json", "92dd6f67bbb52f060d5ac20719142b0211854290").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-leven", "abcde0e877df670f96671bdca5b81b0e809df0d4").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses", "86fc3f6cb4dcc2847832524a3f80d520c7a6577c").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses-text", "a4a66621b3cccdf05e62e0152cf2cd43e9072e97").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-time", "25165db8e626434ab6eae2cff64ba5e72e4fa062").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-tracer", "cc75b7f652c7cd51cbfa6e3c7e8155cd153bb68b").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-yaml", "10e8df67c534e186d851ed48e8895374d9a454e9").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/marlersoft/zigwin32", "ec98bb4d9eea532320a8551720a9e3ec6de64994").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/arqv-ini", "ab427a4de4f875eaa39ee56a29114fc020431546").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/iguanaTLS", "3450aaf3ca47986540e2b0258c2affc45af64ea2").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zfetch", "40d141bf7db81f05a83cce5f2edc4b14e41a5c34").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-ansi", "5f89211a749aef6bf518889c0467ceb24825c055").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-detect-license", "8d553ba6283f778965678ee73b17ae1e2019440d").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-extras", "c2c581aa6a38438dd9ed8da0f59019691c5dd45d").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-git", "70d5ded3d5699c452cb3f4298ee2822cfc0f814e").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-inquirer", "4cddefa42744d61067567b0b36b5d2bb376e5ae3").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-intrusive-parser", "eec3155dc8188b8440cb6097cc436f49511f01cd").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-json", "80e943ac8734b91da3560c8f45bbe702d833ac11").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-leven", "618eddde4ffbc6d34100e4bc6aa654d41161537a").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses", "6b59e45d33a58a5756b2d671a40703f1d110271e").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses-text", "cf0d7f870e85bf4cc35e56532b9e6dd37f9d20dd").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-nfs", "cd5a750bf6d58fa355efe2223c3f9c0626198f13").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-nio", "c50f286c78a4a9704ac3f9fecd7c351e7da89e02").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-sys-linux", "9edefde5fcf96894b6aa4ab60241940bba65debf").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-time", "6e4e3983cea4fe7f705ce6c6606832fca409a4c7").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-tracer", "b2c23066c0431542cbc97aedadd9c8890c298e7b").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-yaml", "54fd85b458b7cf1b81ebe6503d61ca82804d1db6").step); step.dependOn(&GitExactStep.create(b, "https://github.com/truemedian/hzzp", "ab212bd208f0eb54d85861679677c5e3dc9bb543").step); - step.dependOn(&GitExactStep.create(b, "https://github.com/ziglibs/known-folders", "aa24df42183ad415d10bc0a33e6238c437fc0f59").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/madler/zlib", "da607da739fa6047df13e66a2af6b8bec7c2a498").step); step.dependOn(&GitExactStep.create(b, "https://github.com/yaml/libyaml", "2c891fc7a770e8ba2fec34fc6b545c672beb37e6").step); + step.dependOn(&GitExactStep.create(b, "https://github.com/ziglibs/known-folders", "aa24df42183ad415d10bc0a33e6238c437fc0f59").step); return step; } @@ -120,13 +124,17 @@ pub const Package = struct { } const b = exe.step.owner; - const result = b.createModule(.{}); + const result = b.createModule(.{ + .target = exe.root_module.resolved_target, + }); + const target = result.resolved_target.?.result; const dummy_library = b.addStaticLibrary(.{ - .name = "dummy", + .name = b.fmt("dummy-{s}", .{self.name}), .target = exe.root_module.resolved_target orelse b.graph.host, .optimize = exe.root_module.optimize.?, }); dummy_library.step.dependOn(fetch_step); + var links: u32 = 0; if (self.entry) |capture| { result.root_source_file = .{ .cwd_relative = capture }; } @@ -146,17 +154,22 @@ pub const Package = struct { result.addIncludePath(.{ .cwd_relative = b.fmt("{s}/zigmod/deps{s}/{s}", .{ b.cache_root.path.?, self.store.?, item }) }); dummy_library.addIncludePath(.{ .cwd_relative = b.fmt("{s}/zigmod/deps{s}/{s}", .{ b.cache_root.path.?, self.store.?, item }) }); link_lib_c = true; + links += 1; } for (self.c_source_files) |item| { dummy_library.addCSourceFile(.{ .file = .{ .cwd_relative = b.fmt("{s}/zigmod/deps{s}/{s}", .{ b.cache_root.path.?, self.store.?, item }) }, .flags = self.c_source_flags }); + links += 1; } for (self.system_libs) |item| { + if (std.zig.target.isLibCLibName(target, item)) continue; dummy_library.linkSystemLibrary(item); + links += 1; } for (self.frameworks) |item| { dummy_library.linkFramework(item); + links += 1; } - if (self.c_source_files.len > 0 or self.system_libs.len > 0 or self.frameworks.len > 0) { + if (links > 0) { dummy_library.linkLibC(); exe.root_module.linkLibrary(dummy_library); link_lib_c = true; @@ -176,92 +189,112 @@ fn checkMinZig(current: std.SemanticVersion, exe: *std.Build.Step.Compile) void pub const package_data = struct { pub var _o6ogpor87xc2 = Package{ - .store = "/git/github.com/marlersoft/zigwin32/d21b419d808215e1f82605fdaddc49750bfa3bca", + .store = "/git/github.com/marlersoft/zigwin32/ec98bb4d9eea532320a8551720a9e3ec6de64994", .name = "win32", - .entry = "/git/github.com/marlersoft/zigwin32/d21b419d808215e1f82605fdaddc49750bfa3bca/win32.zig", + .entry = "/git/github.com/marlersoft/zigwin32/ec98bb4d9eea532320a8551720a9e3ec6de64994/win32.zig", }; pub var _u7sysdckdymi = Package{ - .store = "/git/github.com/nektro/arqv-ini/f1a72055884bd5bc0ffb93ba706c9212139d61b9", + .store = "/git/github.com/nektro/arqv-ini/ab427a4de4f875eaa39ee56a29114fc020431546", .name = "ini", - .entry = "/git/github.com/nektro/arqv-ini/f1a72055884bd5bc0ffb93ba706c9212139d61b9/src/ini.zig", + .entry = "/git/github.com/nektro/arqv-ini/ab427a4de4f875eaa39ee56a29114fc020431546/src/ini.zig", }; pub var _csbnipaad8n7 = Package{ - .store = "/git/github.com/nektro/iguanaTLS/b0e810ba8508681935ea7a5af857cc197dcdd279", + .store = "/git/github.com/nektro/iguanaTLS/3450aaf3ca47986540e2b0258c2affc45af64ea2", .name = "iguanaTLS", - .entry = "/git/github.com/nektro/iguanaTLS/b0e810ba8508681935ea7a5af857cc197dcdd279/src/main.zig", + .entry = "/git/github.com/nektro/iguanaTLS/3450aaf3ca47986540e2b0258c2affc45af64ea2/src/main.zig", }; pub var _s84v9o48ucb0 = Package{ - .store = "/git/github.com/nektro/zig-ansi/18c6c24d692df31a17f78299c4a539c935d1feb1", + .store = "/git/github.com/nektro/zig-ansi/5f89211a749aef6bf518889c0467ceb24825c055", .name = "ansi", - .entry = "/git/github.com/nektro/zig-ansi/18c6c24d692df31a17f78299c4a539c935d1feb1/src/lib.zig", + .entry = "/git/github.com/nektro/zig-ansi/5f89211a749aef6bf518889c0467ceb24825c055/src/lib.zig", }; pub var _f7dubzb7cyqe = Package{ - .store = "/git/github.com/nektro/zig-extras/5c4543acadb6c24c05d68f79e4c9d2093457a629", + .store = "/git/github.com/nektro/zig-extras/c2c581aa6a38438dd9ed8da0f59019691c5dd45d", .name = "extras", - .entry = "/git/github.com/nektro/zig-extras/5c4543acadb6c24c05d68f79e4c9d2093457a629/src/lib.zig", + .entry = "/git/github.com/nektro/zig-extras/c2c581aa6a38438dd9ed8da0f59019691c5dd45d/src/lib.zig", }; pub var _c1xirp1ota5p = Package{ - .store = "/git/github.com/nektro/zig-inquirer/3bee7b28a37f3d0898119ef095687467fa907d4b", + .store = "/git/github.com/nektro/zig-inquirer/4cddefa42744d61067567b0b36b5d2bb376e5ae3", .name = "inquirer", - .entry = "/git/github.com/nektro/zig-inquirer/3bee7b28a37f3d0898119ef095687467fa907d4b/src/lib.zig", + .entry = "/git/github.com/nektro/zig-inquirer/4cddefa42744d61067567b0b36b5d2bb376e5ae3/src/lib.zig", .deps = &[_]*Package{ &_s84v9o48ucb0 }, }; - pub var _7l3oxw6nqqws = Package{ - .store = "/git/github.com/nektro/zig-intrusive-parser/eabd7f7b9b8defdbba5504d9ce2c93e1065ca34b", - .name = "intrusive-parser", - .entry = "/git/github.com/nektro/zig-intrusive-parser/eabd7f7b9b8defdbba5504d9ce2c93e1065ca34b/intrusive_parser.zig", - .deps = &[_]*Package{ &_f7dubzb7cyqe }, - }; pub var _96h80ezrvj7i = Package{ - .store = "/git/github.com/nektro/zig-leven/abcde0e877df670f96671bdca5b81b0e809df0d4", + .store = "/git/github.com/nektro/zig-leven/618eddde4ffbc6d34100e4bc6aa654d41161537a", .name = "leven", - .entry = "/git/github.com/nektro/zig-leven/abcde0e877df670f96671bdca5b81b0e809df0d4/src/lib.zig", + .entry = "/git/github.com/nektro/zig-leven/618eddde4ffbc6d34100e4bc6aa654d41161537a/src/lib.zig", }; pub var _0npcrzfdlrvk = Package{ - .store = "/git/github.com/nektro/zig-licenses/86fc3f6cb4dcc2847832524a3f80d520c7a6577c", + .store = "/git/github.com/nektro/zig-licenses/6b59e45d33a58a5756b2d671a40703f1d110271e", .name = "licenses", - .entry = "/git/github.com/nektro/zig-licenses/86fc3f6cb4dcc2847832524a3f80d520c7a6577c/src/lib.zig", + .entry = "/git/github.com/nektro/zig-licenses/6b59e45d33a58a5756b2d671a40703f1d110271e/src/lib.zig", }; - pub var _pt88y5d80m25 = Package{ - .store = "/git/github.com/nektro/zig-licenses-text/a4a66621b3cccdf05e62e0152cf2cd43e9072e97", - .name = "licenses-text", - .entry = "/git/github.com/nektro/zig-licenses-text/a4a66621b3cccdf05e62e0152cf2cd43e9072e97/src/lib.zig", + pub var _h7tv7ayhffak = Package{ + .store = "/git/github.com/nektro/zig-sys-linux/9edefde5fcf96894b6aa4ab60241940bba65debf", + .name = "sys-linux", + .entry = "/git/github.com/nektro/zig-sys-linux/9edefde5fcf96894b6aa4ab60241940bba65debf/mod.zig", + .deps = &[_]*Package{ }, + .system_libs = &.{ "c" }, }; - pub var _2ovav391ivak = Package{ - .store = "/git/github.com/nektro/zig-detect-license/9b85f69e9adc28ec70a217c07b86046e331d3485", - .name = "detect-license", - .entry = "/git/github.com/nektro/zig-detect-license/9b85f69e9adc28ec70a217c07b86046e331d3485/src/lib.zig", - .deps = &[_]*Package{ &_pt88y5d80m25, &_96h80ezrvj7i }, + pub var _kscsl0145t7x = Package{ + .store = "/git/github.com/nektro/zig-nio/c50f286c78a4a9704ac3f9fecd7c351e7da89e02", + .name = "nio", + .entry = "/git/github.com/nektro/zig-nio/c50f286c78a4a9704ac3f9fecd7c351e7da89e02/nio.zig", + .deps = &[_]*Package{ &_h7tv7ayhffak, &_f7dubzb7cyqe }, + }; + pub var _7l3oxw6nqqws = Package{ + .store = "/git/github.com/nektro/zig-intrusive-parser/eec3155dc8188b8440cb6097cc436f49511f01cd", + .name = "intrusive-parser", + .entry = "/git/github.com/nektro/zig-intrusive-parser/eec3155dc8188b8440cb6097cc436f49511f01cd/intrusive_parser.zig", + .deps = &[_]*Package{ &_f7dubzb7cyqe, &_kscsl0145t7x }, }; pub var _iecwp4b3bsfm = Package{ - .store = "/git/github.com/nektro/zig-time/25165db8e626434ab6eae2cff64ba5e72e4fa062", + .store = "/git/github.com/nektro/zig-time/6e4e3983cea4fe7f705ce6c6606832fca409a4c7", .name = "time", - .entry = "/git/github.com/nektro/zig-time/25165db8e626434ab6eae2cff64ba5e72e4fa062/time.zig", - .deps = &[_]*Package{ &_f7dubzb7cyqe }, + .entry = "/git/github.com/nektro/zig-time/6e4e3983cea4fe7f705ce6c6606832fca409a4c7/time.zig", + .deps = &[_]*Package{ &_f7dubzb7cyqe, &_h7tv7ayhffak }, + }; + pub var _vph9l0hxpeze = Package{ + .store = "/git/github.com/nektro/zig-nfs/cd5a750bf6d58fa355efe2223c3f9c0626198f13", + .name = "nfs", + .entry = "/git/github.com/nektro/zig-nfs/cd5a750bf6d58fa355efe2223c3f9c0626198f13/nfs.zig", + .deps = &[_]*Package{ &_h7tv7ayhffak, &_kscsl0145t7x, &_iecwp4b3bsfm }, }; pub var _ede2wygpe1iy = Package{ - .store = "/git/github.com/nektro/zig-tracer/cc75b7f652c7cd51cbfa6e3c7e8155cd153bb68b", + .store = "/git/github.com/nektro/zig-tracer/b2c23066c0431542cbc97aedadd9c8890c298e7b", .name = "tracer", - .entry = "/git/github.com/nektro/zig-tracer/cc75b7f652c7cd51cbfa6e3c7e8155cd153bb68b/src/mod.zig", - .deps = &[_]*Package{ &_f7dubzb7cyqe }, + .entry = "/git/github.com/nektro/zig-tracer/b2c23066c0431542cbc97aedadd9c8890c298e7b/src/mod.zig", + .deps = &[_]*Package{ &_f7dubzb7cyqe, &_h7tv7ayhffak, &_vph9l0hxpeze, &_kscsl0145t7x, &_iecwp4b3bsfm }, }; pub var _0k64oe2nuzvj = Package{ - .store = "/git/github.com/nektro/zig-git/b206fa9978ef2cc06bab4d307c7ed07f1f3b88af", + .store = "/git/github.com/nektro/zig-git/70d5ded3d5699c452cb3f4298ee2822cfc0f814e", .name = "git", - .entry = "/git/github.com/nektro/zig-git/b206fa9978ef2cc06bab4d307c7ed07f1f3b88af/git.zig", - .deps = &[_]*Package{ &_iecwp4b3bsfm, &_f7dubzb7cyqe, &_ede2wygpe1iy }, + .entry = "/git/github.com/nektro/zig-git/70d5ded3d5699c452cb3f4298ee2822cfc0f814e/git.zig", + .deps = &[_]*Package{ &_iecwp4b3bsfm, &_f7dubzb7cyqe, &_ede2wygpe1iy, &_vph9l0hxpeze, &_kscsl0145t7x, &_0e2d06bb494b }, }; pub var _ocmr9rtohgcc = Package{ - .store = "/git/github.com/nektro/zig-json/92dd6f67bbb52f060d5ac20719142b0211854290", + .store = "/git/github.com/nektro/zig-json/80e943ac8734b91da3560c8f45bbe702d833ac11", .name = "json", - .entry = "/git/github.com/nektro/zig-json/92dd6f67bbb52f060d5ac20719142b0211854290/json.zig", - .deps = &[_]*Package{ &_f7dubzb7cyqe, &_ede2wygpe1iy, &_7l3oxw6nqqws }, + .entry = "/git/github.com/nektro/zig-json/80e943ac8734b91da3560c8f45bbe702d833ac11/json.zig", + .deps = &[_]*Package{ &_f7dubzb7cyqe, &_ede2wygpe1iy, &_7l3oxw6nqqws, &_kscsl0145t7x }, + }; + pub var _pt88y5d80m25 = Package{ + .store = "/git/github.com/nektro/zig-licenses-text/cf0d7f870e85bf4cc35e56532b9e6dd37f9d20dd", + .name = "licenses-text", + .entry = "/git/github.com/nektro/zig-licenses-text/cf0d7f870e85bf4cc35e56532b9e6dd37f9d20dd/src/lib.zig", + .deps = &[_]*Package{ &_ocmr9rtohgcc }, + }; + pub var _2ovav391ivak = Package{ + .store = "/git/github.com/nektro/zig-detect-license/8d553ba6283f778965678ee73b17ae1e2019440d", + .name = "detect-license", + .entry = "/git/github.com/nektro/zig-detect-license/8d553ba6283f778965678ee73b17ae1e2019440d/src/lib.zig", + .deps = &[_]*Package{ &_pt88y5d80m25, &_96h80ezrvj7i }, }; pub var _g982zq6e8wsv = Package{ - .store = "/git/github.com/nektro/zig-yaml/10e8df67c534e186d851ed48e8895374d9a454e9", + .store = "/git/github.com/nektro/zig-yaml/54fd85b458b7cf1b81ebe6503d61ca82804d1db6", .name = "yaml", - .entry = "/git/github.com/nektro/zig-yaml/10e8df67c534e186d851ed48e8895374d9a454e9/yaml.zig", - .deps = &[_]*Package{ &_8mdbh0zuneb0, &_f7dubzb7cyqe }, + .entry = "/git/github.com/nektro/zig-yaml/54fd85b458b7cf1b81ebe6503d61ca82804d1db6/yaml.zig", + .deps = &[_]*Package{ &_8mdbh0zuneb0 }, }; pub var _9k24gimke1an = Package{ .store = "/git/github.com/truemedian/hzzp/ab212bd208f0eb54d85861679677c5e3dc9bb543", @@ -269,11 +302,23 @@ pub const package_data = struct { .entry = "/git/github.com/truemedian/hzzp/ab212bd208f0eb54d85861679677c5e3dc9bb543/src/main.zig", }; pub var _ejw82j2ipa0e = Package{ - .store = "/git/github.com/nektro/zfetch/ec3c02114dec5deff3310b590e69ce0aeb67b95b", + .store = "/git/github.com/nektro/zfetch/40d141bf7db81f05a83cce5f2edc4b14e41a5c34", .name = "zfetch", - .entry = "/git/github.com/nektro/zfetch/ec3c02114dec5deff3310b590e69ce0aeb67b95b/src/main.zig", + .entry = "/git/github.com/nektro/zfetch/40d141bf7db81f05a83cce5f2edc4b14e41a5c34/src/main.zig", .deps = &[_]*Package{ &_9k24gimke1an, &_csbnipaad8n7 }, }; + pub var _0e2d06bb494b = Package{ + .store = "/git/github.com/madler/zlib/da607da739fa6047df13e66a2af6b8bec7c2a498", + .c_include_dirs = &.{ "" }, + .c_source_files = &.{ "inftrees.c", "inflate.c", "adler32.c", "zutil.c", "trees.c", "gzclose.c", "gzwrite.c", "gzread.c", "deflate.c", "compress.c", "crc32.c", "infback.c", "gzlib.c", "uncompr.c", "inffast.c" }, + .c_source_flags = &.{ "-DZ_HAVE_UNISTD_H=1" }, + }; + pub var _8mdbh0zuneb0 = Package{ + .store = "/git/github.com/yaml/libyaml/2c891fc7a770e8ba2fec34fc6b545c672beb37e6", + .c_include_dirs = &.{ "include" }, + .c_source_files = &.{ "src/api.c", "src/dumper.c", "src/emitter.c", "src/loader.c", "src/parser.c", "src/reader.c", "src/scanner.c", "src/writer.c" }, + .c_source_flags = &.{ "-DYAML_VERSION_MAJOR=0", "-DYAML_VERSION_MINOR=2", "-DYAML_VERSION_PATCH=5", "-DYAML_VERSION_STRING=\"0.2.5\"", "-DYAML_DECLARE_STATIC=1" }, + }; pub var _2ta738wrqbaq = Package{ .store = "/git/github.com/ziglibs/known-folders/aa24df42183ad415d10bc0a33e6238c437fc0f59", .name = "known-folders", @@ -282,16 +327,10 @@ pub const package_data = struct { pub var _89ujp8gq842x = Package{ .name = "zigmod", .entry = "/../..//src/lib.zig", - .deps = &[_]*Package{ &_g982zq6e8wsv, &_s84v9o48ucb0, &_2ta738wrqbaq, &_0npcrzfdlrvk, &_ejw82j2ipa0e, &_2ovav391ivak, &_c1xirp1ota5p, &_u7sysdckdymi, &_iecwp4b3bsfm, &_f7dubzb7cyqe, &_0k64oe2nuzvj, &_ocmr9rtohgcc }, + .deps = &[_]*Package{ &_g982zq6e8wsv, &_s84v9o48ucb0, &_2ta738wrqbaq, &_0npcrzfdlrvk, &_ejw82j2ipa0e, &_2ovav391ivak, &_c1xirp1ota5p, &_u7sysdckdymi, &_iecwp4b3bsfm, &_f7dubzb7cyqe, &_0k64oe2nuzvj, &_ocmr9rtohgcc, &_kscsl0145t7x, &_vph9l0hxpeze }, }; pub var _root = Package{ }; - pub var _8mdbh0zuneb0 = Package{ - .store = "/git/github.com/yaml/libyaml/2c891fc7a770e8ba2fec34fc6b545c672beb37e6", - .c_include_dirs = &.{ "include" }, - .c_source_files = &.{ "src/api.c", "src/dumper.c", "src/emitter.c", "src/loader.c", "src/parser.c", "src/reader.c", "src/scanner.c", "src/writer.c" }, - .c_source_flags = &.{ "-DYAML_VERSION_MAJOR=0", "-DYAML_VERSION_MINOR=2", "-DYAML_VERSION_PATCH=5", "-DYAML_VERSION_STRING=\"0.2.5\"", "-DYAML_DECLARE_STATIC=1" }, - }; }; pub const packages = [_]*Package{ diff --git a/licenses.txt b/licenses.txt index 0cac1fe1c87f4684b1e191e9ee7740a4b6526f2f..c3bf00cf7e15bfec81cc53c3e2b2e7fa3bf196c2 100644 --- a/licenses.txt +++ b/licenses.txt @@ -8,19 +8,29 @@ MIT: - git https://github.com/nektro/zig-ansi - git https://github.com/nektro/zig-detect-license - git https://github.com/nektro/zig-extras -- git https://github.com/nektro/zig-git - git https://github.com/nektro/zig-inquirer - git https://github.com/nektro/zig-json - git https://github.com/nektro/zig-leven - git https://github.com/nektro/zig-licenses - git https://github.com/nektro/zig-licenses-text +- git https://github.com/nektro/zig-sys-linux - git https://github.com/nektro/zig-time - git https://github.com/nektro/zig-tracer - git https://github.com/nektro/zig-yaml - git https://github.com/truemedian/hzzp -- git https://github.com/ziglibs/known-folders - git https://github.com/yaml/libyaml +- git https://github.com/ziglibs/known-folders MPL-2.0: = https://spdx.org/licenses/MPL-2.0 +- git https://github.com/nektro/zig-git - git https://github.com/nektro/zig-intrusive-parser +- git https://github.com/nektro/zig-nfs +- git https://github.com/nektro/zig-nio + +Zlib: += https://spdx.org/licenses/Zlib +- git https://github.com/madler/zlib + +Unspecified: +- system_lib c diff --git a/src/cmd/generate.zig b/src/cmd/generate.zig index e9bd29c948d85222f14c0e1710d97066c59e73fd..ad6a6a23958bc9aa8255a772620fc74a89cf57f9 100644 --- a/src/cmd/generate.zig +++ b/src/cmd/generate.zig @@ -157,13 +157,17 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D \\ } \\ const b = exe.step.owner; \\ - \\ const result = b.createModule(.{}); + \\ const result = b.createModule(.{ + \\ .target = exe.root_module.resolved_target, + \\ }); + \\ const target = result.resolved_target.?.result; \\ const dummy_library = b.addStaticLibrary(.{ - \\ .name = "dummy", + \\ .name = b.fmt("dummy-{s}", .{self.name}), \\ .target = exe.root_module.resolved_target orelse b.graph.host, \\ .optimize = exe.root_module.optimize.?, \\ }); \\ dummy_library.step.dependOn(fetch_step); + \\ var links: u32 = 0; \\ if (self.entry) |capture| { \\ result.root_source_file = .{ .cwd_relative = capture }; \\ } @@ -183,17 +187,22 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D \\ result.addIncludePath(.{ .cwd_relative = b.fmt("{s}/zigmod/deps{s}/{s}", .{ b.cache_root.path.?, self.store.?, item }) }); \\ dummy_library.addIncludePath(.{ .cwd_relative = b.fmt("{s}/zigmod/deps{s}/{s}", .{ b.cache_root.path.?, self.store.?, item }) }); \\ link_lib_c = true; + \\ links += 1; \\ } \\ for (self.c_source_files) |item| { \\ dummy_library.addCSourceFile(.{ .file = .{ .cwd_relative = b.fmt("{s}/zigmod/deps{s}/{s}", .{ b.cache_root.path.?, self.store.?, item }) }, .flags = self.c_source_flags }); + \\ links += 1; \\ } \\ for (self.system_libs) |item| { + \\ if (std.zig.target.isLibCLibName(target, item)) continue; \\ dummy_library.linkSystemLibrary(item); + \\ links += 1; \\ } \\ for (self.frameworks) |item| { \\ dummy_library.linkFramework(item); + \\ links += 1; \\ } - \\ if (self.c_source_files.len > 0 or self.system_libs.len > 0 or self.frameworks.len > 0) { + \\ if (links > 0) { \\ dummy_library.linkLibC(); \\ exe.root_module.linkLibrary(dummy_library); \\ link_lib_c = true; diff --git a/src/cmd/zpm.zig b/src/cmd/zpm.zig index 1b51ea9eb86aa34490dc1bfe1627930b61b5db36..4a3cda5bd5cc137a6d8b73808c83150e98dfe432 100644 --- a/src/cmd/zpm.zig +++ b/src/cmd/zpm.zig @@ -4,6 +4,7 @@ const gpa = std.heap.c_allocator; const zfetch = @import("zfetch"); const extras = @import("extras"); const json = @import("json"); +const nio = @import("nio"); const u = @import("./../util/funcs.zig"); @@ -60,7 +61,7 @@ pub fn server_fetch(url: string) !json.Document { const req = try zfetch.Request.init(gpa, url, null); defer req.deinit(); try req.do(.GET, null, null); - return json.parse(gpa, "", req.reader(), .{ .support_trailing_commas = true, .maximum_depth = 100 }); + return json.parse(gpa, "", nio.AnyReadable.fromStd(&req.reader()), .{ .support_trailing_commas = true, .maximum_depth = 100 }); } pub fn server_fetchArray(url: string) ![]const Package { diff --git a/src/util/funcs.zig b/src/util/funcs.zig index e194338494b5cd204b0d91a31bbd4f034dda4d16..5fa5824f774785be93ac9078840bdcd6aab80427 100644 --- a/src/util/funcs.zig +++ b/src/util/funcs.zig @@ -4,6 +4,7 @@ const gpa = std.heap.c_allocator; const extras = @import("extras"); const git = @import("git"); const ansi = @import("ansi"); +const nfs = @import("nfs"); // // @@ -144,7 +145,8 @@ pub fn do_hash(comptime algo: type, data: string) ![algo.digest_length * 2]u8 { /// Returns the result of running `git rev-parse HEAD` pub fn git_rev_HEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !string { - var dirg = try dir.openDir(".git", .{}); + const ndir: nfs.Dir = .{ .fd = @enumFromInt(dir.fd) }; + var dirg = try ndir.openDir(".git", .{}); defer dirg.close(); const commitid = try git.getHEAD(alloc, dirg); return if (commitid) |_| commitid.?.id else error.NotAGitRepo; diff --git a/src/util/module.zig b/src/util/module.zig index b56434ca423ef12250b4bae3e139f7cfb0b358c2..9f1a1f154643bf4781014fa646e80f14995c1c31 100644 --- a/src/util/module.zig +++ b/src/util/module.zig @@ -182,7 +182,7 @@ pub const Module = struct { const cpath = extras.trimPrefixEnsure(self.clean_path, "v/") orelse return err; var iter = std.mem.splitScalar(u8, cpath, '/'); while (iter.next()) |segment| { - if (iter.peek() == null) return segment; + if (iter.peek() == null) return extras.trimPrefixEnsure(segment, "commit-") orelse return err; } unreachable; }, diff --git a/zig.mod b/zig.mod index a16f0a970f5c3c77e209531a3c15fc31555117ea..4214c5dad32dddd532a7942768f595ce48fd6571 100644 --- a/zig.mod +++ b/zig.mod @@ -13,6 +13,7 @@ dependencies: name: known-folders main: known-folders.zig license: MIT + version: commit-aa24df42183ad415d10bc0a33e6238c437fc0f59 - src: git https://github.com/nektro/zig-licenses - src: git https://github.com/nektro/zfetch - src: git https://github.com/nektro/zig-detect-license @@ -22,6 +23,8 @@ dependencies: - src: git https://github.com/nektro/zig-extras - src: git https://github.com/nektro/zig-git - src: git https://github.com/nektro/zig-json + - src: git https://github.com/nektro/zig-nio + - src: git https://github.com/nektro/zig-nfs root_dependencies: - src: git https://github.com/marlersoft/zigwin32 diff --git a/zigmod.lock b/zigmod.lock index 7eee7f164ffb6c188923ab0b3759ead1dc087d26..6b756838e3e0eeb2445360c45cb1dc1a075e02fc 100644 --- a/zigmod.lock +++ b/zigmod.lock @@ -1,21 +1,25 @@ 2 -git https://github.com/marlersoft/zigwin32 commit-d21b419d808215e1f82605fdaddc49750bfa3bca -git https://github.com/nektro/arqv-ini commit-f1a72055884bd5bc0ffb93ba706c9212139d61b9 -git https://github.com/nektro/iguanaTLS commit-b0e810ba8508681935ea7a5af857cc197dcdd279 -git https://github.com/nektro/zfetch commit-ec3c02114dec5deff3310b590e69ce0aeb67b95b -git https://github.com/nektro/zig-ansi commit-18c6c24d692df31a17f78299c4a539c935d1feb1 -git https://github.com/nektro/zig-detect-license commit-9b85f69e9adc28ec70a217c07b86046e331d3485 -git https://github.com/nektro/zig-extras commit-5c4543acadb6c24c05d68f79e4c9d2093457a629 -git https://github.com/nektro/zig-git commit-b206fa9978ef2cc06bab4d307c7ed07f1f3b88af -git https://github.com/nektro/zig-inquirer commit-3bee7b28a37f3d0898119ef095687467fa907d4b -git https://github.com/nektro/zig-intrusive-parser commit-eabd7f7b9b8defdbba5504d9ce2c93e1065ca34b -git https://github.com/nektro/zig-json commit-92dd6f67bbb52f060d5ac20719142b0211854290 -git https://github.com/nektro/zig-leven commit-abcde0e877df670f96671bdca5b81b0e809df0d4 -git https://github.com/nektro/zig-licenses commit-86fc3f6cb4dcc2847832524a3f80d520c7a6577c -git https://github.com/nektro/zig-licenses-text commit-a4a66621b3cccdf05e62e0152cf2cd43e9072e97 -git https://github.com/nektro/zig-time commit-25165db8e626434ab6eae2cff64ba5e72e4fa062 -git https://github.com/nektro/zig-tracer commit-cc75b7f652c7cd51cbfa6e3c7e8155cd153bb68b -git https://github.com/nektro/zig-yaml commit-10e8df67c534e186d851ed48e8895374d9a454e9 +git https://github.com/marlersoft/zigwin32 commit-ec98bb4d9eea532320a8551720a9e3ec6de64994 +git https://github.com/nektro/arqv-ini commit-ab427a4de4f875eaa39ee56a29114fc020431546 +git https://github.com/nektro/iguanaTLS commit-3450aaf3ca47986540e2b0258c2affc45af64ea2 +git https://github.com/nektro/zfetch commit-40d141bf7db81f05a83cce5f2edc4b14e41a5c34 +git https://github.com/nektro/zig-ansi commit-5f89211a749aef6bf518889c0467ceb24825c055 +git https://github.com/nektro/zig-detect-license commit-8d553ba6283f778965678ee73b17ae1e2019440d +git https://github.com/nektro/zig-extras commit-c2c581aa6a38438dd9ed8da0f59019691c5dd45d +git https://github.com/nektro/zig-git commit-70d5ded3d5699c452cb3f4298ee2822cfc0f814e +git https://github.com/nektro/zig-inquirer commit-4cddefa42744d61067567b0b36b5d2bb376e5ae3 +git https://github.com/nektro/zig-intrusive-parser commit-eec3155dc8188b8440cb6097cc436f49511f01cd +git https://github.com/nektro/zig-json commit-80e943ac8734b91da3560c8f45bbe702d833ac11 +git https://github.com/nektro/zig-leven commit-618eddde4ffbc6d34100e4bc6aa654d41161537a +git https://github.com/nektro/zig-licenses commit-6b59e45d33a58a5756b2d671a40703f1d110271e +git https://github.com/nektro/zig-licenses-text commit-cf0d7f870e85bf4cc35e56532b9e6dd37f9d20dd +git https://github.com/nektro/zig-nfs commit-cd5a750bf6d58fa355efe2223c3f9c0626198f13 +git https://github.com/nektro/zig-nio commit-c50f286c78a4a9704ac3f9fecd7c351e7da89e02 +git https://github.com/nektro/zig-sys-linux commit-9edefde5fcf96894b6aa4ab60241940bba65debf +git https://github.com/nektro/zig-time commit-6e4e3983cea4fe7f705ce6c6606832fca409a4c7 +git https://github.com/nektro/zig-tracer commit-b2c23066c0431542cbc97aedadd9c8890c298e7b +git https://github.com/nektro/zig-yaml commit-54fd85b458b7cf1b81ebe6503d61ca82804d1db6 git https://github.com/truemedian/hzzp commit-ab212bd208f0eb54d85861679677c5e3dc9bb543 -git https://github.com/ziglibs/known-folders commit-aa24df42183ad415d10bc0a33e6238c437fc0f59 +git https://github.com/madler/zlib tag-v1.3.2 git https://github.com/yaml/libyaml tag-0.2.5 +git https://github.com/ziglibs/known-folders commit-aa24df42183ad415d10bc0a33e6238c437fc0f59