git: 187d696a0aa0 - main - bsd.progs.mk: Create directories first

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Wed, 10 Jul 2024 14:47:27 UTC
The branch main has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=187d696a0aa0fba9e9a7b6b20c72799cf8a2e0cf

commit 187d696a0aa0fba9e9a7b6b20c72799cf8a2e0cf
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2024-07-08 16:30:28 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2024-07-10 14:47:18 +0000

    bsd.progs.mk: Create directories first
    
    Order installdirs before the $p.install targets; this is necessary
    when a user of <bsd.progs.mk> also creates the directory into which
    the binaries are installed.
    
    In particular, without this patch running `make installworld -jN` can
    break when installing tests since the /usr/tests/foo/bar directories
    are created during installworld; this has been causing the stable/14
    weekly snapshot builds to intermittently fail for months.
    
    MFC after:      5 minutes
    Sponsored by:   Amazon
    Differential Revision:  https://reviews.freebsd.org/D45923
---
 share/mk/bsd.progs.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk
index 1551516dd6ea..44191d1c56df 100644
--- a/share/mk/bsd.progs.mk
+++ b/share/mk/bsd.progs.mk
@@ -155,6 +155,7 @@ $p.$t: .PHONY .MAKE ${_PROGS_COMMON_OBJS}
 	    NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS=t \
 	    ${_PROG_MK.${t}} PROG=$p ${x.$p} ${@:E})
 .endfor
+.ORDER installdirs $p.install
 .endfor
 
 # Depend main pseudo targets on all PROG.pseudo targets too.