2024-11-09 22:43:49 +02:00
2024-11-09 16:00:34 +02:00
2024-11-01 09:33:22 +02:00
2024-11-01 09:33:22 +02:00
2024-11-08 16:47:27 +02:00
2024-11-09 22:43:49 +02:00

Building modern Zig from the original C++ implementation

This repository explores building Zig from the C++ implementation without using binary blobs. Forum post goes with this.

Clone zig and prune binary files from history:

$ git clone https://github.com/ziglang/zig zig2
$ cd zig2
$ git filter-repo --prune-empty=never --prune-degenerate never --invert-paths --path-glob 'stage1/zig1.wasm*' --path stage1/zig1.c

Now build an isolated container with a bunch of zig historic dependencies:

$ docker build -t zig-repro .
$ docker run -ti --rm \
    -v ~/code:/x \
    -v /home/$USER/.cache/zig:/home/$USER/.cache/zig \
    -w /x/zig2 \
    zig-repro \
    sh -c "useradd -s /bin/bash -u $UID $USER && su $USER; bash"

And run the thing in the container:

$ ../zig-repro/run
Description
No description provided
Readme 326 KiB
Languages
Shell 97.8%
Dockerfile 2.2%