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

MacOs arm64 zig build - failed #85

Open
ego opened this issue Jul 6, 2024 · 7 comments
Open

MacOs arm64 zig build - failed #85

ego opened this issue Jul 6, 2024 · 7 comments

Comments

@ego
Copy link

ego commented Jul 6, 2024

❯ uname -a
Darwin MacBook-Pro-2 23.5.0 Darwin Kernel Version 23.5.0 RELEASE_ARM64_T6031 arm64

❯ zig version
0.13.0

capy on  master via  ↯ v0.13.0
❯ zig build
/.cache/zig/p/1220bc2612b57b0cfaaecbcac38e3144e5a9362ff668d71eb8334e895047bdbb7148/build.zig:9:33: error: no field named 'path' in union 'Build.LazyPath'
        .root_source_file = .{ .path = "stub.c" },
                                ^~~~
/opt/homebrew/Cellar/zig/0.13.0/lib/zig/std/Build.zig:2171:22: note: union declared here
pub const LazyPath = union(enum) {
                     ^~~~~
referenced by:
    runBuild__anon_15902: /opt/homebrew/Cellar/zig/0.13.0/lib/zig/std/Build.zig:2116:27
    dependencyInner__anon_14558: /opt/homebrew/Cellar/zig/0.13.0/lib/zig/std/Build.zig:2097:29
    remaining reference traces hidden; use '-freference-trace' to see all reference traces
/.cache/zig/p/1220c94dbcdf5a799ce2b1571978ff3c97bab1341fe329084fcc3c06e5d6375469b9/build.zig:7:56: error: no field named 'path' in union 'Build.LazyPath'
    _ = b.addModule("objc", .{ .root_source_file = .{ .path = "src/main.zig" } });
                                                       ^~~~
/opt/homebrew/Cellar/zig/0.13.0/lib/zig/std/Build.zig:2171:22: note: union declared here
pub const LazyPath = union(enum) {
                     ^~~~~
@Gogopex
Copy link

Gogopex commented Jul 8, 2024

that's from the zig-objc bindings and zig-build-macos-sdk being outdated

you can edit the cache files directly (obviously somewhat silly) or clone the dependencies and include them locally to fix this

I'll check if the build.zig.zon can be bumped, and/or if the deps themselves need to be updated

@ego
Copy link
Author

ego commented Jul 19, 2024

that's from the zig-objc bindings and zig-build-macos-sdk being outdated

you can edit the cache files directly (obviously somewhat silly) or clone the dependencies and include them locally to fix this

I'll check if the build.zig.zon can be bumped, and/or if the deps themselves need to be updated

Sorry for bothering, any updates?
I can't get how it's happens. Package manager with pinned version and it is didn't works properly.

@Gogopex
Copy link

Gogopex commented Jul 20, 2024

@ego I gave it a try, but even fixing these issues led me to seeing that the MacOS implementation is still very much in progress. I started working on it, but the breadth somewhat pushed me off.

Unless the capy contributors correct me, I believe MacOS support is simply not present ATM but should be coming!

@geon
Copy link
Contributor

geon commented Oct 17, 2024

It builds fine now with 0.13.0-dev.351+64ef45eb0. This issue should be closed.

@ego
Copy link
Author

ego commented Oct 18, 2024

Grab zig from zig-macos-x86_64-0.13.0-dev.351+64ef45eb0.tar.xz

❯ ./zig version
0.13.0-dev.351+64ef45eb0

❯ rm -r .zig-cache
❯ rm -r /Users/vladi/.cache/zig/

❯ ./zig build
/Users/vladi/.cache/zig/p/122034b3e15d582d8d101a7713e5f13c872b8b8eb6d9cb47515b8e34ee75e122630d/build.zig:13:28: error: no module named 'macos_sdk' available within module root.@dependencies.122034b3e15d582d8d101a7713e5f13c872b8b8eb6d9cb47515b8e34ee75e122630d
    if (add_paths) @import("macos_sdk").addPathsModule(objc);
                           ^~~~~~~~~~~
referenced by:
    runBuild__anon_15362: lib/std/Build.zig:2078:27
    dependencyInner__anon_14531: lib/std/Build.zig:2059:29
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

@geon
Copy link
Contributor

geon commented Oct 19, 2024

Hmm. I removed my cache and tried again, and now I can't build.

Not sure what I did to make it work earlier. Will investigate.

@geon
Copy link
Contributor

geon commented Oct 19, 2024

I tried again with zig build calculator and suddenly it worked. Then I deleted the cache and it failed building again. Feels like something in the zig build system is nondeterministic?

Just zig build won't work for the macos backend since so much is still missing. The calculator example is one of the few that compiles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants