0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/build.zig
Jacob Young 580135241b build: update how changing the currently checked out commit is detected
Add support for building from a git worktree.

Previously, the compiler configure script was only rerun on changing
which branch is currently checked out. Now, any changes to the `HEAD`
reflog will be detected, which, happens to contain the commit hash of
the currently checked out commit on the last line, so will necessarily
have unique contents for any given commit. While there could be false
negatives due to the reflog being cleaned after a couple months, this
is not only unlikely to actually occur, involving a specific series
of steps over the course of a third of a year, the end result is that
the compiled compiler reports the wrong version, and can easily be
fixed by simply e.g. changing to another commit and back, something
which developers already frequently do. Additionally, the alternative
of having to hash longer and longer reflogs to detect a change on the
last line would hardly be preferable.
2026-06-30 21:41:44 -04:00

1618 lines
61 KiB