Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zig build error: renameatZ unexpected errno: TIMEDOUT #17342

Open
ben-laird opened this issue Sep 30, 2023 · 21 comments
Open

Zig build error: renameatZ unexpected errno: TIMEDOUT #17342

ben-laird opened this issue Sep 30, 2023 · 21 comments
Labels
bug Observed behavior contradicts documented or intended behavior os-macos
Milestone

Comments

@ben-laird
Copy link

Zig Version

0.11.0

Steps to Reproduce and Observed Behavior

Steps

  • Clone my repo or use the template
  • cd cpp
  • Run any of the following:
    • zig build
    • zig build run
    • zig build --help

The terminal responds in all three cases with the following:

error: Unexpected

Expected Behavior

Expectations

Zig should properly build my project or throw an error about something else I got wrong when creating the command. These commands and my current cpp/build.zig setup has worked previously, and I'm not sure what broke to cause the zig builder to fail that oddly. It feels like it threw a completely unplanned-for exception, and it seemingly started when I ran zig test src/** on a C++ file, something I now know not to do.

Context

Locally I'm on MacOS Sonoma, and I installed the latest stable versions of zig and zls with Homebrew. On my CI I use this action to set up Zig 0.11.0 on the runner. Logs can be found here on the original repo and on the template repo I made.

Thanks in advance for any help you can provide!

@ben-laird ben-laird added the bug Observed behavior contradicts documented or intended behavior label Sep 30, 2023
@ben-laird
Copy link
Author

Don't know if it's related, but there is no Sonoma bottle on Homebrew, it just uses Ventura. Is that something in active development right now?

@squeek502
Copy link
Collaborator

squeek502 commented Oct 1, 2023

Was able to reproduce this, but needed to switch to the dev branch of your repo to do so.

Here's the stack trace on Windows:

> zig build run
zig build-exe lab-2-class-construction Debug native: error: thread 7676 panic: reached unreachable code
C:\Users\Ryan\Programming\Zig\zig\lib\std\os\windows.zig:131:37: 0x7ff7a4c7e48e in OpenFile (zig.exe.obj)
            .OBJECT_NAME_INVALID => unreachable,
                                    ^
C:\Users\Ryan\Programming\Zig\zig\lib\std\fs.zig:1245:37: 0x7ff7a4c51564 in openFileW (zig.exe.obj)
            .handle = try w.OpenFile(sub_path_w, .{
                                    ^
C:\Users\Ryan\Programming\Zig\zig\lib\std\fs.zig:1122:34: 0x7ff7a4a4b7e5 in openFile (zig.exe.obj)
            return self.openFileW(path_w.span(), flags);
                                 ^
C:\Users\Ryan\Programming\Zig\zig\lib\std\Build\Cache.zig:652:38: 0x7ff7a4aefaaa in populateFileHash (zig.exe.obj)
        const file = try dir.openFile(pp.sub_path, .{});
                                     ^
C:\Users\Ryan\Programming\Zig\zig\lib\std\Build\Cache.zig:465:42: 0x7ff7a4af1668 in hit (zig.exe.obj)
                    self.populateFileHash(ch_file) catch |err| {
                                         ^
C:\Users\Ryan\Programming\Zig\zig\src\Compilation.zig:2052:31: 0x7ff7a4b8683d in update (zig.exe.obj)
        const is_hit = man.hit() catch |err| {
                              ^
C:\Users\Ryan\Programming\Zig\zig\src\main.zig:3727:36: 0x7ff7a4bb4bbf in serve (zig.exe.obj)
                    try comp.update(main_progress_node);
                                   ^
C:\Users\Ryan\Programming\Zig\zig\src\main.zig:3536:22: 0x7ff7a4bdbb24 in buildOutputType (zig.exe.obj)
            try serve(
                     ^
C:\Users\Ryan\Programming\Zig\zig\src\main.zig:269:31: 0x7ff7a4a33a76 in mainArgs (zig.exe.obj)
        return buildOutputType(gpa, arena, args, .{ .build = .Exe });
                              ^
C:\Users\Ryan\Programming\Zig\zig\src\main.zig:213:20: 0x7ff7a4a3153d in main (zig.exe.obj)
    return mainArgs(gpa, arena, args);
                   ^
C:\Users\Ryan\Programming\Zig\zig\lib\std\start.zig:486:37: 0x7ff7a4a31239 in main (zig.exe.obj)
    std.os.argv = @as([*][*:0]u8, @ptrCast(c_argv))[0..@as(usize, @intCast(c_argc))];
                                    ^
C:\Users\Ryan\Programming\Zig\zig\lib\libc\mingw\crt\crtexe.c:321:0: 0x7ff7a6abe344 in __tmainCRTStartup (crt2.obj)
    mainret = main (argc, argv, envp);

C:\Users\Ryan\Programming\Zig\zig\lib\libc\mingw\crt\crtexe.c:202:0: 0x7ff7a6abe39b in mainCRTStartup (crt2.obj)
  ret = __tmainCRTStartup ();

???:?:?: 0x7ffb02077343 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffb031a26b0 in ??? (ntdll.dll)

You're passing a file path that is invalid. Currently, Zig considers this to be programmer error and marks it as unreachable (or in your case, Unexpected). See #15607 for more details on that.

As for how to go about fixing your particular problem, just list all the .cpp files in your build.zig. There's no real shortcut for 'all the files from some directory' as far as I'm aware, you just gotta list them. This worked for me:

    const exe = b.addExecutable(.{
        .name = "lab-2-class-construction",
        .root_source_file = .{ .path = "src/main.cpp" },
        .target = target,
        .optimize = optimize,
    });
    exe.addCSourceFiles(&.{"src/Student.cpp"}, &.{});
> zig build run
Benjamin Laird

@ben-laird
Copy link
Author

Sorry I should've mentioned needing to switch to the dev branch, thanks for catching that. Interestingly, when I deleted the zig-cache dir locally the error: Unexpected output went away and I got the expected behavior, the zig compiler either built my code or gave me a helpful error message.

I also found this article that recommended opening an iterable directory at src and traversing it. Admittedly I'm far more of a fan of your solution, when I run the snippet below it wrongly excludes the src/ part of the path, and I'm very new to Zig and C++ so I don't really know Zig's idiomatic way of formatting or concatenating strings:

const std = @import("std");

pub fn build(b: *std.Build) !void {
    var sources = std.ArrayList([]const u8).init(b.allocator);

    // Search for all C/C++ files in `src` and add them
    {
        var dir = try std.fs.cwd().openIterableDir("src", .{});

        var walker = try dir.walk(b.allocator);
        defer walker.deinit();

        const allowed_exts = [_][]const u8{ ".c", ".cpp", ".cxx", ".c++", ".cc" };
        while (try walker.next()) |entry| {
            const ext = std.fs.path.extension(entry.basename);
            const include_file = for (allowed_exts) |e| {
                if (std.mem.eql(u8, ext, e))
                    break true;
            } else false;

            if (include_file) {
                // we have to clone the path as walker.next() or walker.deinit() will override/kill it
                try sources.append(b.dupe(entry.path)); // BUG Does not start path at `src/`
            }
        }
    }

    const target = b.standardTargetOptions(.{});

    const optimize = b.standardOptimizeOption(.{});

    const exe = b.addExecutable(.{
        .name = "lab-2-class-construction",
        .root_source_file = .{ .path = "src/main.cpp" },
        .target = target,
        .optimize = optimize,
    });
    exe.addCSourceFiles(sources.items, &[_][]const u8{});
    exe.linkLibCpp();
    b.installArtifact(exe);

    const run_cmd = b.addRunArtifact(exe);

    run_cmd.step.dependOn(b.getInstallStep());

    if (b.args) |args| {
        run_cmd.addArgs(args);
    }

    const run_step = b.step("run", "Run the app");
    run_step.dependOn(&run_cmd.step);
}

Error:

$ zig build

zig build-exe lab-2-class-construction Debug native: error: warning: FileNotFound: /Users/benjaminlaird/Desktop/Life/Projects/CSCN-112/lab-2-class-construction-actual/cpp/Student.cpp
error: FileNotFound

zig build-exe lab-2-class-construction Debug native: error: the following command exited with error code 1:
/usr/local/Cellar/zig/0.11.0/bin/zig build-exe /Users/.../lab-2-class-construction-actual/cpp/src/main.cpp /Users/.../lab-2-class-construction-actual/cpp/Student.cpp Users/.../lab-2-class-construction-actual/cpp/main.cpp -lc++ --cache-dir /Users/.../lab-2-class-construction-actual/cpp/zig-cache --global-cache-dir /Users/.../.cache/zig --name lab-2-class-construction --listen=- 
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install lab-2-class-construction transitive failure
   └─ zig build-exe lab-2-class-construction Debug native failure
error: the following build command failed with exit code 1:
/Users/.../lab-2-class-construction-actual/cpp/zig-cache/o/d3fdeee28f62f83380d966f71b7f1e5b/build /usr/local/Cellar/zig/0.11.0/bin/zig /Users/.../lab-2-class-construction-actual/cpp /.../lab-2-class-construction-actual/cpp/zig-cache /Users/.../.cache/zig

However running this like you recommended:

const std = @import("std");

pub fn build(b: *std.Build) !void {
    const target = b.standardTargetOptions(.{});

    const optimize = b.standardOptimizeOption(.{});

    const exe = b.addExecutable(.{
        .name = "lab-2-class-construction",
        .root_source_file = .{ .path = "src/main.cpp" },
        .target = target,
        .optimize = optimize,
    });
    exe.addCSourceFiles(&.{"src/Student.cpp"}, &.{});
    exe.linkLibCpp();
    b.installArtifact(exe);

    const run_cmd = b.addRunArtifact(exe);

    run_cmd.step.dependOn(b.getInstallStep());

    if (b.args) |args| {
        run_cmd.addArgs(args);
    }

    const run_step = b.step("run", "Run the app");
    run_step.dependOn(&run_cmd.step);
}

Built the project just fine. I don't really know how the cache directory got corrupted or why that would make the zig compiler just fail with error: Unexpected.

@ben-laird
Copy link
Author

I messed around a bit with the build.zig file and deleting caches scattered around my system. As of this commit on the dev branch, CI works brilliantly; occasionally I need to delete a GHA cache because a runner can't find some files it needs, but that's a separate issue.

dev's cpp/build.zig:

const std = @import("std");

pub fn build(b: *std.Build) !void {
    var sources = std.ArrayList([]const u8).init(b.allocator);

    // Search for all C/C++ files in `src/lib` and add them
    {
        const base_path: []const u8 = "src/lib";
        const allowed_exts = [_][]const u8{ ".c", ".cpp", ".cxx", ".c++", ".cc" };

        var dir = try std.fs.cwd().openIterableDir(base_path, .{});

        var walker = try dir.walk(b.allocator);
        defer walker.deinit();

        while (try walker.next()) |entry| {
            const ext = std.fs.path.extension(entry.basename);
            const include_file = for (allowed_exts) |e| {
                if (std.mem.eql(u8, ext, e))
                    break true;
            } else false;

            if (include_file) {
                var path_vec = std.ArrayList(u8).init(b.allocator);
                defer path_vec.deinit();

                try path_vec.appendSlice(base_path);
                try path_vec.append('/');
                try path_vec.appendSlice(entry.path);

                const full_path = b.dupe(path_vec.items);

                try sources.append(full_path);
            }
        }
    }

    const target = b.standardTargetOptions(.{});

    const optimize = b.standardOptimizeOption(.{});

    const exe = b.addExecutable(.{
        .name = "lab-2-class-construction",
        .root_source_file = .{ .path = "src/main.cpp" },
        .target = target,
        .optimize = optimize,
    });
    exe.addCSourceFiles(sources.items, &.{});
    exe.linkLibCpp();
    b.installArtifact(exe);

    const run_cmd = b.addRunArtifact(exe);

    run_cmd.step.dependOn(b.getInstallStep());

    if (b.args) |args| {
        run_cmd.addArgs(args);
    }

    const run_step = b.step("run", "Run the app");
    run_step.dependOn(&run_cmd.step);
}

The error: Unexpected problem has only temporarily been solved locally. I got it working yesterday with your solution, and earlier today with mine, but between messing around with the VSCode extension settings and building the project with those settings, I have probably "corrupted" a couple caches I haven't cleaned yet.

I'd love to know any recommendations on how to clear the caches or set up VSCode so it properly finds my Homebrew installations of Zig/Zls; I briefly read the issue you linked and couldn't really find where my code passes in an invalid file path, especially considering I was able to get my code to build locally when it looked like this and when my code looked like the commit I linked earlier.

Thank you again for your help! I'm really enjoying learning Zig, C/C++, and systems programming because of this community's work.

@squeek502
Copy link
Collaborator

squeek502 commented Oct 3, 2023

I briefly read the issue you linked and couldn't really find where my code passes in an invalid file path

Paths being invalid or not depends on your OS and filesystem. On Windows, the * character is disallowed so it hit .OBJECT_NAME_INVALID => unreachable for me when your main path had **.cpp in it.

Your error.Unexpected is probably something else entirely, but it's likely OS-specific (and it seems possibly related to the cache), so it'll be hard for others to reproduce. If you can recreate it with a Debug build of Zig (to get it to print a stack trace), it'd be worth reporting separately since error.Unexpected is almost always a bug:

zig/lib/std/os.zig

Lines 5578 to 5599 in 412d863

/// Whether or not error.Unexpected will print its value and a stack trace.
/// if this happens the fix is to add the error code to the corresponding
/// switch expression, possibly introduce a new error in the error set, and
/// send a patch to Zig.
pub const unexpected_error_tracing = builtin.zig_backend == .stage2_llvm and builtin.mode == .Debug;
pub const UnexpectedError = error{
/// The Operating System returned an undocumented error code.
/// This error is in theory not possible, but it would be better
/// to handle this error than to invoke undefined behavior.
Unexpected,
};
/// Call this when you made a syscall or something that sets errno
/// and you get an unexpected error.
pub fn unexpectedErrno(err: E) UnexpectedError {
if (unexpected_error_tracing) {
std.debug.print("unexpected errno: {d}\n", .{@intFromEnum(err)});
std.debug.dumpCurrentStackTrace(null);
}
return error.Unexpected;
}

@ben-laird
Copy link
Author

Thanks, will do. Does Homebrew offer a debug build of Zig, or should I build from source?

@squeek502
Copy link
Collaborator

Building from source would work, unsure about Homebrew.

@ben-laird
Copy link
Author

Thanks so much for your patence, my Mac ran into some external hardware issues so I had to replace it. I'm on an M1 MacBook Pro now, and I installed the nightly version of Zig using the VSCode extension. I have still run into the error: Unexpected error, but only occasionally as opposed to all the time. Interestingly, when I run zig build run on my local version of my desktop directory, there's a chance zig will return the error: Unexpected error, but when I run the same command through the iCloud Drive path to my desktop (I have my desktop and all my programming projects synced to iCloud) there are no issues.

I can't shake the feeling there's an underlying problem related to what you said:

I briefly read the issue you linked and couldn't really find where my code passes in an invalid file path

Paths being invalid or not depends on your OS and filesystem. On Windows, the * character is disallowed so it hit .OBJECT_NAME_INVALID => unreachable for me when your main path had **.cpp in it.

Your error.Unexpected is probably something else entirely, but it's likely OS-specific (and it seems possibly related to the cache), so it'll be hard for others to reproduce. If you can recreate it with a Debug build of Zig (to get it to print a stack trace), it'd be worth reporting separately since error.Unexpected is almost always a bug:

zig/lib/std/os.zig

Lines 5578 to 5599 in 412d863

/// Whether or not error.Unexpected will print its value and a stack trace.
/// if this happens the fix is to add the error code to the corresponding
/// switch expression, possibly introduce a new error in the error set, and
/// send a patch to Zig.
pub const unexpected_error_tracing = builtin.zig_backend == .stage2_llvm and builtin.mode == .Debug;
pub const UnexpectedError = error{
/// The Operating System returned an undocumented error code.
/// This error is in theory not possible, but it would be better
/// to handle this error than to invoke undefined behavior.
Unexpected,
};
/// Call this when you made a syscall or something that sets errno
/// and you get an unexpected error.
pub fn unexpectedErrno(err: E) UnexpectedError {
if (unexpected_error_tracing) {
std.debug.print("unexpected errno: {d}\n", .{@intFromEnum(err)});
std.debug.dumpCurrentStackTrace(null);
}
return error.Unexpected;
}

I just can't seem to find it. Regrettably also, I don't quite understand how to build zig from source, but that's something I'll ask some dev friends about instead of cluttering up this issue. Would like to know where you'd like to go from here @squeek502 and thank you again for your help and patience.

@squeek502
Copy link
Collaborator

Unfortunately there's not much that can be done until either:

  • You find a consistent reproduction that can be repeated on someone else's machine
  • You build the compiler in debug mode and get a full stack trace

error.Unexpected can really come from any syscall since it's used as a catch all 'we don't currently know that this error is possible' type thing.

@ben-laird
Copy link
Author

I may have found that consistent reproduction, and it may just be an artifact of my own file system.

I keep my code on iCloud, and when I make sure it gets downloaded locally, running zig build and any subcommands work just fine. I just now ran into the issue, and when I make sure the directory is downloaded locally, with no code changes, it works just fine all over again.

Idk if this is very reproducible since it requires a Mac with storage on iCloud, but maybe this revelation will shed some light on the situation. I'll look further into making a debug build and I'll commit what I have locally to this repo in the stage branch so that anyone with a Mac with storage on iCloud can try reproducing my issue.

In the meantime, I found a way to use VSCode's LLDB debugger to step through Zig code, so if you'd like me to step through a test file or something similar I'd be happy to. Apologies for the roundabout way of debugging, I am currently learning how to make that debug build from source, and as a primarily web-based developer it's somewhat slow going. Thank you so much again for your help!

@ryansname
Copy link

ryansname commented Nov 13, 2023

Howdy, I'm also running into this on macOS Sonoma 14.1, also with my code in an iCloud synced folder. Here's the debug output from 53500a57684665 built as zig build -Denable-llvm=false -p "stage3" --zig-lib-dir lib/.

Full stack trace

$ ~/code-no-sync/zig/stage3/bin/zig  build
unexpected errno: 60
/Users/ryan/code-no-sync/zig/lib/std/debug.zig:127:31: 0x10325d77f in dumpCurrentStackTrace (zig)
        writeCurrentStackTrace(stderr, debug_info, io.tty.detectConfig(io.getStdErr()), start_addr) catch |err| {
                              ^
/Users/ryan/code-no-sync/zig/lib/std/os.zig:5670:40: 0x102fe5adf in unexpectedErrno (zig)
        std.debug.dumpCurrentStackTrace(null);
                                       ^
/Users/ryan/code-no-sync/zig/lib/std/os.zig:2622:45: 0x10317c753 in renameatZ (zig)
        else => |err| return unexpectedErrno(err),
                                            ^
/Users/ryan/code-no-sync/zig/lib/std/os.zig:2555:25: 0x102e8dc23 in renameat (zig)
        return renameatZ(old_dir_fd, &old_path_c, new_dir_fd, &new_path_c);
                        ^
/Users/ryan/code-no-sync/zig/lib/std/fs.zig:2001:27: 0x102e8013b in rename (zig)
        return os.renameat(self.fd, old_sub_path, self.fd, new_sub_path);
                          ^
/Users/ryan/code-no-sync/zig/src/Package/Fetch.zig:1249:25: 0x102f334bb in renameTmpIntoCache (zig)
        cache_dir.rename(tmp_dir_sub_path, dest_dir_sub_path) catch |err| switch (err) {
                        ^
/Users/ryan/code-no-sync/zig/src/main.zig:7253:41: 0x102f33bcb in createDependenciesModule (zig)
    try Package.Fetch.renameTmpIntoCache(
                                        ^
/Users/ryan/code-no-sync/zig/src/main.zig:5290:58: 0x102f37c37 in cmdBuild (zig)
            const deps_mod = try createDependenciesModule(
                                                         ^
/Users/ryan/code-no-sync/zig/src/main.zig:295:24: 0x102d6bcb3 in mainArgs (zig)
        return cmdBuild(gpa, arena, cmd_args);
                       ^
/Users/ryan/code-no-sync/zig/src/main.zig:223:20: 0x102d68e23 in main (zig)
    return mainArgs(gpa, arena, args);
                   ^
/Users/ryan/code-no-sync/zig/lib/std/start.zig:585:37: 0x102d68a27 in main (zig)
            const result = root.main() catch |err| {
                                    ^
???:?:?: 0x18b5dd0df in ??? (???)
???:?:?: 0xa34cffffffffffff in ??? (???)
error: Unexpected
/Users/ryan/code-no-sync/zig/lib/std/os.zig:5672:5: 0x102fe5ae7 in unexpectedErrno (zig)
    return error.Unexpected;
    ^
/Users/ryan/code-no-sync/zig/lib/std/os.zig:2622:23: 0x10317c763 in renameatZ (zig)
        else => |err| return unexpectedErrno(err),
                      ^
/Users/ryan/code-no-sync/zig/lib/std/os.zig:2555:9: 0x102e8dc77 in renameat (zig)
        return renameatZ(old_dir_fd, &old_path_c, new_dir_fd, &new_path_c);
        ^
/Users/ryan/code-no-sync/zig/lib/std/fs.zig:2001:9: 0x102e80167 in rename (zig)
        return os.renameat(self.fd, old_sub_path, self.fd, new_sub_path);
        ^
/Users/ryan/code-no-sync/zig/src/Package/Fetch.zig:1265:25: 0x102f3354f in renameTmpIntoCache (zig)
            else => |e| return e,
                        ^
/Users/ryan/code-no-sync/zig/src/main.zig:7253:5: 0x102f33bef in createDependenciesModule (zig)
    try Package.Fetch.renameTmpIntoCache(
    ^
/Users/ryan/code-no-sync/zig/src/main.zig:5290:30: 0x102f37dcf in cmdBuild (zig)
            const deps_mod = try createDependenciesModule(
                             ^
/Users/ryan/code-no-sync/zig/src/main.zig:295:9: 0x102d6bd3b in mainArgs (zig)
        return cmdBuild(gpa, arena, cmd_args);
        ^
/Users/ryan/code-no-sync/zig/src/main.zig:223:5: 0x102d68e7b in main (zig)
    return mainArgs(gpa, arena, args);
    ^

I added some nice print debugging to see which folders are being moved and got this:
Rename: tmp/2e97ccf0736ad505 to o/655e265e24fea8e480addde3f27ff2df

And manually moving that file some time later gives me this:

$ mv zig-cache/tmp/2e97ccf0736ad505 zig-cache/o/655e265e24fea8e480addde3f27ff2df
mv: cannot move 'zig-cache/tmp/2e97ccf0736ad505' to 'zig-cache/o/655e265e24fea8e480addde3f27ff2df': Operation timed out

@ben-laird
Copy link
Author

Thank you so much for this @ryansname, I literally just revisited this issue to try making my own debug build to post a stack trace.

@ryansname
Copy link

ryansname commented Nov 13, 2023

Well at least for me, it looks like the only thing that Zig is doing wrong here is failing to report a nicer error message. Trying to move the files in fish and in Finder both fail with different (but similar) errors.

@ben-laird I did eventually manage to fix the problem, which looked like iCloud Drive sync getting super stuck by following the instructions here. https://www.swyx.io/what-to-do-when-icloud-is-stuck-on-uploading-items
Edit: Yeah, this gave me a brief reprieve. But it has started recurring.

@ben-laird
Copy link
Author

ben-laird commented Nov 13, 2023

Very interesting. To corroborate, I removed the download of my Programming directory where I keep all my programming projects, and then as I was redownloading it, zig worked just fine on a new repo I have yet to publish to GitHub.

Even more interesting, when building Zig from source, stage 3 reports the same error: Unexpected exception.

I followed the build from source tutorial and added in a build.sh script so I didn't mess up the commands easily:

# build.sh

mkdir build
cd build
cmake .. -DZIG_STATIC_LLVM=ON -DCMAKE_PREFIX_PATH="$(brew --prefix llvm);$(brew --prefix zstd)" # don't know how to make it build in debug mode
make install
Full stack trace of running `./build.sh`
-- The C compiler identification is AppleClang 15.0.0.15000040
-- The CXX compiler identification is AppleClang 15.0.0.15000040
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring zig version 0.12.0-dev.1596+53500a576
-- Found llvm: /opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMWindowsManifest.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMXRay.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLibDriver.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDlltoolDriver.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMCoverage.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLineEditor.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMXCoreDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMXCoreCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMXCoreDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMXCoreInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMX86TargetMCA.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMX86Disassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMX86AsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMX86CodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMX86Desc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMX86Info.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMWebAssemblyDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMWebAssemblyAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMWebAssemblyCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMWebAssemblyUtils.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMWebAssemblyDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMWebAssemblyInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMVEDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMVEAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMVECodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMVEDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMVEInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSystemZDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSystemZAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSystemZCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSystemZDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSystemZInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSparcDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSparcAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSparcCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSparcDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSparcInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMRISCVTargetMCA.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMRISCVDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMRISCVAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMRISCVCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMRISCVDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMRISCVInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMPowerPCDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMPowerPCAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMPowerPCCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMPowerPCDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMPowerPCInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMNVPTXCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMNVPTXDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMNVPTXInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMSP430Disassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMSP430AsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMSP430CodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMSP430Desc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMSP430Info.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMipsDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMipsAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMipsCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMipsDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMipsInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLoongArchDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLoongArchAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLoongArchCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLoongArchDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLoongArchInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLanaiDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLanaiCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLanaiAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLanaiDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLanaiInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMHexagonDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMHexagonCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMHexagonAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMHexagonDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMHexagonInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMBPFDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMBPFAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMBPFCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMBPFDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMBPFInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAVRDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAVRAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAVRCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAVRDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAVRInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMARMDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMARMAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMARMCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMARMDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMARMUtils.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMARMInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAMDGPUTargetMCA.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAMDGPUDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAMDGPUAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAMDGPUCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAMDGPUDesc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAMDGPUUtils.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAMDGPUInfo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAArch64Disassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAArch64AsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAArch64CodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAArch64Desc.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAArch64Utils.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAArch64Info.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMOrcJIT.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMWindowsDriver.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMCJIT.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMJITLink.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMInterpreter.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMExecutionEngine.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMRuntimeDyld.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMOrcTargetProcess.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMOrcShared.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDWP.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDebugInfoLogicalView.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDebugInfoGSYM.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMOption.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMObjectYAML.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMObjCopy.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMCA.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMCDisassembler.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLTO.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMCFGuard.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMFrontendOpenACC.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMFrontendHLSL.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMExtensions.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libPolly.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libPollyISL.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMPasses.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMCoroutines.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMipo.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMInstrumentation.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMVectorize.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMLinker.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMFrontendOpenMP.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDWARFLinkerParallel.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDWARFLinker.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMGlobalISel.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMIRParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAsmPrinter.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSelectionDAG.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMCodeGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMTarget.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMObjCARCOpts.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMCodeGenTypes.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMIRPrinter.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMInterfaceStub.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMFileCheck.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMFuzzMutate.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMScalarOpts.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMInstCombine.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAggressiveInstCombine.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMTransformUtils.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMBitWriter.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAnalysis.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMProfileData.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSymbolize.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDebugInfoBTF.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDebugInfoPDB.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDebugInfoMSF.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDebugInfoDWARF.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMObject.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMTextAPI.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMCParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMIRReader.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMAsmParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMMC.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDebugInfoCodeView.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMBitReader.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMFuzzerCLI.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMCore.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMRemarks.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMBitstreamReader.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMBinaryFormat.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMTargetParser.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMTableGen.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMSupport.a;/opt/homebrew/Cellar/llvm/17.0.4/lib/libLLVMDemangle.a;-lm;/opt/homebrew/lib/libz3.dylib;-lz;-lzstd;-lcurses;-lxml2 (Required is at least version "17") 
-- Found clang: /opt/homebrew/opt/llvm/lib/libclangFrontendTool.a;/opt/homebrew/opt/llvm/lib/libclangCodeGen.a;/opt/homebrew/opt/llvm/lib/libclangFrontend.a;/opt/homebrew/opt/llvm/lib/libclangDriver.a;/opt/homebrew/opt/llvm/lib/libclangSerialization.a;/opt/homebrew/opt/llvm/lib/libclangSema.a;/opt/homebrew/opt/llvm/lib/libclangStaticAnalyzerFrontend.a;/opt/homebrew/opt/llvm/lib/libclangStaticAnalyzerCheckers.a;/opt/homebrew/opt/llvm/lib/libclangStaticAnalyzerCore.a;/opt/homebrew/opt/llvm/lib/libclangAnalysis.a;/opt/homebrew/opt/llvm/lib/libclangASTMatchers.a;/opt/homebrew/opt/llvm/lib/libclangAST.a;/opt/homebrew/opt/llvm/lib/libclangParse.a;/opt/homebrew/opt/llvm/lib/libclangSema.a;/opt/homebrew/opt/llvm/lib/libclangBasic.a;/opt/homebrew/opt/llvm/lib/libclangEdit.a;/opt/homebrew/opt/llvm/lib/libclangLex.a;/opt/homebrew/opt/llvm/lib/libclangARCMigrate.a;/opt/homebrew/opt/llvm/lib/libclangRewriteFrontend.a;/opt/homebrew/opt/llvm/lib/libclangRewrite.a;/opt/homebrew/opt/llvm/lib/libclangCrossTU.a;/opt/homebrew/opt/llvm/lib/libclangIndex.a;/opt/homebrew/opt/llvm/lib/libclangToolingCore.a;/opt/homebrew/opt/llvm/lib/libclangExtractAPI.a;/opt/homebrew/opt/llvm/lib/libclangSupport.a (Required is at least version "17") 
-- Found lld: /opt/homebrew/opt/llvm/lib/liblldMinGW.a;/opt/homebrew/opt/llvm/lib/liblldELF.a;/opt/homebrew/opt/llvm/lib/liblldCOFF.a;/opt/homebrew/opt/llvm/lib/liblldWasm.a;/opt/homebrew/opt/llvm/lib/liblldMachO.a;/opt/homebrew/opt/llvm/lib/liblldCommon.a (Required is at least version "17") 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Configuring done (0.8s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/benlaird/Desktop/Life/zig/build
[  5%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_llvm.cpp.o
[ 10%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_llvm-ar.cpp.o
[ 15%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang.cpp.o
[ 21%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang_driver.cpp.o
[ 26%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang_cc1_main.cpp.o
[ 31%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang_cc1as_main.cpp.o
[ 36%] Linking CXX static library zigcpp/libzigcpp.a
[ 36%] Built target zigcpp
[ 42%] Building C object CMakeFiles/zig-wasm2c.dir/stage1/wasm2c.c.o
[ 47%] Linking C executable zig-wasm2c
[ 47%] Built target zig-wasm2c
[ 52%] Converting /Users/benlaird/Desktop/Life/zig/stage1/zig1.wasm to /Users/benlaird/Desktop/Life/zig/build/zig1.c
[ 57%] Building C object CMakeFiles/zig1.dir/zig1.c.o
[ 63%] Building C object CMakeFiles/zig1.dir/stage1/wasi.c.o
[ 68%] Linking C executable zig1
[ 68%] Built target zig1
[ 73%] Running zig1.wasm to produce /Users/benlaird/Desktop/Life/zig/build/zig2.c
[ 78%] Running zig1.wasm to produce /Users/benlaird/Desktop/Life/zig/build/compiler_rt.c
[ 84%] Building C object CMakeFiles/zig2.dir/zig2.c.o
/Users/benlaird/Desktop/Life/zig/build/zig2.c:312753:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t0.f1 = zig_mulo_u64(&t0.f0, a0, a1, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:781:43: note: passing argument to parameter 'res' here
static inline bool zig_mulo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:312774:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t0.f1 = zig_addo_u64(&t0.f0, a0, a1, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:1180516:29: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
      t75.f1 = zig_subo_u64(&t75.f0, t62, t74, UINT8_C(64));
                            ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:1208247:8: warning: incompatible pointer types assigning to 'const uint16_t (*)[16]' (aka 'const unsigned short (*)[16]') from 'const uint16_t *' (aka 'const unsigned short *') [-Wincompatible-pointer-types]
   t26 = t25.ptr;
       ^ ~~~~~~~
/Users/benlaird/Desktop/Life/zig/build/zig2.c:1468763:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t15.f1 = zig_addo_u64(&t15.f0, t9, t14, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:1627879:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t0.f1 = zig_subo_u64(&t0.f0, a0, a1, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2295872:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t15.f1 = zig_subo_u64(&t15.f0, t4, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2295922:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t15.f1 = zig_subo_u64(&t15.f0, t4, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2295967:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t15.f1 = zig_subo_u64(&t15.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2295974:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t24.f1 = zig_subo_u64(&t24.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2295982:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t24.f1 = zig_addo_u64(&t24.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296017:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t24.f1 = zig_subo_u64(&t24.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296023:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t24.f1 = zig_addo_u64(&t24.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296191:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t16.f1 = zig_subo_u64(&t16.f0, t1, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296201:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t16.f1 = zig_addo_u64(&t16.f0, t1, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296246:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t16.f1 = zig_subo_u64(&t16.f0, t1, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296296:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t16.f1 = zig_subo_u64(&t16.f0, t1, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296306:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t16.f1 = zig_addo_u64(&t16.f0, t1, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296350:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t16.f1 = zig_subo_u64(&t16.f0, t1, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296357:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t27.f1 = zig_subo_u64(&t27.f0, t0, t1, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296365:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t27.f1 = zig_addo_u64(&t27.f0, t0, t1, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296463:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t11.f1 = zig_subo_u64(&t11.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296470:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t12.f1 = zig_subo_u64(&t12.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296478:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t12.f1 = zig_addo_u64(&t12.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296510:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t12.f1 = zig_subo_u64(&t12.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2296516:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t12.f1 = zig_addo_u64(&t12.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2333292:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
  t11.f1 = zig_mulo_u64(&t11.f0, t7, t10, UINT8_C(64));
                        ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:781:43: note: passing argument to parameter 'res' here
static inline bool zig_mulo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2337285:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t22.f1 = zig_addo_u64(&t22.f0, t5, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2393196:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t5.f1 = zig_addo_u64(&t5.f0, t2, t4, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2596463:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t24.f1 = zig_addo_u64(&t24.f0, t15, t16, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2596531:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t24.f1 = zig_addo_u64(&t24.f0, t16, t15, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2853125:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t8.f1 = zig_addo_u64(&t8.f0, t4, t0, UINT8_C(64));
                        ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2853136:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_addo_u64(&t13.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:2853171:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_addo_u64(&t13.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3137092:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t8.f1 = zig_subo_u64(&t8.f0, t4, t0, UINT8_C(64));
                        ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3137103:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_subo_u64(&t13.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3137138:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_subo_u64(&t13.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3146572:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t1.f1 = zig_addo_u64(&t1.f0, a0, t0, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3146578:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t5.f1 = zig_addo_u64(&t5.f0, t4, t0, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3146769:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t15.f1 = zig_subo_u64(&t15.f0, t3, t2, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3146847:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t8.f1 = zig_addo_u64(&t8.f0, t0, t4, UINT8_C(64));
                        ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3146858:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_addo_u64(&t13.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3146904:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_addo_u64(&t13.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3340584:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t15.f1 = zig_addo_u64(&t15.f0, t3, t2, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:565:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3341764:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t1.f1 = zig_subo_u64(&t1.f0, a0, t0, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/Desktop/Life/zig/build/zig2.c:3341770:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t5.f1 = zig_subo_u64(&t5.f0, t4, t0, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/Desktop/Life/zig/stage1/zig.h:673:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
46 warnings generated.
[ 89%] Building C object CMakeFiles/zig2.dir/compiler_rt.c.o
[ 94%] Linking CXX executable zig2
ld: warning: ignoring duplicate libraries: '/opt/homebrew/opt/llvm/lib/libclangAST.a', '/opt/homebrew/opt/llvm/lib/libclangASTMatchers.a', '/opt/homebrew/opt/llvm/lib/libclangAnalysis.a', '/opt/homebrew/opt/llvm/lib/libclangParse.a', '/opt/homebrew/opt/llvm/lib/libclangSema.a', '/opt/homebrew/opt/llvm/lib/libclangStaticAnalyzerCheckers.a', '/opt/homebrew/opt/llvm/lib/libclangStaticAnalyzerCore.a', '/opt/homebrew/opt/llvm/lib/libclangStaticAnalyzerFrontend.a'
[ 94%] Built target zig2
[100%] Building stage3
error: Unexpected # ERROR HERE
make[2]: *** [stage3/bin/zig] Error 1
make[1]: *** [CMakeFiles/stage3.dir/all] Error 2
make: *** [all] Error 2

I'll try out the guide you linked and see if that works. Thanks so much for the help!

Edit: Link helped with iCloud seizing up on uploads/downloads, but still ran into problems when running zig build run

@ben-laird
Copy link
Author

UPDATE

I got Zig to compile from source in debug mode, but only by putting the codebase in a local-only directory ~/dev/sys/zig

Stack trace of Zig compiling from source

New build.sh:

mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH="$(brew --prefix llvm);$(brew --prefix zstd)" -DZIG_STATIC_LLVM=on -DCMAKE_BUILD_TYPE=Debug
make install

Stack trace:

mkdir: build: File exists
-- Configuring zig version 0.12.0-dev.1604+caae40c21
-- Configuring done (0.1s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/benlaird/dev/sys/zig/build
[ 36%] Built target zigcpp
[ 47%] Built target zig-wasm2c
[ 68%] Built target zig1
[ 73%] Running zig1.wasm to produce /Users/benlaird/dev/sys/zig/build/zig2.c
[ 78%] Running zig1.wasm to produce /Users/benlaird/dev/sys/zig/build/compiler_rt.c
[ 84%] Building C object CMakeFiles/zig2.dir/zig2.c.o
/Users/benlaird/dev/sys/zig/build/zig2.c:311599:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t0.f1 = zig_mulo_u64(&t0.f0, a0, a1, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:787:43: note: passing argument to parameter 'res' here
static inline bool zig_mulo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:311620:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t0.f1 = zig_addo_u64(&t0.f0, a0, a1, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:1177210:29: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
      t75.f1 = zig_subo_u64(&t75.f0, t62, t74, UINT8_C(64));
                            ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:1204920:8: warning: incompatible pointer types assigning to 'const uint16_t (*)[16]' (aka 'const unsigned short (*)[16]') from 'const uint16_t *' (aka 'const unsigned short *') [-Wincompatible-pointer-types]
   t26 = t25.ptr;
       ^ ~~~~~~~
/Users/benlaird/dev/sys/zig/build/zig2.c:1465197:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t15.f1 = zig_addo_u64(&t15.f0, t9, t14, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:1623663:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t0.f1 = zig_subo_u64(&t0.f0, a0, a1, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2289975:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t15.f1 = zig_subo_u64(&t15.f0, t4, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290025:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t15.f1 = zig_subo_u64(&t15.f0, t4, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290070:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t15.f1 = zig_subo_u64(&t15.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290077:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t24.f1 = zig_subo_u64(&t24.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290085:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t24.f1 = zig_addo_u64(&t24.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290120:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t24.f1 = zig_subo_u64(&t24.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290126:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t24.f1 = zig_addo_u64(&t24.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290294:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t16.f1 = zig_subo_u64(&t16.f0, t1, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290304:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t16.f1 = zig_addo_u64(&t16.f0, t1, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290349:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t16.f1 = zig_subo_u64(&t16.f0, t1, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290399:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t16.f1 = zig_subo_u64(&t16.f0, t1, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290409:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t16.f1 = zig_addo_u64(&t16.f0, t1, t0, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290453:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t16.f1 = zig_subo_u64(&t16.f0, t1, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290460:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t27.f1 = zig_subo_u64(&t27.f0, t0, t1, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290468:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t27.f1 = zig_addo_u64(&t27.f0, t0, t1, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290566:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t11.f1 = zig_subo_u64(&t11.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290573:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t12.f1 = zig_subo_u64(&t12.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290581:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t12.f1 = zig_addo_u64(&t12.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290613:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t12.f1 = zig_subo_u64(&t12.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2290619:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t12.f1 = zig_addo_u64(&t12.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2327395:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
  t11.f1 = zig_mulo_u64(&t11.f0, t7, t10, UINT8_C(64));
                        ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:787:43: note: passing argument to parameter 'res' here
static inline bool zig_mulo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2331388:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t22.f1 = zig_addo_u64(&t22.f0, t5, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2388583:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t5.f1 = zig_addo_u64(&t5.f0, t2, t4, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2588887:27: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    t24.f1 = zig_addo_u64(&t24.f0, t15, t16, UINT8_C(64));
                          ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2588955:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t24.f1 = zig_addo_u64(&t24.f0, t16, t15, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2845639:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t8.f1 = zig_addo_u64(&t8.f0, t4, t0, UINT8_C(64));
                        ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2845650:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_addo_u64(&t13.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:2845685:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_addo_u64(&t13.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3127253:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t8.f1 = zig_subo_u64(&t8.f0, t4, t0, UINT8_C(64));
                        ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3127264:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_subo_u64(&t13.f0, t0, t4, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3127299:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_subo_u64(&t13.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3136733:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t1.f1 = zig_addo_u64(&t1.f0, a0, t0, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3136739:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t5.f1 = zig_addo_u64(&t5.f0, t4, t0, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3136930:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t15.f1 = zig_subo_u64(&t15.f0, t3, t2, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3137008:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t8.f1 = zig_addo_u64(&t8.f0, t0, t4, UINT8_C(64));
                        ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3137019:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_addo_u64(&t13.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3137065:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t13.f1 = zig_addo_u64(&t13.f0, t4, t0, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3328202:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
   t15.f1 = zig_addo_u64(&t15.f0, t3, t2, UINT8_C(64));
                         ^~~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:571:43: note: passing argument to parameter 'res' here
static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3329382:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t1.f1 = zig_subo_u64(&t1.f0, a0, t0, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
/Users/benlaird/dev/sys/zig/build/zig2.c:3329388:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 t5.f1 = zig_subo_u64(&t5.f0, t4, t0, UINT8_C(64));
                      ^~~~~~
/Users/benlaird/dev/sys/zig/stage1/zig.h:679:43: note: passing argument to parameter 'res' here
static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
                                          ^
46 warnings generated.
[ 89%] Building C object CMakeFiles/zig2.dir/compiler_rt.c.o
[ 94%] Linking CXX executable zig2
ld: warning: ignoring duplicate libraries: '/opt/homebrew/opt/llvm/lib/libclangAST.a', '/opt/homebrew/opt/llvm/lib/libclangASTMatchers.a', '/opt/homebrew/opt/llvm/lib/libclangAnalysis.a', '/opt/homebrew/opt/llvm/lib/libclangParse.a', '/opt/homebrew/opt/llvm/lib/libclangSema.a', '/opt/homebrew/opt/llvm/lib/libclangStaticAnalyzerCheckers.a', '/opt/homebrew/opt/llvm/lib/libclangStaticAnalyzerCore.a', '/opt/homebrew/opt/llvm/lib/libclangStaticAnalyzerFrontend.a'
[ 94%] Built target zig2
[100%] Building stage3
[100%] Built target stage3
Install the project...
-- Install configuration: "Debug"
Stack trace of Zig compiling my project

Stack trace of ~/dev/sys/zig/build/stage3/bin/zig build run:

compiler_rt... unexpected errno: 60
/Users/benlaird/dev/sys/zig/lib/std/debug.zig:127:31: 0x1006bc653 in dumpCurrentStackTrace (zig)
        writeCurrentStackTrace(stderr, debug_info, io.tty.detectConfig(io.getStdErr()), start_addr) catch |err| {
                              ^
/Users/benlaird/dev/sys/zig/lib/std/os.zig:5670:40: 0x10041467f in unexpectedErrno (zig)
        std.debug.dumpCurrentStackTrace(null);
                                       ^
/Users/benlaird/dev/sys/zig/lib/std/os.zig:2622:45: 0x1005d9b13 in renameatZ (zig)
        else => |err| return unexpectedErrno(err),
                                            ^
/Users/benlaird/dev/sys/zig/lib/std/os.zig:2555:25: 0x1002b8c23 in renameat (zig)
        return renameatZ(old_dir_fd, &old_path_c, new_dir_fd, &new_path_c);
                        ^
/Users/benlaird/dev/sys/zig/lib/std/fs.zig:299:23: 0x1002b8a2f in rename (zig)
    return os.renameat(old_dir.fd, old_sub_path, new_dir.fd, new_sub_path);
                      ^
/Users/benlaird/dev/sys/zig/src/link.zig:1030:30: 0x1002b8d5b in renameTmpIntoCache (zig)
                std.fs.rename(
                             ^
/Users/benlaird/dev/sys/zig/src/Compilation.zig:2564:45: 0x1002f8c9b in update (zig)
        try comp.bin_file.renameTmpIntoCache(comp.local_cache_directory, tmp_dir_sub_path, o_sub_path);
                                            ^
/Users/benlaird/dev/sys/zig/src/main.zig:4279:24: 0x100325233 in updateModule (zig)
        try comp.update(main_progress_node);
                       ^
/Users/benlaird/dev/sys/zig/src/main.zig:5379:21: 0x100362d7b in cmdBuild (zig)
        updateModule(comp) catch |err| switch (err) {
                    ^
/Users/benlaird/dev/sys/zig/src/main.zig:295:24: 0x10017d64b in mainArgs (zig)
        return cmdBuild(gpa, arena, cmd_args);
                       ^
/Users/benlaird/dev/sys/zig/src/main.zig:223:20: 0x10017a7bb in main (zig)
    return mainArgs(gpa, arena, args);
                   ^
/Users/benlaird/dev/sys/zig/lib/std/start.zig:585:37: 0x10017a3bf in main (zig)
            const result = root.main() catch |err| {
                                    ^
???:?:?: 0x1891910df in ??? (???)
???:?:?: 0x6516ffffffffffff in ??? (???)
error: Unexpected
/Users/benlaird/dev/sys/zig/lib/std/os.zig:5672:5: 0x100414687 in unexpectedErrno (zig)
    return error.Unexpected;
    ^
/Users/benlaird/dev/sys/zig/lib/std/os.zig:2622:23: 0x1005d9b23 in renameatZ (zig)
        else => |err| return unexpectedErrno(err),
                      ^
/Users/benlaird/dev/sys/zig/lib/std/os.zig:2555:9: 0x1002b8c77 in renameat (zig)
        return renameatZ(old_dir_fd, &old_path_c, new_dir_fd, &new_path_c);
        ^
/Users/benlaird/dev/sys/zig/lib/std/fs.zig:299:5: 0x1002b8a5b in rename (zig)
    return os.renameat(old_dir.fd, old_sub_path, new_dir.fd, new_sub_path);
    ^
/Users/benlaird/dev/sys/zig/src/link.zig:1040:33: 0x1002b8da3 in renameTmpIntoCache (zig)
                    else => |e| return e,
                                ^
/Users/benlaird/dev/sys/zig/src/Compilation.zig:2564:9: 0x1002f8d97 in update (zig)
        try comp.bin_file.renameTmpIntoCache(comp.local_cache_directory, tmp_dir_sub_path, o_sub_path);
        ^
/Users/benlaird/dev/sys/zig/src/main.zig:4279:9: 0x1003252c3 in updateModule (zig)
        try comp.update(main_progress_node);
        ^
/Users/benlaird/dev/sys/zig/src/main.zig:5381:25: 0x100362e73 in cmdBuild (zig)
            else => |e| return e,
                        ^
/Users/benlaird/dev/sys/zig/src/main.zig:295:9: 0x10017d6d3 in mainArgs (zig)
        return cmdBuild(gpa, arena, cmd_args);
        ^
/Users/benlaird/dev/sys/zig/src/main.zig:223:5: 0x10017a813 in main (zig)
    return mainArgs(gpa, arena, args);
    ^
Zig environment

~/dev/sys/zig/build/stage3/bin/zig env:

{
 "zig_exe": "/Users/benlaird/dev/sys/zig/build/stage3/bin/zig",
 "lib_dir": "/Users/benlaird/dev/sys/zig/build/stage3/lib/zig",
 "std_dir": "/Users/benlaird/dev/sys/zig/build/stage3/lib/zig/std",
 "global_cache_dir": "/Users/benlaird/.cache/zig",
 "version": "0.12.0-dev.1604+caae40c21",
 "target": "aarch64-macos.14.1...14.1-none",
 "env": {
  "ZIG_GLOBAL_CACHE_DIR": null,
  "ZIG_LOCAL_CACHE_DIR": null,
  "ZIG_LIB_DIR": null,
  "ZIG_LIBC": null,
  "ZIG_BUILD_RUNNER": null,
  "ZIG_VERBOSE_LINK": null,
  "ZIG_VERBOSE_CC": null,
  "ZIG_BTRFS_WORKAROUND": null,
  "CC": null,
  "NO_COLOR": null,
  "XDG_CACHE_HOME": null,
  "HOME": "/Users/benlaird"
 }
}

Hopefully all this info helps! I'll create the GitHub repo I'm currently developing on later today, but it's essentially a copy of the lab template repo, stage branch with the addition of a cpp/src/lib dir with some basic .cpp and .h code, so I don't think it'll prove to be too much of a roadblock. Thanks again everyone for the help, and I thoroughly enjoy working with this community.

@Vexu Vexu changed the title Zig build error "Unexpected" Zig build error: renameatZ unexpected errno: TIMEDOUT Nov 13, 2023
@Vexu Vexu added the os-macos label Nov 13, 2023
@Vexu Vexu added this to the 0.13.0 milestone Nov 13, 2023
@SethArchambault
Copy link

SethArchambault commented Dec 19, 2023

Just ran into this:

brew install zig
==> Upgrading zig
  0.10.1 -> 0.11.0
zig init-exe
info: Created build.zig
info: Created src/main.zig
info: Next, try `zig build --help` or `zig build run`
zig build
zig build
error: Unexpected
zig build run
error: Unexpected

Heard about zig in 2019 and the idea of using it as a C build system - I tried briefly and ran into some issue, so I gave up at the time. 4 years later, figured I'd check it out again, as now I'm doing some cross platform stuff as I would like to not use batch files, it seems like a great use case, but ran into this error, even earlier this time.. On an M1 Mac, Ventura 13.6.2 (22G320)

Heard a lot about Zig over the years, I'm really down to try it, but I'll say it doesn't instill trust in me that this will save time in the long run when hitting a blocker this early in the guide.. https://ziglang.org/learn/getting-started/

Thanks for the work you're doing, appreciate the contribution to handmade development - looking forward to trying again sometime in the future!

@MadokaIII
Copy link

Hello guys,

I don't usually write on Github Issues like that but i had the literal same problem and found a consistent to reproduce it and to "fix" it.
I was trying to learn zig and to dive deep into the language but after some time i started consistently running into the classic error: Unexpected compilation issue.
I'm on a Macbook Air M1 on Sonoma.
I started suspecting ICloud as the troublemaker after reading somewhere (I can't remember where) that it could impact build systems...
So i looked for ways to negate its syncing capabilities and found this flag .nosync that you can add at the end of your root folder name so that ICloud just ignores those files.
After that zig build system never fails for no reason and everything went back to normal.

I hope this can help you guys fix it, I'm really interested in the project overall.
Good luck !

@ben-laird
Copy link
Author

My current workaround is just using Zig in a separate, local development directory (literally ~/dev/) as opposed to the development directory I have on iCloud (at ~/Desktop/.../Dev/). In the local dev directory, both Zig 0.11.0 from Homebrew and Zig nightly from source have been running just fine for months. My guess reading the error logs is that os.zig just doesn't treat accessing files from a remote location as async or doesn't give the operation enough time to fulfill properly. Zig is still good to use for our purposes and not broken, if I'm reading your comments correctly @SethArchambault and @MadokaIII.

As for negating sync capabilities, I don't know how keen I am to disable my entire iCloud dev directory's synchronization just because of a zig project or two, assuming that's actually what you're saying. I'd love to hear more about what you mean though @MadokaIII, especially if this helps narrow down what part of renameatZ in os.zig needs to be fixed.

@SethArchambault
Copy link

SethArchambault commented Jan 7, 2024

Ah I figured out the issue thanks to ya'll talking about folders-based issues.

I am using Parallels, and I have a shared folder set up, that exists primarily in Windows, but when parallels is running, it's accessible via Mac as well. if I try to use zig on the Mac while inside the shared folder, I see that this issue happens every time! (It's also possible that at the time I reported this I was using a folder on the mac that was being shared with parallels)

But that's actually not a problem for me, because I've learned that git doesn't work either (when running on the Macos side) because of a permissions issue, so I've gotten in the habit of only using vim while in the shared folder, and then using a separate macos folder for everything else.

So yeah, while I'd love a clearer error message, I get that this is an edge case, and it's possible I just got unlucky hitting an issue this early on.

I'll give it a shot and report back. Thanks!

Got it working with my current project! Thanks ya'll!

@MadokaIII
Copy link

MadokaIII commented Jan 8, 2024

As for negating sync capabilities, I don't know how keen I am to disable my entire iCloud dev directory's synchronization just because of a zig project or two, assuming that's actually what you're saying. I'd love to hear more about what you mean though @MadokaIII, especially if this helps narrow down what part of renameatZ in os.zig needs to be fixed.

"That's the neat thing you don't" need to. You just rename the root of your zig project as <name of project>.nosync and only this directory will be ignored by ICloud Sync which was good enough for me since i have them on github either way so I don't really care about iCloud and having .nosync at the end of my local project directory didn't bother me at all.

I hope this helps, again still a newbie, if I missed anything, I would appreciate it if you could correct me.

Good Luck!

@squeek502
Copy link
Collaborator

squeek502 commented Aug 17, 2024

This might be the relevant documentation: https://developer.apple.com/documentation/technotes/tn3150-getting-ready-for-data-less-files since it mentions:

Time-out errors (ETIMEDOUT) when invoking file system APIs

If so, then the "fix" might be to introduce a Mac-only error that's similar-in-spirit to the Windows-only error.AntivirusInterference added in 07c1dd3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior os-macos
Projects
None yet
Development

No branches or pull requests

6 participants