From 8604ca170a45459862a8ffd55391d293873785f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 2 Jan 2025 16:25:19 +0200 Subject: [PATCH] link to write-up --- README.md | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 4d934d1..9a5d98c 100644 --- a/README.md +++ b/README.md @@ -4,32 +4,10 @@ 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][1]. -Clone zig and prune binary files from history: +This works up to Zig 0.11. Guix [picked it up and went all the way to 0.13.0 +and beyond](https://issues.guix.gnu.org/74217). If you want a kosher +`zig1.wasm`, you can take it from Guix, free of charge, right now. -``` -$ git clone https://github.com/ziglang/zig zig2 -$ cd zig2 -$ git config user.name "$(git config --get user.name)" -$ git config user.email "$(git config --get user.email)" -$ 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 --name zig-repro \ - -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 -``` +Also see my [write-up](https://jakstys.lt/2024/zig-reproduced-without-binaries/). [1]: https://ziggit.dev/t/building-self-hosted-from-the-original-c-implementation/6607/11