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.
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 inlib/compiler
for fmt.zig.Happy for this to be closed if unwanted.