From nobody Mon Feb 10 22:23:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YsJxq0Gn7z5mtVh; Mon, 10 Feb 2025 22:23:27 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YsJxp6mXkz3gK8; Mon, 10 Feb 2025 22:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739226207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Ejd4UByDXXs26gV6IwQaqT0YAI1RWXG9tDNaDOtauc=; b=Ih43qFOetPqDLnSN0q/c41NPH3qILeCiY5IWptG0ZhNVCWOEhlfFOBrlwmi2j3zGa3+XAb 3vLzvVHkiUXuGYqm9QmKGE5K9DVsv+idLHWE1VxXRVq53DzGHanfukR7Zf1XTXP/1YgOOF u3cKtJgrID7At/teUkDKu2GbQgrKTkm63NA/siKYyOSFqsb69SE/U364JdZjXdViwWgysa 8LFWfv/BDLR8RJhBqKTIQuSKw4yvvbRXuupWqWzH2gC+eiYa5rLOJ2pol607XDTnOI6mX0 AOPUicMqqVCkRsyJ0rlBeOPRhroK4z5X6fwOvSUb7T9QpsrIx9ccLrDJTcGPOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739226207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Ejd4UByDXXs26gV6IwQaqT0YAI1RWXG9tDNaDOtauc=; b=SH8bxL6npO9uVUzpJZSmGc1Lov3KUCCF2teQZ6hHjfkFLQvV5ENHe+waUY4NF3hHpch4dQ D1zfljtTOUB+JL6nbR7yRaewb1QBcn9QIJXAOqaEecrmLiLjWLOk+UEyiojSIgINmU8TKh XkzxepDlhTZnZTGtltb9knEBSvN4BzBzVwlymrIxyJr8v+B+d3l5QLQUH/t5ZlvyMPjcsL svKoA7JcySPO1s1V7CNE8Gop+Xl5vwkMQh/oVZldcXfIigV8VzYRlXnbeuTHubKB1YHYrT P3CThiWqfDZQ/2qSd1omIlmNFXk6+s5NQt5nq5tCKMR/mDopSxHMYqbls5G9UQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739226207; a=rsa-sha256; cv=none; b=eUSVwaIQxBQHEJF7UdANPLDK+nFR2BnAXr+WPk+gcFF6LvHFWodKX7S/Ylyn8S7os0kP0/ wezTWZ590IlTi8jRY7u3zsE+BEi4jqQdYb9sEWCEdDMyY8eJEKMb4LMl0m5IT5ZumljS28 2ywojBqa+SxxTl13N5TTfSRn8aZhaBui8EVJl93+bs4qfhKttY+OopgujPgifVel4dMULp DqPrSVa8LdxPh4XcC+LGdg6C1J2muTCjf+mv+yGYPyDu2llkSRk4G4pugX1AsSYPFP5mAb RIKxmJZRTug6iSkBxFRhfiWD+1visTrIDseRbPC/QXCkicBsoGdv5pE7mjAhPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YsJxp6DQjzm8N; Mon, 10 Feb 2025 22:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51AMNQQ8075544; Mon, 10 Feb 2025 22:23:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51AMNQkq075541; Mon, 10 Feb 2025 22:23:26 GMT (envelope-from git) Date: Mon, 10 Feb 2025 22:23:26 GMT Message-Id: <202502102223.51AMNQkq075541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: c8245ceb4756 - main - Update dirdeps.mk et al List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8245ceb47565e864a350e6aa33ba9a6461ebe02 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=c8245ceb47565e864a350e6aa33ba9a6461ebe02 commit c8245ceb47565e864a350e6aa33ba9a6461ebe02 Author: Simon J. Gerraty AuthorDate: 2025-02-10 22:20:06 +0000 Commit: Simon J. Gerraty CommitDate: 2025-02-10 22:20:06 +0000 Update dirdeps.mk et al Update dirdeps.mk and friends to match latest contrib/bmake/mk Reviewed by: stevek Differential Revision: https://reviews.freebsd.org/D48855 --- share/mk/auto.obj.mk | 14 ++++++++------ share/mk/dirdeps-targets.mk | 5 ++++- share/mk/dirdeps.mk | 13 +++++++------ share/mk/gendirdeps.mk | 4 ++-- share/mk/meta.sys.mk | 13 ++++++++++++- share/mk/meta2deps.py | 16 ++++++++++++---- share/mk/sys.dependfile.mk | 4 +++- 7 files changed, 48 insertions(+), 21 deletions(-) diff --git a/share/mk/auto.obj.mk b/share/mk/auto.obj.mk index 21aa8e4a40d0..cfe60ef9c4d6 100644 --- a/share/mk/auto.obj.mk +++ b/share/mk/auto.obj.mk @@ -1,14 +1,16 @@ -# $Id: auto.obj.mk,v 1.12 2015/12/16 01:57:06 sjg Exp $ +# SPDX-License-Identifier: BSD-2-Clause +# +# $Id: auto.obj.mk,v 1.17 2024/02/17 17:26:57 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. # Permission to copy, redistribute or otherwise -# use this file is hereby granted provided that +# use this file is hereby granted provided that # the above copyright notice and this notice are -# left intact. -# +# left intact. +# # Please send copies of changes and bug-fixes to: # sjg@crufty.net # @@ -16,7 +18,7 @@ ECHO_TRACE ?= echo .ifndef Mkdirs -# A race condition in some versions of mkdir, means that it can bail +# A race condition in some versions of mkdir, means that it can bail # if another process made a dir that mkdir expected to. # We repeat the mkdir -p a number of times to try and work around this. # We stop looping as soon as the dir exists. @@ -53,7 +55,7 @@ __objdir:= ${__objdir} # We need to chdir, make the directory if needed .if !exists(${__objdir}/) && \ (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "") -# This will actually make it... +# This will actually make it... __objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \ ${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \ ${Mkdirs}; Mkdirs ${__objdir} diff --git a/share/mk/dirdeps-targets.mk b/share/mk/dirdeps-targets.mk index 9e3fb814fada..a8a547c0ce9b 100644 --- a/share/mk/dirdeps-targets.mk +++ b/share/mk/dirdeps-targets.mk @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-2-Clause # # RCSid: -# $Id: dirdeps-targets.mk,v 1.27 2024/02/25 19:12:13 sjg Exp $ +# $Id: dirdeps-targets.mk,v 1.28 2024/10/19 00:47:38 sjg Exp $ # # @(#) Copyright (c) 2019-2020 Simon J. Gerraty # @@ -160,6 +160,9 @@ MK_DIRDEPS_CACHE = yes .endfor .if defined(STATIC_DIRDEPS_CACHE) .export STATIC_DIRDEPS_CACHE +.if !empty(DEBUG_DIRDEPS_TARGETS) +.info STATIC_DIRDEPS_CACHE=${STATIC_DIRDEPS_CACHE:S,${SRCTOP}/,,} +.endif .endif .endif diff --git a/share/mk/dirdeps.mk b/share/mk/dirdeps.mk index 80720a7ca225..b281d15ec346 100644 --- a/share/mk/dirdeps.mk +++ b/share/mk/dirdeps.mk @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.171 2024/09/30 21:21:25 sjg Exp $ +# $Id: dirdeps.mk,v 1.175 2025/01/05 01:16:19 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # @@ -152,7 +152,7 @@ # any other DIRDEP. # # This allows for adding TESTS to the build, such that the build -# if any test fails, but without the risk of introducing +# will fail if any test fails, but without the risk of introducing # circular dependencies. now_utc ?= ${%s:L:localtime} @@ -445,6 +445,7 @@ _DIRDEP_USE: .USE .MAKE TARGET_SPEC=${.TARGET:E} \ MACHINE=${.TARGET:E} \ ${DIRDEP_MAKE} -C ${DIRDEP_DIR} ${DIRDEP_TARGETS} || exit 1; \ + ${DIRDEP_USE_EPILOGUE} \ break; \ done @@ -568,7 +569,7 @@ BUILD_DIRDEPS = no dirdeps: dirdeps-cached dirdeps-cached: ${DIRDEPS_CACHE} .MAKE @echo "${TRACER}Using ${DIRDEPS_CACHE}" - @MAKELEVEL=${.MAKE.LEVEL} \ + @${DIRDEPS_CACHED_ENV} MAKELEVEL=${.MAKE.LEVEL} \ TARGET_SPEC=${TARGET_SPEC} \ ${TARGET_SPEC_VARS:@v@$v=${$v}@} \ ${.MAKE} -C ${_CURDIR} -f ${DIRDEPS_CACHE} \ @@ -606,10 +607,10 @@ ${DIRDEPS_CACHE}: .META .NOMETA_CMP BUILD_DIRDEPS_CACHE=yes \ .MAKE.DEPENDFILE=.none \ ${"${DEBUG_DIRDEPS:Nno}":?DEBUG_DIRDEPS='${DEBUG_DIRDEPS}':} \ - ${.MAKEFLAGS:tW:S,-D ,-D,g:tw:M*WITH*} \ - ${.MAKEFLAGS:tW:S,-d ,-d,g:tw:M-d*} \ + ${.MAKEFLAGS:S,-D ,-D,gW:M*WITH*} \ + ${.MAKEFLAGS:S,-d ,-d,gW:M-d*} \ 3>&1 1>&2 | sed 's,${SRCTOP},_{SRCTOP},g;s,_{SRCTOP}/_{SRCTOP},_{SRCTOP},g;s,_{,$${,g' >> ${.TARGET}.new && \ - mv ${.TARGET}.new ${.TARGET} + { ${BUILD_DIRDEPS_EPILOGUE} mv ${.TARGET}.new ${.TARGET}; } .endif .endif diff --git a/share/mk/gendirdeps.mk b/share/mk/gendirdeps.mk index 5d54aa232152..53e736da3391 100644 --- a/share/mk/gendirdeps.mk +++ b/share/mk/gendirdeps.mk @@ -1,4 +1,4 @@ -# $Id: gendirdeps.mk,v 1.50 2023/11/04 16:47:34 sjg Exp $ +# $Id: gendirdeps.mk,v 1.51 2025/01/05 01:16:19 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # @@ -237,7 +237,7 @@ dir_list != cd ${_OBJDIR} && \ sed ${GENDIRDEPS_SEDCMDS} .if ${dir_list:M*ERROR\:*} != "" -.warning ${dir_list:tW:C,.*(ERROR),\1,} +.warning ${dir_list:C,.*(ERROR),\1,W} .warning Skipping ${_DEPENDFILE:S,${SRCTOP}/,,} # we are not going to update anything .else diff --git a/share/mk/meta.sys.mk b/share/mk/meta.sys.mk index 6e4216ab5383..1104204dc8c9 100644 --- a/share/mk/meta.sys.mk +++ b/share/mk/meta.sys.mk @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # -# $Id: meta.sys.mk,v 1.54 2024/03/10 15:53:51 sjg Exp $ +# $Id: meta.sys.mk,v 1.56 2024/11/22 23:51:48 sjg Exp $ # # @(#) Copyright (c) 2010-2023, Simon J. Gerraty @@ -40,6 +40,11 @@ META_MODE += nofilemon MKDEP_MK ?= auto.dep.mk .endif +# META_MODE_XTRAS makes it easier to add things like 'env' +# from the command line when debugging +# :U avoids problems from := below +META_MODE += ${META_MODE_XTRAS:U} + .MAKE.MODE ?= ${META_MODE} _filemon := ${.MAKE.PATH_FILEMON:U/dev/filemon} @@ -101,6 +106,12 @@ SB = ${SRCTOP:H} ERROR_LOGDIR ?= ${SB}/error meta_error_log = ${ERROR_LOGDIR}/meta-${.MAKE.PID}.log +.if ${.MAKE.LEVEL} == 0 && !empty(NEWLOG_SH) && exists(${ERROR_LOGDIR}) +.BEGIN: _rotateErrorLog +_rotateErrorLog: .NOMETA .NOTMAIN + @${NEWLOG_SH} -d -S -n ${ERROR_LOG_GENS:U4} ${ERROR_LOGDIR} +.endif + .ERROR: _metaError # We are interested here in the target(s) that caused the build to fail. # We want to ignore targets that were "aborted" due to failure diff --git a/share/mk/meta2deps.py b/share/mk/meta2deps.py index f188d0f01de8..44c752d0e7eb 100755 --- a/share/mk/meta2deps.py +++ b/share/mk/meta2deps.py @@ -39,7 +39,7 @@ We only pay attention to a subset of the information in the SPDX-License-Identifier: BSD-2-Clause RCSid: - $Id: meta2deps.py,v 1.47 2024/02/17 17:26:57 sjg Exp $ + $Id: meta2deps.py,v 1.50 2024/09/27 00:08:36 sjg Exp $ Copyright (c) 2011-2020, Simon J. Gerraty Copyright (c) 2011-2017, Juniper Networks, Inc. @@ -294,6 +294,7 @@ class MetaFile: if not _objroot in self.objroots: self.objroots.append(_objroot) + self.sb = conf.get('SB', '') # we want the longest match self.srctops.sort(reverse=True) self.objroots.sort(reverse=True) @@ -461,6 +462,10 @@ class MetaFile: if self.curdir: self.seenit(self.curdir) # we ignore this + if self.sb and self.name.startswith(self.sb): + error_name = self.name.replace(self.sb+'/','') + else: + error_name = self.name interesting = '#CEFLRVX' for line in f: self.line += 1 @@ -550,9 +555,9 @@ class MetaFile: self.parse_path(path, cwd, w[0], w) if version == 0: - raise AssertionError('missing filemon data') + raise AssertionError('missing filemon data: {}'.format(error_name)) if not eof_token: - raise AssertionError('truncated filemon data') + raise AssertionError('truncated filemon data: {}'.format(error_name)) setid_pids = [] # self.pids should be empty! @@ -570,7 +575,8 @@ class MetaFile: print("ERROR: missing eXit for {} pid {}".format(path, pid)) for pid in setid_pids: del self.pids[pid] - assert(len(self.pids) == 0) + if len(self.pids) > 0: + raise AssertionError('bad filemon data - missing eXits: {}'.format(error_name)) if not file: f.close() @@ -714,6 +720,8 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None): 'EXCLUDES': [], } + conf['SB'] = os.getenv('SB', '') + try: machine = os.environ['MACHINE'] if machine: diff --git a/share/mk/sys.dependfile.mk b/share/mk/sys.dependfile.mk index 49232646d569..3c13b1c92bff 100644 --- a/share/mk/sys.dependfile.mk +++ b/share/mk/sys.dependfile.mk @@ -1,4 +1,6 @@ -# $Id: sys.dependfile.mk,v 1.10 2023/05/10 19:23:26 sjg Exp $ +# SPDX-License-Identifier: BSD-2-Clause +# +# $Id: sys.dependfile.mk,v 1.11 2024/02/17 17:26:57 sjg Exp $ # # @(#) Copyright (c) 2012-2023, Simon J. Gerraty #