Skip to content

"zig-0.11.0" branch, build.zig "unsupported arch" error with Zig 0.11.0-dev.3381+9ee0a706d. #18

Closed
@jwstolk

Description

@jwstolk

The wasm32 target in the "zig-0.11.0" branch fails with my Zig version: 0.11.0-dev.3381+9ee0a706d.
This is the version currently installed by "snap install zig --classic --edge" on Ubuntu 22.04.2 LTS.

I made some small changes since .install() and .dependOn() properties seem to have changed in my Zig.
( build.zig diff: https://pastebin.com/dCgzXZiM )
The local Linux binary builds and runs, after installing the required C libraries.

The -Drelease-small option is not supported by my Zig 0.11 so I left it out, running:

zig build -Dtarget=wasm32-emscripten --sysroot emsdk/upstream/emscripten/cache/sysroot

I get the "unsupported arch" error, also mentioned here: ziglang/zig#10836
That issue indicates that the problem can be reproduced by removing "wasm32_freestanding_target.os_tag = .freestanding;" line, however, the https://github.com/floooh/pacman.zig/blob/zig-0.11.0/build.zig file does have that line, and still reproduces the error.

The instructions and comments in build.zig indicate that some hacks are required. I did not take any additional manual steps and assumed that the hacks are implemented in the build.zig.

It is very possible that I made mistakes in my changes of build.zig. If not, the used Zig version may be the cause. (or maybe snaps installs a version that is already too old)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions