# std.Build: Deprecate \`Step.Compile\` APIs that mutate the root module · gitcafe/zig

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

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

Visibility: public

Requested revision: 413179ccfca32691504805d04ab1359104d22144

Requested commit: 413179ccfca32691504805d04ab1359104d22144

Commit: 413179ccfca32691504805d04ab1359104d22144

Tree: 1a7f3db794f5de61162a981111e97dc9e0169565

Author: Carl Åstholm

Committer: Carl Åstholm

## Message

```
std.Build: Deprecate `Step.Compile` APIs that mutate the root module

Not only are `Step.Compile` methods like `linkLibC()` redundant because
`Module` exposes the same APIs, it also might not be immediately obvious
to users that these methods modify the underlying root module, which can
be a footgun and lead to unintended results if the module is exported to
package consumers or shared by multiple compile steps.

Using `compile.root_module.link_libc = true` makes it more clear to
users which of the compile step and the module owns which options.

```

## Parents

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

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