From owner-dev-commits-src-all@freebsd.org Sun Jan 24 05:02:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 088524ED881; Sun, 24 Jan 2021 05:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DNgq36sC2z4WKs; Sun, 24 Jan 2021 05:02:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE0E91DFD5; Sun, 24 Jan 2021 05:02:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10O52dkp072238; Sun, 24 Jan 2021 05:02:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10O52dZD072237; Sun, 24 Jan 2021 05:02:39 GMT (envelope-from git) Date: Sun, 24 Jan 2021 05:02:39 GMT Message-Id: <202101240502.10O52dZD072237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: ca212d911585 - stable/12 - stand: properly declare subdir deps or .WAIT, do parallel build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ca212d9115856036f8001ba6a0c9c326479caf20 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2021 05:02:40 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ca212d9115856036f8001ba6a0c9c326479caf20 commit ca212d9115856036f8001ba6a0c9c326479caf20 Author: Kyle Evans AuthorDate: 2020-12-31 17:15:45 +0000 Commit: Kyle Evans CommitDate: 2021-01-24 05:02:14 +0000 stand: properly declare subdir deps or .WAIT, do parallel build buildworld already runs the stand build in parallel[1], so make it easier to identify ordering issues by properly establishing dependencies or adding .WAIT where needed. Everything in stand/ relies on libsa, either directly or indirectly, because libsa build is where the stand headers get installed and it gets linked in most places. Interpreters depend on their libs, machine dirs usually depend on top-level libs that are getting built and at least one of the interpreter flavors. For i386, order btx/libi386/libfirewire before everything else using a big-ol-.WAIT hammer. btx is the most common dependency, but the others are used sporadically. This seems to be where the race reporting on the mailing list is- AFAICT, the following sequence is happening: 1.) One of the loaders gets built based on stale btx/btxldr 2.) btx/btxldr gets rebuilt 3.) installworld triggers loader rebuild because btx was rebuilt after This seems like the most plausible explanation, as they've verified system time and timestamps. While we're here, let's switch stand/ over to a completely parallel build so we can work out these kinds of issues in isolation rather than in the middle of a larger build. (cherry picked from commit ac5f382a9d0a26685b92b49abb845d3b30ea5f91) (cherry picked from commit 8b4c3a03f933b77b65c78fdef976831d27942d9d) (cherry picked from commit e41367e3ae1246c2b086f9f920a175108aa72380) --- stand/Makefile | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- stand/Makefile.amd64 | 4 ++++ stand/Makefile.inc | 2 ++ stand/efi/Makefile | 6 +++++- stand/i386/Makefile | 13 ++++++++++--- 5 files changed, 68 insertions(+), 7 deletions(-) diff --git a/stand/Makefile b/stand/Makefile index bacf39e26eca..c5c7ca60375a 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -6,27 +6,55 @@ # others we don't. LIB32LIST is a list of libraries, which if # included, need to be built 32-bit as well. .if ${MACHINE_ARCH} == "amd64" -LIB32LIST=libsa ficl liblua +LIB32LIST=libsa +.if ${MK_FORTH} != "no" +LIB32LIST+= ficl +.endif +.if ${MK_LOADER_LUA} != "no" +LIB32LIST+= liblua +.endif .endif S.yes+= libsa +S.${MK_LOADER_OFW}+= libofw +S.${MK_FDT}+= fdt + S.${MK_FORTH}+= ficl S.${MK_FORTH}+= forth S.${MK_LOADER_LUA}+= liblua S.${MK_LOADER_LUA}+= lua -S.${MK_FDT}+= fdt -S.${MK_LOADER_OFW}+= libofw S.yes+= defaults S.yes+= man +.if ${MK_FORTH} != "no" +INTERP_DEPENDS+= forth +.endif +.if ${MK_LOADER_LUA} != "no" +INTERP_DEPENDS+= lua +.endif + .include S.${MK_EFI}+= efi S.${MK_LOADER_UBOOT}+= uboot +.if defined(LIB32LIST) +LIB32DEPENDS= ${LIB32LIST:S/$/32/} +.endif + .if exists(${.CURDIR}/${MACHINE}/.) S.yes+= ${MACHINE} +SUBDIR_DEPEND_${MACHINE}+= ${INTERP_DEPENDS} +.if ${MK_FDT} != "no" +SUBDIR_DEPEND_${MACHINE}+= fdt +.endif +.if ${MK_LOADER_UBOOT} != "no" +SUBDIR_DEPEND_${MACHINE}+= uboot +.endif +.if ${MK_LOADER_OFW} != "no" +SUBDIR_DEPEND_${MACHINE}+= libofw +.endif .endif # Build the actual subdir list from S.yes, adding in the 32-bit @@ -36,6 +64,22 @@ SUBDIR+=${_x} .if defined(LIB32LIST) && ${LIB32LIST:M${_x}} SUBDIR+=${_x}32 .endif +.if ${_x} != "libsa" +SUBDIR_DEPEND_${_x}+= libsa +SUBDIR_DEPEND_${_x}32+= libsa32 +.endif .endfor +# Remaining dependencies +SUBDIR_DEPEND_libsa32+= libsa + +SUBDIR_DEPEND_forth+= ficl +SUBDIR_DEPEND_lua+= liblua + +.if ${MK_FDT} != "no" +SUBDIR_DEPEND_efi+= fdt +.endif + +SUBDIR_PARALLEL= yes + .include diff --git a/stand/Makefile.amd64 b/stand/Makefile.amd64 index b2b918ebed5b..9ee3649071b2 100644 --- a/stand/Makefile.amd64 +++ b/stand/Makefile.amd64 @@ -2,3 +2,7 @@ S.yes+= userboot S.yes+= i386 + +SUBDIR_DEPEND_userboot+= ${INTERP_DEPENDS} +# These won't get tacked on in an amd64 build +SUBDIR_DEPEND_i386+= ${LIB32DEPENDS} ${INTERP_DEPENDS} diff --git a/stand/Makefile.inc b/stand/Makefile.inc index d7b9d228287e..aa7cfa14542f 100644 --- a/stand/Makefile.inc +++ b/stand/Makefile.inc @@ -1,3 +1,5 @@ # $FreeBSD$ +SUBDIR_PARALLEL= yes + .include "defs.mk" diff --git a/stand/efi/Makefile b/stand/efi/Makefile index 2e0daba6dab8..9ab6aa4291fb 100644 --- a/stand/efi/Makefile +++ b/stand/efi/Makefile @@ -8,8 +8,12 @@ NO_OBJ=t # than 4.5 supports it. .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 +SUBDIR.yes+= libefi SUBDIR.${MK_FDT}+= fdt -SUBDIR.yes+= libefi boot1 gptboot +SUBDIR.yes+= .WAIT + +SUBDIR.yes+= boot1 gptboot + SUBDIR.${MK_FORTH}+= loader_4th SUBDIR.${MK_LOADER_LUA}+= loader_lua SUBDIR.yes+= loader_simp diff --git a/stand/i386/Makefile b/stand/i386/Makefile index 2a9ead4c8e72..2b628d408d1e 100644 --- a/stand/i386/Makefile +++ b/stand/i386/Makefile @@ -4,10 +4,15 @@ NO_OBJ=t .include -SUBDIR.yes= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ - isoboot libi386 - +# Almost everything else here relies on btxldr, so we must make sure it's built +# before everything else proceeds so we don't end up building against a stale +# btxldr and ending up with a build-during-install scenario. +SUBDIR.yes+= btx libi386 SUBDIR.${MK_LOADER_FIREWIRE}+= libfirewire +SUBDIR.yes+= .WAIT + +SUBDIR.yes+= mbr pmbr boot0 boot0sio boot2 cdboot gptboot \ + isoboot SUBDIR.${MK_FORTH}+= loader_4th SUBDIR.${MK_LOADER_LUA}+= loader_lua @@ -22,4 +27,6 @@ SUBDIR.yes+= kgzldr SUBDIR.${MK_LOADER_ZFS}+= zfsboot gptzfsboot +SUBDIR_DEPEND_pxeldr+= loader_${LOADER_DEFAULT_INTERP} + .include