capy-ui / capy

💻Build one codebase and get native UI on Windows, Linux and Web
https://capy-ui.org
Mozilla Public License 2.0
1.6k stars 59 forks source link

Can't build on Windows 11 - `zig build` has failed #90

Closed EliezerRamirezRuiz closed 1 month ago

EliezerRamirezRuiz commented 1 month ago

Hello everyone, I have encountered an error. I am still inexperienced in zig but I already have experience in other languages, so I proceed with the error I have.

I have made two versions of capy-ui , one from scratch and changing what the tutorial says and another the repository they offer.

When I try zig build run it does not work as the tutorial says, in neither of them. The error code I get is the following, thread 9416 panic: Deadlock detected:

PS C:\Users\ramir\Desktop\zig-template> zig build run 
warning: 'demo' is broken (disabled by default)
warning: 'dev-tools' is broken (disabled by default)
warning: 'fade' is broken (disabled by default)
warning: 'many-counters' is broken (disabled by default)
warning: 'notepad' is broken (disabled by default)
warning: 'osm-viewer' is broken (disabled by default)
warning: 'slide-viewer' is broken (disabled by default)
thread 9416 panic: Deadlock detected
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Thread\Mutex.zig:44:19: 0x4ecbf4 in lock (build.exe.obj)
    self.impl.lock();
                  ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Progress.zig:525:22: 0x51eca7 in lockStdErr (build.exe.obj)
    stderr_mutex.lock();
                     ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\debug.zig:84:28: 0x4d2f0e in lockStdErr (build.exe.obj)
    std.Progress.lockStdErr();
                           ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\debug.zig:94:15: 0x538f64 in print__anon_14350 (build.exe.obj)
    lockStdErr();
              ^
              ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\os\windows.zig:2770:24: 0x4ecacf in unexpectedError (build.exe.obj)
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\os\windows.zig:2770:24: 0x4ecacf in unexpectedError (build.exe.obj)
        std.debug.print("error.Unexpected: GetLastError({}): {}\n", .{
                       ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\os\windows.zig:1925:49: 0x64eafb in CreateProcessW (build.exe.obj)
            else => |err| return unexpectedError(err),
                                                ^
                                                ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:1298:34: 0x64e9d4 in windowsCreateProcess (build.exe.obj)
    return windows.CreateProcessW(
                                 ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:1197:37: 0x650581 in windowsCreateProcessPathExt (build.exe.obj)
            if (windowsCreateProcess(app_name_w.ptr, cmd_line_w.ptr, envp_ptr, cwd_ptr, lpStartupInfo, lpProcessInformation)) |_| {
                                    ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:920:36: 0x6112c6 in spawnWindows (build.exe.obj)
        windowsCreateProcessPathExt(self.allocator, &dir_buf, &app_buf, PATHEXT, &cmd_line_cache, envp_ptr, cwd_w_ptr, &siStartInfo, &piProcInfo) catch |no_path_err| {
                                   ^
    return windows.CreateProcessW(
                                 ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:1197:37: 0x650581 in windowsCreateProcessPathExt (build.exe.obj)
            if (windowsCreateProcess(app_name_w.ptr, cmd_line_w.ptr, envp_ptr, cwd_ptr, lpStartupInfo, lpProcessInformation)) |_| {
                                    ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:920:36: 0x6112c6 in spawnWindows (build.exe.obj)
        windowsCreateProcessPathExt(self.allocator, &dir_buf, &app_buf, PATHEXT, &cmd_line_cache, envp_ptr, cwd_w_ptr, &siStartInfo, &piProcInfo) catch |no_path_err| {
                                   ^
                                 ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:1197:37: 0x650581 in windowsCreateProcessPathExt (build.exe.obj)
            if (windowsCreateProcess(app_name_w.ptr, cmd_line_w.ptr, envp_ptr, cwd_ptr, lpStartupInfo, lpProcessInformation)) |_| {
                                    ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:920:36: 0x6112c6 in spawnWindows (build.exe.obj)
        windowsCreateProcessPathExt(self.allocator, &dir_buf, &app_buf, PATHEXT, &cmd_line_cache, envp_ptr, cwd_w_ptr, &siStartInfo, &piProcInfo) catch |no_path_err| {
                                   ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:1197:37: 0x650581 in windowsCreateProcessPathExt (build.exe.obj)
            if (windowsCreateProcess(app_name_w.ptr, cmd_line_w.ptr, envp_ptr, cwd_ptr, lpStartupInfo, lpProcessInformation)) |_| {
                                    ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:920:36: 0x6112c6 in spawnWindows (build.exe.obj)
        windowsCreateProcessPathExt(self.allocator, &dir_buf, &app_buf, PATHEXT, &cmd_line_cache, envp_ptr, cwd_w_ptr, &siStartInfo, &piProcInfo) catch |no_path_err| {
                                   ^
            if (windowsCreateProcess(app_name_w.ptr, cmd_line_w.ptr, envp_ptr, cwd_ptr, lpStartupInfo, lpProcessInformation)) |_| {
                                    ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:920:36: 0x6112c6 in spawnWindows (build.exe.obj)
        windowsCreateProcessPathExt(self.allocator, &dir_buf, &app_buf, PATHEXT, &cmd_line_cache, envp_ptr, cwd_w_ptr, &siStartInfo, &piProcInfo) catch |no_path_err| {
                                   ^
                                    ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:920:36: 0x6112c6 in spawnWindows (build.exe.obj)
        windowsCreateProcessPathExt(self.allocator, &dir_buf, &app_buf, PATHEXT, &cmd_line_cache, envp_ptr, cwd_w_ptr, &siStartInfo, &piProcInfo) catch |no_path_err| {
                                   ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:920:36: 0x6112c6 in spawnWindows (build.exe.obj)
        windowsCreateProcessPathExt(self.allocator, &dir_buf, &app_buf, PATHEXT, &cmd_line_cache, envp_ptr, cwd_w_ptr, &siStartInfo, &piProcInfo) catch |no_path_err| {
                                   ^
                                   ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:240:33: 0x5b255e in spawn (build.exe.obj)
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\process\Child.zig:240:33: 0x5b255e in spawn (build.exe.obj)
        return self.spawnWindows();
                                ^
        return self.spawnWindows();
                                ^
                                ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Build\Step\Run.zig:1254:24: 0x5d78cb in spawnChildAndCollect (build.exe.obj)
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Build\Step\Run.zig:1254:24: 0x5d78cb in spawnChildAndCollect (build.exe.obj)
        try child.spawn();
                       ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Build\Step\Run.zig:906:40: 0x5d804e in runCommand (build.exe.obj)
    const result = spawnChildAndCollect(run, argv, has_side_effects, prog_node) catch |err| term: {
                                       ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Build\Step\Run.zig:721:23: 0x578bc8 in make (build.exe.obj)
        try runCommand(run, argv_list.items, has_side_effects, output_dir_path, prog_node);
                      ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Build\Step.zig:182:13: 0x539fb0 in make (build.exe.obj)
    s.makeFn(s, prog_node) catch |err| switch (err) {
            ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\compiler\build_runner.zig:948:31: 0x4ed270 in workerMakeOneStep (build.exe.obj)
    const make_result = s.make(sub_prog_node);
                              ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Thread\Pool.zig:102:39: 0x4edb61 in runFn (build.exe.obj)
            @call(.auto, func, closure.arguments);
                                      ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Thread\Pool.zig:191:18: 0x57d1a8 in worker (build.exe.obj)
            runFn(&run_node.data);
                 ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Thread.zig:408:13: 0x538eac in callFn__anon_13958 (build.exe.obj)
            @call(.auto, f, args);
            ^
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib\std\Thread.zig:518:30: 0x4ec85e in entryFn (build.exe.obj)
                return callFn(f, self.fn_args);
                             ^
???:?:?: 0x7ff9559a257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ff9572aaf27 in ??? (ntdll.dll)
error: unable to read results of configure phase from 'C:\Users\ramir\Desktop\zig-template\.zig-cache\tmp\597b5743f8217b20': FileNotFound
0xtito commented 1 month ago

I have the same exact problem here (just with thread 28184), and am also running on Windows 11.

I installed zig and zigup using scoop, and am on Zig version 0.13.0-dev.351+64ef45eb0

tito in capy-template on   main
❯ zig build run
warning: 'demo' is broken (disabled by default)
warning: 'dev-tools' is broken (disabled by default)
warning: 'fade' is broken (disabled by default)
warning: 'many-counters' is broken (disabled by default)
warning: 'notepad' is broken (disabled by default)
warning: 'osm-viewer' is broken (disabled by default)
warning: 'slide-viewer' is broken (disabled by default)
thread 28184 panic: Deadlock detected
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Thread\Mutex.zig:44:19: 0x7bcba4 in lock (build.exe.obj)
    self.impl.lock();
                  ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Progress.zig:525:22: 0x7eec57 in lockStdErr (build.exe.obj)
    stderr_mutex.lock();
                     ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\debug.zig:84:28: 0x7a2f0e in lockStdErr (build.exe.obj)
    std.Progress.lockStdErr();
                           ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\debug.zig:94:15: 0x808f04 in print__anon_14351 (build.exe.obj)
    lockStdErr();
              ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\os\windows.zig:2770:24: 0x7bca7f in unexpectedError (build.exe.obj)
        std.debug.print("error.Unexpected: GetLastError({}): {}\n", .{
                       ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\os\windows.zig:1925:49: 0x92216b in CreateProcessW (build.exe.obj)
            else => |err| return unexpectedError(err),
                                                ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\process\Child.zig:1298:34: 0x922044 in windowsCreateProcess (build.exe.obj)
    return windows.CreateProcessW(
                                 ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\process\Child.zig:1197:37: 0x923bf1 in windowsCreateProcessPathExt (build.exe.obj)
            if (windowsCreateProcess(app_name_w.ptr, cmd_line_w.ptr, envp_ptr, cwd_ptr, lpStartupInfo, lpProcessInformation)) |_| {
                                    ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\process\Child.zig:920:36: 0x8dfc06 in spawnWindows (build.exe.obj)
        windowsCreateProcessPathExt(self.allocator, &dir_buf, &app_buf, PATHEXT, &cmd_line_cache, envp_ptr, cwd_w_ptr, &siStartInfo, &piProcInfo) catch |no_path_err| {
                                   ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\process\Child.zig:240:33: 0x88244e in spawn (build.exe.obj)
        return self.spawnWindows();
                                ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Build\Step\Run.zig:1254:24: 0x8a777b in spawnChildAndCollect (build.exe.obj)
        try child.spawn();
                       ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Build\Step\Run.zig:906:40: 0x8a7efe in runCommand (build.exe.obj)
    const result = spawnChildAndCollect(run, argv, has_side_effects, prog_node) catch |err| term: {
                                       ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Build\Step\Run.zig:721:23: 0x848ac8 in make (build.exe.obj)
        try runCommand(run, argv_list.items, has_side_effects, output_dir_path, prog_node);
                      ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Build\Step.zig:182:13: 0x809f50 in make (build.exe.obj)
    s.makeFn(s, prog_node) catch |err| switch (err) {
            ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\compiler\build_runner.zig:948:31: 0x7bd220 in workerMakeOneStep (build.exe.obj)
    const make_result = s.make(sub_prog_node);
                              ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Thread\Pool.zig:102:39: 0x7bdb11 in runFn (build.exe.obj)
            @call(.auto, func, closure.arguments);
                                      ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Thread\Pool.zig:191:18: 0x84d0a8 in worker (build.exe.obj)
            runFn(&run_node.data);
                 ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Thread.zig:408:13: 0x808e4c in callFn__anon_13959 (build.exe.obj)
            @call(.auto, f, args);
            ^
C:\Users\tito\scoop\persist\zigup\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Thread.zig:518:30: 0x7bc80e in entryFn (build.exe.obj)
                return callFn(f, self.fn_args);
                             ^
???:?:?: 0x7ffe8aa2257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffe8baaaf27 in ??? (ntdll.dll)
error: unable to read results of configure phase from 'C:\Users\tito\zig\testing\capy-template\.zig-cache\tmp\2c7d9d450fd21552': FileNotFound
EliezerRamirezRuiz commented 1 month ago

thank you friend for responding, I'm glad to know that I'm not the only one. Although I tried to fix the problem with guides and solutions from stackoverflow among others, I did not come up with a solution. I hope someone can help me as soon as possible because I do not know if it is zig or capy problem.

nothke commented 1 month ago

Tried all the different builds myself as well, I keep getting the same issue 😢

zenith391 commented 1 month ago

Fixed by 2de52661c26dc5d7c97b6a8a37b01caa018b6d6e.