Skip to content

Commit

Permalink
update to zig master 0.10.0-dev.3316+a0d3a87ce
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Aug 11, 2022
1 parent 2655922 commit 9eac6a0
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 24 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/handler/do_import.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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", .{});
Expand Down Expand Up @@ -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, &.{});
Expand Down
18 changes: 9 additions & 9 deletions src/handler/hook.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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", .{});
Expand All @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions zigmod.lock
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion zigmod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9eac6a0

Please sign in to comment.