diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 156c5cb2..43f12583 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Zig run: | sudo apt install xz-utils - sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.1600+af844931b.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.2017+a0a2ce92c.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' - name: x86_64-linux -> x86_64-macos run: cd ${{ matrix.project }} && zig build test -Dtarget=x86_64-macos.12...12-gnu env: @@ -54,10 +54,10 @@ jobs: - name: Setup Zig run: | $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest -Uri "https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.1600+af844931b.zip" -OutFile "C:\zig.zip" + Invoke-WebRequest -Uri "https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.2017+a0a2ce92c.zip" -OutFile "C:\zig.zip" cd C:\ 7z x zig.zip - Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.10.0-dev.1600+af844931b\" + Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.10.0-dev.2017+a0a2ce92c\" - name: x86_64-windows -> x86_64-macos run: cd ${{ matrix.project }} && zig build test -Dtarget='x86_64-macos.12...12-gnu' env: @@ -85,7 +85,7 @@ jobs: run: | brew uninstall --ignore-dependencies libx11 # https://github.com/ziglang/zig/issues/11066 brew install xz - sudo sh -c 'wget -c https://ziglang.org/builds/zig-macos-x86_64-0.10.0-dev.1600+af844931b.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + sudo sh -c 'wget -c https://ziglang.org/builds/zig-macos-x86_64-0.10.0-dev.2017+a0a2ce92c.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' # TODO: re-enable once we can use macos-12 reliably on GitHub actions (currently works, but # takes a very long time to acquire macos-12 runners.) # - name: test diff --git a/.gitmodules b/.gitmodules index 13fa28e8..c5c1a269 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,7 +14,8 @@ url = https://github.com/PiergiorgioZagaria/zmath [submodule "examples/libs/zigimg"] path = examples/libs/zigimg - url = https://github.com/zigimg/zigimg + url = https://github.com/slimsag/zigimg + branch = zig-master [submodule "examples/assets"] path = examples/assets url = https://github.com/hexops/mach-example-assets diff --git a/build.zig b/build.zig index 43bc14c2..562e334a 100644 --- a/build.zig +++ b/build.zig @@ -153,7 +153,7 @@ fn ensureDependencySubmodule(allocator: std.mem.Allocator, path: []const u8) !vo if (std.process.getEnvVarOwned(allocator, "NO_ENSURE_SUBMODULES")) |no_ensure_submodules| { if (std.mem.eql(u8, no_ensure_submodules, "true")) return; } else |_| {} - const child = try std.ChildProcess.init(&.{ "git", "submodule", "update", "--init", path }, allocator); + var child = std.ChildProcess.init(&.{ "git", "submodule", "update", "--init", path }, allocator); child.cwd = thisDir(); child.stderr = std.io.getStdErr(); child.stdout = std.io.getStdOut(); diff --git a/examples/boids/main.zig b/examples/boids/main.zig index 3916e7e9..422b8d74 100644 --- a/examples/boids/main.zig +++ b/examples/boids/main.zig @@ -179,7 +179,7 @@ pub fn update(app: *App, engine: *mach.Engine) !bool { const pass_encoder = command_encoder.beginComputePass(null); pass_encoder.setPipeline(app.compute_pipeline); pass_encoder.setBindGroup(0, app.particle_bind_groups[app.frame_counter % 2], null); - pass_encoder.dispatch(@floatToInt(u32, std.math.ceil(@as(f32, num_particle) / 64)), 1, 1); + pass_encoder.dispatch(@floatToInt(u32, @ceil(@as(f32, num_particle) / 64)), 1, 1); pass_encoder.end(); pass_encoder.release(); } diff --git a/examples/libs/zigimg b/examples/libs/zigimg index d480d768..1f4ff13c 160000 --- a/examples/libs/zigimg +++ b/examples/libs/zigimg @@ -1 +1 @@ -Subproject commit d480d7685d89f75c105fab7fd43af109ab072b14 +Subproject commit 1f4ff13c7425f085d44ae2130114ae9f0fc42f9e diff --git a/glfw/.github/workflows/ci.yml b/glfw/.github/workflows/ci.yml index 08c53df0..6dcade8c 100644 --- a/glfw/.github/workflows/ci.yml +++ b/glfw/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Zig run: | sudo apt install xz-utils - sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.1600+af844931b.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.2017+a0a2ce92c.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' - name: x86_64-linux -> x86_64-macos run: zig build test -Dtarget=x86_64-macos env: @@ -48,10 +48,10 @@ jobs: - name: Setup Zig run: | $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest -Uri "https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.1600+af844931b.zip" -OutFile "C:\zig.zip" + Invoke-WebRequest -Uri "https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.2017+a0a2ce92c.zip" -OutFile "C:\zig.zip" cd C:\ 7z x zig.zip - Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.10.0-dev.1600+af844931b\" + Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.10.0-dev.2017+a0a2ce92c\" - name: x86_64-windows -> x86_64-macos run: zig build test -Dtarget=x86_64-macos env: @@ -76,7 +76,7 @@ jobs: run: | brew uninstall --ignore-dependencies libx11 # https://github.com/ziglang/zig/issues/11066 brew install xz - sudo sh -c 'wget -c https://ziglang.org/builds/zig-macos-x86_64-0.10.0-dev.1600+af844931b.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + sudo sh -c 'wget -c https://ziglang.org/builds/zig-macos-x86_64-0.10.0-dev.2017+a0a2ce92c.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' - name: test run: zig build test env: diff --git a/glfw/system_sdk.zig b/glfw/system_sdk.zig index 4a44e7ee..8986f992 100644 --- a/glfw/system_sdk.zig +++ b/glfw/system_sdk.zig @@ -234,7 +234,7 @@ fn determineSdkRoot(allocator: std.mem.Allocator, org: []const u8, name: []const } fn exec(allocator: std.mem.Allocator, argv: []const []const u8, cwd: []const u8) !void { - const child = try std.ChildProcess.init(argv, allocator); + var child = std.ChildProcess.init(argv, allocator); child.cwd = cwd; _ = try child.spawnAndWait(); } diff --git a/gpu-dawn/.github/workflows/ci.yml b/gpu-dawn/.github/workflows/ci.yml index 8e384ac6..f22b2144 100644 --- a/gpu-dawn/.github/workflows/ci.yml +++ b/gpu-dawn/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Zig run: | sudo apt install xz-utils - sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.1600+af844931b.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.2017+a0a2ce92c.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' - name: Clone mach-glfw run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw - name: install (debug) @@ -37,7 +37,7 @@ jobs: - name: Setup Zig run: | sudo apt install xz-utils - sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.1600+af844931b.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.2017+a0a2ce92c.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' - name: Clone mach-glfw run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw - name: install (release-fast) @@ -58,7 +58,7 @@ jobs: - name: Setup Zig run: | sudo apt install xz-utils - sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.1600+af844931b.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.2017+a0a2ce92c.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' - name: Clone mach-glfw run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw - name: install (debug) @@ -79,7 +79,7 @@ jobs: - name: Setup Zig run: | sudo apt install xz-utils - sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.1600+af844931b.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.2017+a0a2ce92c.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' - name: Clone mach-glfw run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw - name: install (release-fast) @@ -102,10 +102,10 @@ jobs: - name: Setup Zig run: | $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest -Uri "https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.1600+af844931b.zip" -OutFile "C:\zig.zip" + Invoke-WebRequest -Uri "https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.2017+a0a2ce92c.zip" -OutFile "C:\zig.zip" cd C:\ 7z x zig.zip - Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.10.0-dev.1600+af844931b\" + Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.10.0-dev.2017+a0a2ce92c\" - name: Clone mach-glfw run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw - name: install (debug) @@ -130,10 +130,10 @@ jobs: - name: Setup Zig run: | $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest -Uri "https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.1600+af844931b.zip" -OutFile "C:\zig.zip" + Invoke-WebRequest -Uri "https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.2017+a0a2ce92c.zip" -OutFile "C:\zig.zip" cd C:\ 7z x zig.zip - Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.10.0-dev.1600+af844931b\" + Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.10.0-dev.2017+a0a2ce92c\" - name: Clone mach-glfw run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw - name: install (release-fast) @@ -157,7 +157,7 @@ jobs: run: | brew uninstall --ignore-dependencies libx11 # https://github.com/ziglang/zig/issues/11066 brew install xz - sudo sh -c 'wget -c https://ziglang.org/builds/zig-macos-x86_64-0.10.0-dev.1600+af844931b.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + sudo sh -c 'wget -c https://ziglang.org/builds/zig-macos-x86_64-0.10.0-dev.2017+a0a2ce92c.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' - name: Clone mach-glfw run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw - name: install (debug) @@ -181,7 +181,7 @@ jobs: run: | brew uninstall --ignore-dependencies libx11 # https://github.com/ziglang/zig/issues/11066 brew install xz - sudo sh -c 'wget -c https://ziglang.org/builds/zig-macos-x86_64-0.10.0-dev.1600+af844931b.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' + sudo sh -c 'wget -c https://ziglang.org/builds/zig-macos-x86_64-0.10.0-dev.2017+a0a2ce92c.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin' - name: Clone mach-glfw run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw - name: install (release-fast) diff --git a/gpu-dawn/build.zig b/gpu-dawn/build.zig index d34d5cbc..2ff3db47 100644 --- a/gpu-dawn/build.zig +++ b/gpu-dawn/build.zig @@ -180,7 +180,7 @@ fn ensureSubmodules(allocator: std.mem.Allocator) !void { if (std.process.getEnvVarOwned(allocator, "NO_ENSURE_SUBMODULES")) |no_ensure_submodules| { if (std.mem.eql(u8, no_ensure_submodules, "true")) return; } else |_| {} - const child = try std.ChildProcess.init(&.{ "git", "submodule", "update", "--init", "--recursive" }, allocator); + var child = std.ChildProcess.init(&.{ "git", "submodule", "update", "--init", "--recursive" }, allocator); child.cwd = thisDir(); child.stderr = std.io.getStdErr(); child.stdout = std.io.getStdOut(); @@ -442,7 +442,7 @@ fn gitClone(allocator: std.mem.Allocator, repository: []const u8, dir: []const u fn downloadFile(allocator: std.mem.Allocator, target_file: []const u8, url: []const u8) !void { std.debug.print("downloading {s}..\n", .{url}); - const child = try std.ChildProcess.init(&.{ "curl", "-L", "-o", target_file, url }, allocator); + var child = std.ChildProcess.init(&.{ "curl", "-L", "-o", target_file, url }, allocator); child.cwd = thisDir(); child.stderr = std.io.getStdErr(); child.stdout = std.io.getStdOut();