ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
35.12k stars 2.56k forks source link

fmt: add -fjit flag to zig fmt #22028

Open 87flowers opened 6 days ago

87flowers commented 6 days ago

There wasn't really a "good" way to do this. Realistically, I would want to move src/fmt.zig back to lib/compiler/fmt.zig, but one would not be able to @import it from there. Moving lib into src/ would be a bit extreme. One could also consider moving main.zig into the repository root. Another possible option I considered was for src/fmt.zig to be copied to the destination libdir by build.zig (but one has to consider what happens with -Dno-lib builds).

This implementation assumes that a src directory is available in a parent i.e. we are in a zig build tree. If this assumption fails, we fall back to looking in lib/compiler for fmt.zig.

Happy for this to be closed if unwanted.