-
Notifications
You must be signed in to change notification settings - Fork 173
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 template doesn't build #685
Comments
If you use 0.11.0, this version of the template should work: https://github.com/aduros/wasm4/tree/4f840a0cb73b16a57ca348569e48ca2bc91b439f/cli/assets/templates/zig Not sure why someone upgrade to 0.12.0 which is a moving target with no stability guarantees. |
Because that's what Zig recommends? From the Getting Started:
|
Fair enough, just means regular PRs. But I also get the staleness problem. Just a harder problem for libraries. This is a good read on a middle ground: https://devlog.hexops.com/2024/announcing-nominated-zig/ |
I was having some problems to build on version 0.13.0 and was able to execute it by changing
const exe = b.addExecutable(.{
.name = "cart",
.root_source_file = .{ .path = "src/main.zig" },
.target = b.resolveTargetQuery(.{
.cpu_arch = .wasm32,
.os_tag = .freestanding,
}),
.optimize = b.standardOptimizeOption(.{}),
});
const exe = b.addExecutable(.{
.name = "cart",
.root_source_file = .{ .cwd_relative = "src/main.zig" },
.target = b.resolveTargetQuery(.{
.cpu_arch = .wasm32,
.os_tag = .freestanding,
}),
.optimize = b.standardOptimizeOption(.{}),
}); |
@phcarvalho Note that you should do So something along these lines: const exe = b.addExecutable(.{
.name = "cart",
.root_source_file = b.path("src/main.zig"),
.target = b.resolveTargetQuery(.{
.cpu_arch = .wasm32,
.os_tag = .freestanding,
}),
.optimize = .ReleaseSmall,
}); |
after doing
w4 new --zig test
and tryingzig build -Doptimize=ReleaseSmall
I get this:And even with Zig 0.11.0 it fails:
Removing the
exe.entry = .disabled;
line makes matters even worse:The text was updated successfully, but these errors were encountered: