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 60 forks source link

Fails to build on linux #71

Closed LukeSSJ closed 8 months ago

LukeSSJ commented 8 months ago

When running 'zig build run' on linux x86_64 I get the following error:

/home/luke/.cache/zig/p/12201751d2094cde9630bc080e6ce1d8982ff03bdd30a3103abd21321a8361a7e39d/android/build/auto-detect.zig:158:13: error: local variable is never mutated
        var android_studio_key: HKEY = for ([_]HKEY{ HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }) |root_key| {
            ^~~~~~~~~~~~~~~~~~
/home/luke/.cache/zig/p/12201751d2094cde9630bc080e6ce1d8982ff03bdd30a3103abd21321a8361a7e39d/android/build/auto-detect.zig:158:13: note: consider using 'const'
/home/luke/.cache/zig/p/12201751d2094cde9630bc080e6ce1d8982ff03bdd30a3103abd21321a8361a7e39d/build_capy.zig:103:20: error: no field or member function named 'do' in 'http.Server.Response'
            try res.do();
                ~~~^~~
/usr/local/bin/zig-folder/lib/std/http/Server.zig:295:22: note: struct declared here
pub const Response = struct {
                     ^~~~~~
referenced by:
    make: /home/luke/.cache/zig/p/12201751d2094cde9630bc080e6ce1d8982ff03bdd30a3103abd21321a8361a7e39d/build_capy.zig:65:54
    create: /home/luke/.cache/zig/p/12201751d2094cde9630bc080e6ce1d8982ff03bdd30a3103abd21321a8361a7e39d/build_capy.zig:38:40
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

This is using the capy starter template without any modifications (https://github.com/capy-ui/zig-template)

OS: Pop!_OS 22.04 LTS GNOME Version: 42.9 Windowing system: X11

Ziq version: 0.12.0-dev.1856+94c63f31f (also tried 0.11 and got the same error).

Thanks in advance.

Narven commented 8 months ago

I get the same on macos M3

❯ zig build run
/Users/pedroluz/.cache/zig/p/12201751d2094cde9630bc080e6ce1d8982ff03bdd30a3103abd21321a8361a7e39d/build_capy.zig:103:20: error: no field or member function named 'do' in 'http.Server.Response'
            try res.do();
                ~~~^~~
/Users/pedroluz/.local/bin/zig/lib/std/http/Server.zig:295:22: note: struct declared here
pub const Response = struct {
                     ^~~~~~
referenced by:
    make: /Users/pedroluz/.cache/zig/p/12201751d2094cde9630bc080e6ce1d8982ff03bdd30a3103abd21321a8361a7e39d/build_capy.zig:65:54
    create: /Users/pedroluz/.cache/zig/p/12201751d2094cde9630bc080e6ce1d8982ff03bdd30a3103abd21321a8361a7e39d/build_capy.zig:38:40
    remaining reference traces hidden; use '-freference-trace' to see all reference traces                                              /5.5s

Apple M3 Max Macos 14.2.1 (23C71)

zenith391 commented 8 months ago

Oh that's because I haven't updated zig-template to use latest Capy version

Narven commented 8 months ago

Now I'm getting:

❯ zig build run
zig build-exe capy-template Debug native: error: the following command failed with 2 compilation errors:
/Users/pedroluz/.local/bin/zig/zig build-exe /Users/pedroluz/Projects/grideltd/fooz/src/main.zig -lobjc -lc --cache-dir /Users/pedroluz/Projects/grideltd/fooz/zig-cache --global-cache-dir /Users/pedroluz/.cache/zig --name capy-template --mod zigimg::/Users/pedroluz/.cache/zig/p/12208a38cfabbe54287c076a9532b9f106e4b7122f66f75bccbd90d7dc5c31020384/vendor/zigimg/zigimg.zig --mod capy:zigimg,zigwin32:/Users/pedroluz/.cache/zig/p/12208a38cfabbe54287c076a9532b9f106e4b7122f66f75bccbd90d7dc5c31020384/src/main.zig --mod zigwin32::/Users/pedroluz/.cache/zig/p/12208a38cfabbe54287c076a9532b9f106e4b7122f66f75bccbd90d7dc5c31020384/vendor/zigwin32/win32.zig --deps zigwin32,capy -framework CoreFoundation -framework AppKit -framework ApplicationServices -framework CoreData -framework Foundation --subsystem native --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run capy-template transitive failure
   └─ zig build-exe capy-template Debug native 2 errors
/Users/pedroluz/.cache/zig/p/12208a38cfabbe54287c076a9532b9f106e4b7122f66f75bccbd90d7dc5c31020384/src/components/Label.zig:9:19: error: root struct of file 'backend' has no member named 'Label'
    peer: ?backend.Label = null,
           ~~~~~~~^~~~~~
/Users/pedroluz/.cache/zig/p/12208a38cfabbe54287c076a9532b9f106e4b7122f66f75bccbd90d7dc5c31020384/src/backend.zig:1:1: note: struct declared here
const std = @import("std");
^~~~~
referenced by:
    Label: /Users/pedroluz/.cache/zig/p/12208a38cfabbe54287c076a9532b9f106e4b7122f66f75bccbd90d7dc5c31020384/src/components/Label.zig:6:19
    usingnamespace_0: /Users/pedroluz/.cache/zig/p/12208a38cfabbe54287c076a9532b9f106e4b7122f66f75bccbd90d7dc5c31020384/src/components/Label.zig:7:55
    remaining reference traces hidden; use '-freference-trace' to see all reference traces
/Users/pedroluz/.cache/zig/p/12208a38cfabbe54287c076a9532b9f106e4b7122f66f75bccbd90d7dc5c31020384/src/data.zig:419:145: error: no field or member function named 'cmpxchg' in 'atomic.Atomic.Atomic(bool)'
            if ((if (@hasDecl(atomicValue(bool), "cmpxchgStrong")) self.bindLock.cmpxchgStrong(false, true, .SeqCst, .SeqCst) else self.bindLock.cmpxchg(true, false, true, .SeqCst, .SeqCst) // support zig 0.11 as well as current master
                                                                                                                                   ~~~~~~~~~~~~~^~~~~~~~
/Users/pedroluz/.local/bin/zig/lib/std/atomic/Atomic.zig:8:19: note: struct declared here
    return extern struct {
           ~~~~~~~^~~~~~    
zenith391 commented 8 months ago

@Narven Yes, capy does not yet support macOS: see zig-template#6