stdenv: set the phase in showPhaseHeader

This commit is contained in:
Philip Taron 2024-08-02 14:07:03 -07:00
parent 3b5460f093
commit bbb9f2f1c9
No known key found for this signature in database

View File

@ -1597,6 +1597,13 @@ distPhase() {
showPhaseHeader() {
local phase="$1"
echo "Running phase: $phase"
# The Nix structured logger allows derivations to update the phase as they're building,
# which shows up in the terminal UI. See `handleJSONLogMessage` in the Nix source.
if [[ -z ${NIX_LOG_FD-} ]]; then
return
fi
printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD"
}
@ -1629,8 +1636,6 @@ runPhase() {
if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then return; fi
if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then return; fi
nixLog "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }"
showPhaseHeader "$curPhase"
dumpVars