# build.zig: bootstrap stage1 with zig0 · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/cc9eb9e90fec961a74e90e1ab3d66a7b8ec14f47)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: cc9eb9e90fec961a74e90e1ab3d66a7b8ec14f47

Requested commit: cc9eb9e90fec961a74e90e1ab3d66a7b8ec14f47

Commit: cc9eb9e90fec961a74e90e1ab3d66a7b8ec14f47

Tree: a6901d6182774785c24697d1232afb5696800955

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
build.zig: bootstrap stage1 with zig0

Instead of assuming that the zig version used with `zig build` is
appropriate for building the self-hosted compiler component, we follow
the same path as the cmake build script and build zig0, using that to
produce zig1.o, re-linking to produce stage1.

This allows an arbitrarily old Zig version and corresponding build.zig
script to build all future versions of Zig from source via the bootstrap
compiler. In other words, it allows us to use `zig build` as an
alternative to cmake when bootstrapping.

```

## Parents

- [2b3df5c81d8455856c2b355694ce818385218f36](https://git.cafe/gitcafe/zig/commit/2b3df5c81d8455856c2b355694ce818385218f36?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/cc9eb9e90fec961a74e90e1ab3d66a7b8ec14f47?format=markdown)
