Browse Source

zig/ziget update: fix unused vars

Jonathan Marler 3 năm trước cách đây
mục cha
commit
e46a7a9bc0
6 tập tin đã thay đổi với 12 bổ sung11 xóa
  1. 1 1
      .github/workflows/artifact.yml
  2. 5 4
      build.zig
  3. 2 2
      ziget-build-files-copy/build.zig
  4. 1 1
      ziget-build-files-copy/iguanasha
  5. 1 1
      zigetsha
  6. 2 2
      zigup.zig

+ 1 - 1
.github/workflows/artifact.yml

@@ -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

+ 5 - 4
build.zig

@@ -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);
@@ -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");
@@ -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 {
@@ -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);
@@ -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 {"", ""};

+ 2 - 2
ziget-build-files-copy/build.zig

@@ -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
@@ -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 {"", ""};

+ 1 - 1
ziget-build-files-copy/iguanasha

@@ -1 +1 @@
-0c0b357664397965936175d551576004cdf9da0d
+0d39a361639ad5469f8e4dcdaea35446bbe54b48

+ 1 - 1
zigetsha

@@ -1 +1 @@
-f14f0b2881661a65710ba84a3fcff1e5309432a1
+ea7f123c3d0afe299f849429f620c84fd1a492ed

+ 2 - 2
zigup.zig

@@ -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) {
@@ -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) {
@@ -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);
 }