From nobody Fri Jun 19 20:30:15 2026 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 4ghq3C3tcNz6gmpV for ; Fri, 19 Jun 2026 20:30:15 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghq3C36KBz43lx for ; Fri, 19 Jun 2026 20:30:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781901015; 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=XBMplmRigJN5nB/yYQe47NnKwvNkTe49wvVx9BJLjKw=; b=OIJWsAuz8qJmfIQrBpcqz0HxhbI1ov1goCkIllMmnjltdRbuwQB+gZ4jvrnhw7MFN2qcGB f5yM4ZDFAKAzYc4gl06U9hWs/62ZPM3joKNqCG9fMyr9as2miuxwp1yZBdf4OncpeYr8QX Yn7KiieKDU9xgRXmzyMjrvDYN41DIReVbnT5VwRFQnCRmPvH8T7Q7W1f7sU1t7YgeVVy8O wVSAPw6Nc+mNyg0924mSEzxTgOt811KehEd+C/mk7yWa/vxgSxmRtIJ5ki3diu+PbfU1H1 epem0F5PZUr859+Uzt8PlV/S4n1HC5+OKfnKOPPCRFHnJtLrZOeBSNnRgq4bPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781901015; a=rsa-sha256; cv=none; b=GlmKiVtM+o3CmawzxA7F7YRUSqFrFqrJBcxbksoXRtA5HgtC2AdBrrKTC0ZvT9EPW4XSkA M+Zd57M5bdxxEdbxmQ/JhmGLkgtrSz8BGqXOkCSrE/1hVRJCR6CUhcbpfR79NDPQ5Rl64J U7ysuD/CFG0ljUxgMVr8PPpPF1oXTuygLwNosqfGNJQeyPydvx61ucvrrVi62LDbtAN9IR 3v/xH9tVeuQfBwBdfoJKhd0KYsP4SDYrrvMe9jAJmJTIKaXb5JT6PZgabkkQ8TZk6kNwjy 5PhPjiVvD9PoQqS4QM1iO4PCZjrhDEFHjmYjoG04bl1CWJRWoPS1VOZ3LjC1kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781901015; 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=XBMplmRigJN5nB/yYQe47NnKwvNkTe49wvVx9BJLjKw=; b=NmJzVBgJIaR9XVZ7emy7JX93XqYGQg82XmX2KidfuBjpB19jg/Q3NZxHXlco1jR+uSrLWO +cvk9cI2DL7YBWRGFdyGWR4+L4egfFPGuufcUwxhGIaKxjOa07sst6xaU1jXfyhk3ik27A U3j50joF7bCnilGgdHIKj/5/sa6AIJmdR/6PBhWeYcrCpG48XxiJbx6a0ooOHqzi/OMQSp I+h7M2Wec7ubsRL0bc8EAMDaSVj68DJbjnv5i2GrBPHd6RXPcbgKVd6JNZU1UFizW+OCps ygpI2ohbzseX4wNxxLdGE5i+G+DP3ol9aYJg1B2oYTZxR8Rst7VAMuFlG4zy/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghq3C1Pv9z11F8 for ; Fri, 19 Jun 2026 20:30:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a74f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 20:30:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Simon J. Gerraty Subject: git: 7386c0675c89 - main - Update dirdpes.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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 7386c0675c89b12cac1da8e16fc8fc32eb42ca07 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 20:30:15 +0000 Message-Id: <6a35a6d7.3a74f.44022674@gitrepo.freebsd.org> The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7386c0675c89b12cac1da8e16fc8fc32eb42ca07 commit 7386c0675c89b12cac1da8e16fc8fc32eb42ca07 Author: Simon J. Gerraty AuthorDate: 2026-06-19 20:29:25 +0000 Commit: Simon J. Gerraty CommitDate: 2026-06-19 20:29:25 +0000 Update dirdpes.mk et al Update to latest dirdeps related makefiles. dirdeps.mk tweaks useful for universe among other corner cases. also additional filtering for bogus paths ending in / gendirdeps.mk allow more debugging also additional filtering for bogus paths ending in / install-new.mk fix bug when isPOSIX_SHELL is true meta2deps.?? handle file names with spaces by ignoring them Reviewed by: stevek Differential Revision: https://reviews.freebsd.org/D57683 --- share/mk/dirdeps.mk | 28 +++++++++++++++++++--------- share/mk/gendirdeps.mk | 14 ++++++++++---- share/mk/install-new.mk | 4 ++-- share/mk/meta2deps.py | 25 ++++++++++++++++--------- share/mk/meta2deps.sh | 15 +++++++++++++-- 5 files changed, 60 insertions(+), 26 deletions(-) diff --git a/share/mk/dirdeps.mk b/share/mk/dirdeps.mk index b281d15ec346..abd3407eddf4 100644 --- a/share/mk/dirdeps.mk +++ b/share/mk/dirdeps.mk @@ -1,8 +1,8 @@ -# $Id: dirdeps.mk,v 1.175 2025/01/05 01:16:19 sjg Exp $ +# $Id: dirdeps.mk,v 1.178 2026/05/09 20:33:46 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2010-2023, Simon J. Gerraty +# Copyright (c) 2010-2026, Simon J. Gerraty # Copyright (c) 2010-2018, Juniper Networks, Inc. # All rights reserved. # @@ -322,6 +322,12 @@ _debug_search = 1 .else _debug_search = 0 .endif +.if ${DEBUG_DIRDEPS:Mno*recurse} != "" +BUILD_DIRDEPS_RECURSE = no +.endif +.if ${DEBUG_DIRDEPS:M-V} != "" +_V_READ_DIRDEPS = yes +.endif # First off, we want to know what ${MACHINE} to build for. # This can be complicated if we are using a mixture of ${MACHINE} specific @@ -585,6 +591,11 @@ BUILD_DIRDEPS_MAKEFILE ?= BUILD_DIRDEPS_OVERRIDES ?= BUILD_DIRDEPS_TARGETS ?= ${.TARGETS} +# sometimes we temporarily want to block updating of DIRDEPS_CACHE +.if ${MK_UPDATE_DIRDEPS_CACHE:Uyes} == "no" && exists(${DIRDEPS_CACHE}) +STATIC_DIRDEPS_CACHE ?= ${DIRDEPS_CACHE} +.endif + .if ${DIRDEPS_CACHE} != ${STATIC_DIRDEPS_CACHE:Uno} && ${DIRDEPS_CACHE:M${SRCTOP}/*} == "" # export this for dirdeps-cache-update.mk DYNAMIC_DIRDEPS_CACHE := ${DIRDEPS_CACHE} @@ -715,12 +726,12 @@ DEP_DIRDEPS_BUILD_DIR_FILTER = u .endif # this is what we start with -__depdirs := ${DIRDEPS:${NSkipDir}:${DEP_DIRDEPS_FILTER:ts:}:C,//+,/,g:O:u:@d@${SRCTOP}/$d@} +__depdirs := ${DIRDEPS:${NSkipDir}:${DEP_DIRDEPS_FILTER:ts:}:C,//+,/,g:S,/$,,:O:u:@d@${SRCTOP}/$d@} # some entries may be qualified with . or . # we can tell the unqualified ones easily - because they exist __unqual_depdirs := ${__depdirs:@d@${exists($d):?$d:}@} -__qual_depdirs := ${__depdirs:${__unqual_depdirs:Uno:${M_ListToSkip}}} +__qual_depdirs := ${__depdirs:${__unqual_depdirs:Uno:${M_ListToSkip}}:C,/(\.[^.]*)$,\1,} .if ${DEP_RELDIR} == ${_DEP_RELDIR} # if it was called out - we likely need it. @@ -745,16 +756,13 @@ _build_dirs += \ ${_machines:Nhost*:@m@${__unqual_depdirs:@d@$d.$m@}@} # qualify everything now -.if ${_debug_reldir} -.info _build_dirs=${_build_dirs:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} -.endif # make sure we do not mess with qualifying "host" entries _build_dirs := ${_build_dirs:M*.host*:${M_dep_qual_fixes.host:ts:}} \ ${_build_dirs:N*.host*:${M_dep_qual_fixes:ts:}} # some filters can only be applied now _build_dirs := ${_build_dirs:${DEP_DIRDEPS_BUILD_DIR_FILTER:ts:}:O:u} .if ${_debug_reldir} -.info _build_dirs=${_build_dirs:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} +.info _build_dirs=${_build_dirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} .endif .endif # empty DIRDEPS @@ -791,7 +799,7 @@ dirdeps: ${_build_all_dirs} ${_build_all_dirs}: _DIRDEP_USE .if ${_debug_reldir} -.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: needs: ${_build_dirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} +.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: needs: ${_build_all_dirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} .endif # this builds the dependency graph @@ -858,6 +866,7 @@ DIRDEPS_EXPORT_VARS = DEP_EXPORT_VARS = .endif +.if ${BUILD_DIRDEPS_RECURSE:Uyes} != "no" # Now find more dependencies - and recurse. .for d in ${_build_all_dirs} .if !target(_dirdeps_checked.$d) @@ -909,6 +918,7 @@ DIRDEPS = .endif .endif .endfor +.endif .endif # -V .endif # BUILD_DIRDEPS diff --git a/share/mk/gendirdeps.mk b/share/mk/gendirdeps.mk index ab1786f3603f..e5f536441a8d 100644 --- a/share/mk/gendirdeps.mk +++ b/share/mk/gendirdeps.mk @@ -1,8 +1,8 @@ -# $Id: gendirdeps.mk,v 1.54 2025/08/12 21:36:43 sjg Exp $ +# $Id: gendirdeps.mk,v 1.56 2026/06/19 18:57:57 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2011-2025, Simon J. Gerraty +# Copyright (c) 2011-2026, Simon J. Gerraty # Copyright (c) 2010-2018, Juniper Networks, Inc. # All rights reserved. # @@ -87,6 +87,12 @@ _debug.gendirdeps = 0 all: +.if ${_debug.gendirdeps} +.if ${DEBUG_GENDIRDEPS:M-d*} +.MAKEFLAGS: ${DEBUG_GENDIRDEPS:M-d*} +.endif +.endif + _CURDIR ?= ${.CURDIR} _OBJDIR ?= ${.OBJDIR} _OBJTOP ?= ${OBJTOP} @@ -331,7 +337,7 @@ DIRDEPS += \ # what modifiers do we allow in GENDIRDEPS_FILTER GENDIRDEPS_FILTER_MASK += @CMNS -DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:M[${GENDIRDEPS_FILTER_MASK:O:u:ts}]*:ts:}:C,//+,/,g:O:u} +DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:M[${GENDIRDEPS_FILTER_MASK:O:u:ts}]*:ts:}:C,//+,/,g:S,/$,,:C,/(\.[^.]+)$,\1,:O:u} .if ${_debug.gendirdeps} .info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS} @@ -353,7 +359,7 @@ src_dirdep_list = \ SRC_DIRDEPS = \ ${src_dirdep_list:N${RELDIR}:N${RELDIR}/*:C,(/h)/.*,,} -SRC_DIRDEPS := ${SRC_DIRDEPS:${GENDIRDEPS_SRC_FILTER:UN/*:ts:}:C,//+,/,g:O:u} +SRC_DIRDEPS := ${SRC_DIRDEPS:${GENDIRDEPS_SRC_FILTER:UN/*:ts:}:C,//+,/,g:S,/$,,:C,/(\.[^.]+)$,\1,:O:u} # if you want to capture SRC_DIRDEPS in .MAKE.DEPENDFILE put # SRC_DIRDEPS_FILE = ${_DEPENDFILE} diff --git a/share/mk/install-new.mk b/share/mk/install-new.mk index 2fb9725a7a47..001460439ca8 100644 --- a/share/mk/install-new.mk +++ b/share/mk/install-new.mk @@ -1,4 +1,4 @@ -# $Id: install-new.mk,v 1.9 2025/11/19 17:44:15 sjg Exp $ +# $Id: install-new.mk,v 1.10 2026/06/19 19:47:03 sjg Exp $ # # @(#) Copyright (c) 2009, Simon J. Gerraty # @@ -47,7 +47,7 @@ InstallNew= ${CmpCpMv}; InstallNew() { \ for new in "$$@"; do \ if test $$_t $$new; then \ if ${isPOSIX_SHELL:Ufalse}; then \ - target=$${new%.new}; \ + target=$${new%.new*}; \ else \ target=`expr $$new : '\(.*\).new'`; \ fi; \ diff --git a/share/mk/meta2deps.py b/share/mk/meta2deps.py index 77ed86397a0f..a5a64dba3290 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.54 2025/07/24 16:05:48 sjg Exp $ + $Id: meta2deps.py,v 1.56 2026/05/22 00:33:26 sjg Exp $ Copyright (c) 2011-2025, Simon J. Gerraty Copyright (c) 2011-2017, Juniper Networks, Inc. @@ -446,7 +446,7 @@ class MetaFile: version = 0 # unknown if name: - self.name = name; + self.name = name if file: f = file cwd = self.last_dir = self.cwd @@ -515,6 +515,12 @@ class MetaFile: if self.debug > 2: print('op={} elen={} wlen={} line="{}"'.format(w[0], elen, wlen, line.strip()), file=self.debug_out) if wlen != elen: + if wlen > elen and w[0] in 'CELMRW': + # It could just be spaces in pathname. + # More trouble than its worth, just skip it. + if self.debug > 0: + print('Skipping: wrong number of words: expected {} got {} in: {}'.format(elen, wlen, line), file=self.debug_out) + continue raise AssertionError('corrupted filemon data: wrong number of words: expected {} got {} in: {}'.format(elen, wlen, line)) pid = int(w[1]) @@ -669,7 +675,7 @@ class MetaFile: return if os.path.isdir(path): if op in 'RW': - self.last_dir = path; + self.last_dir = path if self.debug > 1: print("ldir=", self.last_dir, file=self.debug_out) return @@ -703,7 +709,7 @@ class MetaFile: self.seenit(dir) -def main(argv, klass=MetaFile, xopts='', xoptf=None): +def main(argv, klass=MetaFile, xopts='', xoptf=None, conf=None): """Simple driver for class MetaFile. Usage: @@ -743,11 +749,12 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None): except: pass - conf = { - 'SRCTOPS': [], - 'OBJROOTS': [], - 'EXCLUDES': [], - } + if not conf: + conf = {} + + for k in ['EXCLUDES', 'OBJROOTS', 'SRCTOPS']: + if k not in conf: + conf[k] = [] conf['SB'] = os.getenv('SB', '') diff --git a/share/mk/meta2deps.sh b/share/mk/meta2deps.sh index 293ebdab6e7c..454b8eeb861c 100755 --- a/share/mk/meta2deps.sh +++ b/share/mk/meta2deps.sh @@ -77,7 +77,7 @@ # RCSid: -# $Id: meta2deps.sh,v 1.26 2025/12/08 17:34:02 sjg Exp $ +# $Id: meta2deps.sh,v 1.27 2026/05/22 00:33:26 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # @@ -162,6 +162,10 @@ error() { exit 1 } +warning() { + echo "WARNING: $@" >&2 +} + meta2deps() { DPDEPS= SRCTOPS=$SRCTOP @@ -273,8 +277,15 @@ meta2deps() { ;; \#*) ;; # ok [LM],) error "missing path2 in: '$op $pid $path'";; - [LMX],*" "*) error "wrong number of words in: '$op $pid $path $path2'";; + [LMX],*" "*) + warning "wrong number of words in: '$op $pid $path $path2'" + continue + ;; *,|[LMX],*) ;; # ok + [CELMRW],*) + warning "wrong number of words in: '$op $pid $path $path2'" + continue + ;; *) error "wrong number of words in: '$op $pid $path $path2'";; esac # we track cwd and ldir (of interest) per pid