Skip to content

Commit

Permalink
zig/ziget update: fix unused vars
Browse files Browse the repository at this point in the history
  • Loading branch information
marler8997 committed Jul 2, 2021
1 parent 780690e commit e46a7a9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.9.0-dev.185+e125ead2b
version: 0.9.0-dev.347+628f490c5
- run: |
git clone https://github.com/marler8997/ziget ./dep/ziget
git -C ./dep/ziget checkout $(cat zigetsha) -b for_zigup
Expand Down
9 changes: 5 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn build(b: *Builder) !void {
// return;
//}

var github_release_step = b.step("github-release", "Build the github-release binaries");
//var github_release_step = b.step("github-release", "Build the github-release binaries");
// TODO: need to implement some interesting logic to make this work without
// having the iguana repo copied into this one
//try addGithubReleaseExe(b, github_release_step, ziget_repo, "x86_64-linux", SslBackend.iguana);
Expand Down Expand Up @@ -53,6 +53,7 @@ fn addTest(b: *Builder, exe: *std.build.LibExeObjStep, target: std.zig.CrossTarg

// TODO: make this work, add exe install path as argument to test
//run_cmd.addArg(exe.getInstallPath());
_ = exe;
run_cmd.step.dependOn(b.getInstallStep());

const test_step = b.step("test", "test the executable");
Expand All @@ -69,7 +70,7 @@ fn addZigupExe(b: *Builder, ziget_repo: []const u8, target: std.zig.CrossTarget,

const ziget_ssl_pkg = blk: {
if (ssl_backend) |backend| {
break :blk zigetbuild.addSslBackend(exe, backend, ziget_repo) catch |err| {
break :blk zigetbuild.addSslBackend(exe, backend, ziget_repo) catch {
const ssl_backend_failed = b.allocator.create(SslBackendFailedStep) catch unreachable;
ssl_backend_failed.* = SslBackendFailedStep.init(b, "the zigup exe", backend);
break :blk Pkg {
Expand Down Expand Up @@ -125,7 +126,7 @@ const RequireSslBackendStep = struct {
const self = @fieldParentPtr(RequireSslBackendStep, "step", step);
if (self.backend) |_| { } else {
std.debug.print("error: {s} requires an SSL backend:\n", .{self.context});
inline for (zigetbuild.ssl_backends) |field, i| {
inline for (zigetbuild.ssl_backends) |field| {
std.debug.print(" -D{s}\n", .{field.name});
}
std.os.exit(1);
Expand Down Expand Up @@ -178,7 +179,7 @@ pub const GitRepo = struct {
};
errdefer self.allocator.free(path);

std.fs.accessAbsolute(path, std.fs.File.OpenFlags { .read = true }) catch |err| {
std.fs.accessAbsolute(path, std.fs.File.OpenFlags { .read = true }) catch {
std.debug.print("Error: repository '{s}' does not exist\n", .{path});
std.debug.print(" Run the following to clone it:\n", .{});
const branch_args = if (self.branch) |b| &[2][]const u8 {" -b ", b} else &[2][]const u8 {"", ""};
Expand Down
4 changes: 2 additions & 2 deletions ziget-build-files-copy/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn addTests(b: *Builder, target: std.zig.CrossTarget, mode: std.builtin.Mode) vo
test_exe.setBuildMode(mode);

const test_step = b.step("test", "Run all the 'Enabled' tests");
inline for (ssl_backends) |field, i| {
inline for (ssl_backends) |field| {
const enum_value = @field(SslBackend, field.name);
const enabled_by_default =
if (enum_value == .wolfssl) false
Expand Down Expand Up @@ -314,7 +314,7 @@ pub const GitRepo = struct {
};
errdefer allocator.free(path);

std.fs.accessAbsolute(path, std.fs.File.OpenFlags { .read = true }) catch |err| {
std.fs.accessAbsolute(path, std.fs.File.OpenFlags { .read = true }) catch {
std.debug.print("Error: repository '{s}' does not exist\n", .{path});
std.debug.print(" Run the following to clone it:\n", .{});
const branch_args = if (self.branch) |b| &[2][]const u8 {" -b ", b} else &[2][]const u8 {"", ""};
Expand Down
2 changes: 1 addition & 1 deletion ziget-build-files-copy/iguanasha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0c0b357664397965936175d551576004cdf9da0d
0d39a361639ad5469f8e4dcdaea35446bbe54b48
2 changes: 1 addition & 1 deletion zigetsha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f14f0b2881661a65710ba84a3fcff1e5309432a1
ea7f123c3d0afe299f849429f620c84fd1a492ed
4 changes: 2 additions & 2 deletions zigup.zig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ var global_optional_install_dir: ?[]const u8 = null;
var global_optional_path_link: ?[]const u8 = null;

fn find_zigs(allocator: *Allocator) !?[][]u8 {
const ziglist = std.ArrayList([]u8).init(allocator);
// don't worry about free for now, this is a short lived program

if (builtin.os.tag == .windows) {
Expand Down Expand Up @@ -77,7 +76,7 @@ fn downloadToString(allocator: *Allocator, url: []const u8) ![]u8 {
return response_array_list.toOwnedSlice();
}

fn ignoreHttpCallback(request: []const u8) void {}
fn ignoreHttpCallback(request: []const u8) void { _ = request; }

fn getHomeDir() ![]const u8 {
if (builtin.os.tag == .windows) {
Expand Down Expand Up @@ -407,6 +406,7 @@ pub fn loggySymlinkAbsolute(target_path: []const u8, sym_link_path: []const u8,
// NOTE: can't use symLinkAbsolute because it requires target_path to be absolute but we don't want that
// not sure if it is a bug in the standard lib or not
//try std.fs.symLinkAbsolute(target_path, sym_link_path, flags);
_ = flags;
try std.os.symlink(target_path, sym_link_path);
}

Expand Down

0 comments on commit e46a7a9

Please sign in to comment.