diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index bac17db..608abc6 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -31,7 +31,7 @@ jobs: # Zig - uses: goto-bus-stop/setup-zig@v1 with: - version: "0.10.0-dev.2981+7090f0471" + version: "0.10.0-dev.3316+a0d3a87ce" - run: zig version - run: zig cc --version - run: zig env @@ -44,6 +44,9 @@ jobs: - run: ./build_release.sh aarch64-linux-musl - run: ./build_release.sh riscv64-linux-musl - run: ./build_release.sh powerpc64-linux-musl + # - run: ./build_release.sh s390x-linux-musl # https://github.com/ziglang/zig/issues/9442 + # - run: ./build_release.sh mips64-linux-musl # error: container 'std.os.linux.arch_bits' has no member called 'syscall3' + # - run: ./build_release.sh sparc64-linux-musl # error: unable to find or provide libc for target 'sparc64-linux.3.16...5.10.81-musl' # Github Release - run: ./changelog.sh diff --git a/.github/workflows/zig.yml b/.github/workflows/zig.yml index 7afc6b6..5bda4eb 100644 --- a/.github/workflows/zig.yml +++ b/.github/workflows/zig.yml @@ -14,7 +14,7 @@ jobs: - name: Setup Zig uses: goto-bus-stop/setup-zig@v1 with: - version: "0.10.0-dev.2981+7090f0471" + version: "0.10.0-dev.3316+a0d3a87ce" - run: zig version - run: zig cc --version diff --git a/README.md b/README.md index ebbf2b6..40a5ea2 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ $ zig build ``` ## Built With -- Zig master (at least `0.10.0-dev.2802+54454fd01`) +- Zig master (at least `0.10.0-dev.3316+a0d3a87ce`) - See [`zigmod.yml`](./zigmod.yml) and [`zigmod.lock`](./zigmod.lock) ## License diff --git a/src/handler/do_import.zig b/src/handler/do_import.zig index 0c3dc5f..c59db07 100644 --- a/src/handler/do_import.zig +++ b/src/handler/do_import.zig @@ -46,10 +46,10 @@ pub fn get(_: void, response: *http.Response, request: http.Request, captures: ? try ox.assert(result1.term == .Exited, response, .bad_request, "error: executing git clone failed: {}", .{result1.term}); try ox.assert(result1.term.Exited == 0, response, .bad_request, "error: executing tar failed with exit code: {d}\n{s}", .{ result1.term.Exited, result1.stderr }); - var dir = try std.fs.cwd().openDir(path, .{ .iterate = true }); + var dir = try std.fs.cwd().openIterableDir(path, .{}); defer dir.close(); - const modfile = zigmod.ModFile.from_dir(alloc, dir) catch |err| return ox.fail(response, .bad_request, "error: parsing zig.mod failed: {s}", .{@errorName(err)}); + const modfile = zigmod.ModFile.from_dir(alloc, dir.dir) catch |err| return ox.fail(response, .bad_request, "error: parsing zig.mod failed: {s}", .{@errorName(err)}); const name = modfile.name; const license = modfile.yaml.get_string("license"); const mdesc = modfile.yaml.get("description"); @@ -58,15 +58,15 @@ pub fn get(_: void, response: *http.Response, request: http.Request, captures: ? const rootdeps = modfile.rootdeps; const builddeps = modfile.builddeps; - const commit = try git.getHEAD(alloc, dir); - try dir.deleteTree(".git"); + const commit = try git.getHEAD(alloc, dir.dir); + try dir.dir.deleteTree(".git"); const unpackedsize = try extras.dirSize(alloc, dir); const cachepath = try std.fs.path.join(alloc, &.{ path, ".zigmod", "deps" }); - zigmod.commands.ci.do(alloc, cachepath, dir) catch |err| return ox.fail(response, .internal_server_error, "error: zigmod ci failed: {s}", .{@errorName(err)}); - try dir.deleteFile("deps.zig"); + zigmod.commands.ci.do(alloc, cachepath, dir.dir) catch |err| return ox.fail(response, .internal_server_error, "error: zigmod ci failed: {s}", .{@errorName(err)}); + try dir.dir.deleteFile("deps.zig"); const totalsize = try extras.dirSize(alloc, dir); - try dir.deleteTree(".zigmod"); + try dir.dir.deleteTree(".zigmod"); const filelist = try extras.fileList(alloc, dir); try ox.assert(filelist.len > 0, response, .internal_server_error, "error: found no files in repo", .{}); @@ -95,7 +95,7 @@ pub fn get(_: void, response: *http.Response, request: http.Request, captures: ? try _internal.rename(tarpath, destpath); const tarsize = try extras.fileSize(std.fs.cwd(), destpath); const tarhash = try extras.hashFile(alloc, std.fs.cwd(), destpath, .sha256); - const readme = (_internal.readFileContents(dir, alloc, "README.md") catch null) orelse ""; + const readme = (_internal.readFileContents(dir.dir, alloc, "README.md") catch null) orelse ""; var p = try db.Package.create(alloc, u, name, r, details.id, repo, desc, license, details.star_count, details.clone_url); var v = try db.Version.create(alloc, p, commit, unpackedsize, totalsize, filelist, tarsize, tarhash, deps, rootdeps, builddeps, readme, &.{}); diff --git a/src/handler/hook.zig b/src/handler/hook.zig index 3e29a72..07ffbab 100644 --- a/src/handler/hook.zig +++ b/src/handler/hook.zig @@ -68,25 +68,25 @@ pub fn post(_: void, response: *http.Response, request: http.Request, captures: try ox.assert(result1.term == .Exited, response, .internal_server_error, "error: executing git clone failed: {}", .{result1.term}); try ox.assert(result1.term.Exited == 0, response, .internal_server_error, "error: executing tar failed with exit code: {d}\n{s}", .{ result1.term.Exited, result1.stderr }); - var dir = try std.fs.cwd().openDir(path, .{ .iterate = true }); + var dir = try std.fs.cwd().openIterableDir(path, .{}); defer dir.close(); - const modfile = zigmod.ModFile.from_dir(alloc, dir) catch |err| return ox.fail(response, .bad_request, "error: parsing zig.mod failed: {s}", .{@errorName(err)}); + const modfile = zigmod.ModFile.from_dir(alloc, dir.dir) catch |err| return ox.fail(response, .bad_request, "error: parsing zig.mod failed: {s}", .{@errorName(err)}); const deps = modfile.deps; const rootdeps = modfile.rootdeps; const builddeps = modfile.builddeps; - const commit = try git.getHEAD(alloc, dir); + const commit = try git.getHEAD(alloc, dir.dir); try ox.assert((try p.findVersionBy(alloc, .commit_to, commit)) == null, response, .bad_request, "error: Version at this commit already created", .{}); - try dir.deleteTree(".git"); + try dir.dir.deleteTree(".git"); const unpackedsize = try extras.dirSize(alloc, dir); const cachepath = try std.fs.path.join(alloc, &.{ path, ".zigmod", "deps" }); - zigmod.commands.ci.do(alloc, cachepath, dir) catch |err| return ox.fail(response, .internal_server_error, "error: zigmod ci failed: {s}", .{@errorName(err)}); - try dir.deleteFile("deps.zig"); + zigmod.commands.ci.do(alloc, cachepath, dir.dir) catch |err| return ox.fail(response, .internal_server_error, "error: zigmod ci failed: {s}", .{@errorName(err)}); + try dir.dir.deleteFile("deps.zig"); const totalsize = try extras.dirSize(alloc, dir); - try dir.deleteTree(".zigmod"); + try dir.dir.deleteTree(".zigmod"); const filelist = try extras.fileList(alloc, dir); try ox.assert(filelist.len > 0, response, .internal_server_error, "error: found no files in repo", .{}); @@ -108,14 +108,14 @@ pub fn post(_: void, response: *http.Response, request: http.Request, captures: const tarfile = try std.fs.cwd().openFile(tarpath, .{}); defer tarfile.close(); - const destdirpath = try std.fs.path.join(alloc, &.{ root.datadirpath, "packages", try u.uuid.toString(alloc), details.id }); + const destdirpath = try std.fs.path.join(alloc, &.{ root.datadirpath, "packages", &u.uuid.bytes(), details.id }); try std.fs.cwd().makePath(destdirpath); const destpath = try std.fs.path.join(alloc, &.{ destdirpath, try std.mem.concat(alloc, u8, &.{ "latest", ".tar.gz" }) }); try _internal.rename(tarpath, destpath); const tarsize = try extras.fileSize(std.fs.cwd(), destpath); const tarhash = try extras.hashFile(alloc, std.fs.cwd(), destpath, .sha256); - const readme = (_internal.readFileContents(dir, alloc, "README.md") catch null) orelse ""; + const readme = (_internal.readFileContents(dir.dir, alloc, "README.md") catch null) orelse ""; try std.fs.cwd().deleteTree(path); diff --git a/zigmod.lock b/zigmod.lock index c66ff30..8429845 100644 --- a/zigmod.lock +++ b/zigmod.lock @@ -1,8 +1,8 @@ 2 git https://github.com/Luukdegram/apple_pie commit-55b25cf50018fe314606765ca984a0a841743eb5 -git https://github.com/nektro/zig-extras commit-d1b32fbed72c5f00aee812447664948c3eec7006 +git https://github.com/nektro/zig-extras commit-01fae956e2f17aa992e717e041a3dd457d440b31 git https://github.com/nektro/zig-range commit-4b2f12808aa09be4b27a163efc424dd4e0415992 -git https://github.com/nektro/zig-oauth2 commit-5278a31e9a4437cfad3fe451051eda736f47b584 +git https://github.com/nektro/zig-oauth2 commit-d7a0dc452719bd7a79bd1c5fe0bbc05f9a8a8ecc git https://github.com/nektro/zig-pek commit-5c080a34d2e6b6d3d00de1e85d9f32f5ea2c2653 git https://github.com/kivikakk/htmlentities.zig commit-311c844c1d1d1cb968eedfeb76ce911038b1043a git https://github.com/MasterQ32/zig-uri commit-e879df3a236869f92298fbe2db3c25e6e84cfd4c @@ -12,7 +12,7 @@ git https://github.com/nektro/iguanaTLS commit-09d9fe92f329484536dfb2b07cfa8b406 git https://github.com/nektro/zig-json commit-a091eaa9f9ae91c3875630ba1983b33ea04971a3 git https://github.com/nektro/zig-flag commit-74acd41e8ef878a2dea1cab47400f8b9d23b0c2a git https://github.com/nektro/zig-time commit-a22054de725ef19b3f91b9ad960d4093f852b7e0 -git https://github.com/nektro/zigmod commit-df8e6780670678429cf2f535fd882a771a2aac9d +git https://github.com/nektro/zigmod commit-6a2d664e1236c62f55f02f74b51c067e57a81b63 git https://github.com/yaml/libyaml tag-0.2.5 git https://github.com/nektro/zig-ansi commit-d4a53bcac5b87abecc65491109ec22aaf5f3dc2f git https://github.com/ziglibs/known-folders commit-9db1b99219c767d5e24994b1525273fe4031e464 diff --git a/zigmod.yml b/zigmod.yml index f279ed7..a15b5c1 100644 --- a/zigmod.yml +++ b/zigmod.yml @@ -2,7 +2,7 @@ id: ehmrk2r56odz4np1cy1oibtqv9q03bxtyz36twutgyti0oj8 name: aquila license: AGPL-3.0 description: A federated package index and CI system for the Zig programming language built around the Zigmod package manager. -min_zig_version: 0.10.0-dev.2802+54454fd01 +min_zig_version: 0.10.0-dev.3316+a0d3a87ce bin: True provides: ["aquila"] root_files: