# build.zig: use \`Step.UpdateSourceFiles\` for \`zig1.wasm\` · gitcafe/zig

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

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

Visibility: public

Requested revision: cd8fdd252d9ffd5bfb772cef49e4c79041872d38

Requested commit: cd8fdd252d9ffd5bfb772cef49e4c79041872d38

Commit: cd8fdd252d9ffd5bfb772cef49e4c79041872d38

Tree: 35e9647d4129edf2d4e5caf0b8233727d58765ab

Author: Matthew Lugg

Committer: Matthew Lugg

## Message

```
build.zig: use `Step.UpdateSourceFiles` for `zig1.wasm`

We were already using this for `stage1/zig.h`, but `stage1/zig1.wasm`
was being modified directly by the `wasm-opt` command. That's a bad idea
because it forces the build system to assume that `wasm-opt` has side
effects, so it is re-run every time you run `zig build update-zig1`,
i.e. it does not interact with the cache system correctly. It is much
better to create non-side-effecting `Run` steps (using `addOutput*Arg`)
where possible so that the build system has a more correct understanding
of the step graph.

```

## Parents

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

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