mach icon indicating copy to clipboard operation
mach copied to clipboard

getting-started: error running the getting started examples

Open sstitle opened this issue 3 months ago • 2 comments

Before filing an issue, please make sure you're using a supported Zig version: https://machengine.org/about/zig-version

While trying to follow the "Getting Started" instructions from the website here: https://machengine.org/

I am seeing this error when I run on MacOS:

➜  mach git:(main) zig build run-core-textured-cube
/Users/samtitle/personal/mach/build.zig.zon:2:13: error: expected enum literal
    .name = "mach",
            ^~~~~~

I am using the latest Zig version: 0.15.1

If this is an unsupported Zig version, then maybe there could be a more clear error about a Zig version mismatch in the build steps? Or a more clear guide to how to downgrade Zig to a compatible version in the getting started steps?

sstitle avatar Oct 04 '25 15:10 sstitle

Please note the first sentence of your issue:

Before filing an issue, please make sure you're using a supported Zig version: https://machengine.org/about/zig-version

0.15.1 isn't supported, it's likely that this is the issue. See https://machengine.org/docs/nominated-zig/ for details on nominated versions. Not sure why this wasn't caught by the build system or earlier in the compilation, I recall a clear error message being thrown in such cases.

Re downgrading, many people seem to use anyzig. Downloading the older version through the VS Code plugin might also work. I only have the nominated version installed right now, so I can't help you with any details.

msg-programs avatar Oct 04 '25 18:10 msg-programs

Hello, thanks for your response!

I understand that it's not always possible to provide support for the most up-to-date version of certain languages or dependencies, but in those cases, I think it's nice to provide detail on the "getting started" information page about installing the dependencies correctly. Without this, the "getting started" guide is a little user unfriendly in my opinion.

I think providing information about using anyzig and the "minimum compatible zig version" parameter would be one solution.

Another solution would be providing a reproducible build environment for the supported zig version. I have created this pull request with a shell.nix file. In my opinion, this could be a better way to give new users a more seamless first experience in the repo. https://github.com/hexops/mach/pull/1432

sstitle avatar Oct 05 '25 21:10 sstitle