The build system suddenly spends a lot of time in "Configure"

For a few days now, every time I run zig build in my project it appears to spend ~6 seconds in the “Configure” phase before even starting the build steps:
Screenshot at 2025-11-14 19-15-10

It only seems to happen within my project (it also happens if I reclone it), but not in a new zig inited project. Does anyone know what Zig does during that step? Has anyone else encountered this in the past?

I haven’t changed anything on my system, particularly I did not update the compiler (I’m currently stuck on version 0.15.0-dev.1034+bd97b6618) and my build.zig didn’t change in a relevant way in the past 2 weeks.

1 Like

This phase is running your, and your dependencies’, build.zig.

The only thing I can think of, that you didn’t already mention, would be if you updated a dependency and its build.zig is taking longer.

1 Like

Maybe you can use --time-report to see what is taking a long time?

It doesn’t look to me as if that currently shows anything about the configure phase, but maybe it gives a clue anyhow?

Also might make sense if the time report also included timings about the execution of the build runner and the configure and make phases, but I don’t know how feasible it would be to include that in the time report.


Another option to get more insight might be to use the tracy that is included in the compiler (I think it requires building the compiler with tracy enabled), but I haven’t tried that so I don’t know whether it would show useful information for this problem.

1 Like

Indeed that was the problem, I added a dependency to a fork of the zig repo to use a modified test runner (I do it like this to make updating easier through the use of git rebase) and didn’t expect it to run the build.zig automatically. I removed the build.zig from the repo which fixed the issue.

Also I wonder if there is a way to disable the running of build.zig for dependencies.

Sadly that is not available in the zig version I’m using. I ended up just using git bisect to find the problem.

1 Like

You can make the dependency lazy, but that also prevents you from using it before asking for it, at which point its build.zig will be run.

Depending on what it’s doing that’s taking so long, you can put that behind a flag so it’s only done if you need it.

Hmm, I already did make it a lazy dependency. But I don’t have it behind an if statement, since I don’t want to hide the testing step behind a build flag.