diff options
| author | Simon J. Gerraty <sjg@FreeBSD.org> | 2026-07-05 18:22:31 +0000 |
|---|---|---|
| committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2026-07-05 18:22:31 +0000 |
| commit | e988c5eab5231646c612d35ff5b16122cebfbf6a (patch) | |
| tree | 307239878c1f97050623742f4663c68476e81e4f /mk | |
| parent | ef402bba84260816d3e8d6e2439b0bc7eddc9446 (diff) | |
Import bmake-20260704vendor/NetBSD/bmake/20260704vendor/NetBSD/bmake
Intersting/relevant changes since bmake-20260508
ChangeLog since bmake-20260508
2026-07-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20260704
2026-07-03 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20260703
Merge with NetBSD make, pick up
o meta.c: do a better job of resolving relative paths
o var.c: add alternation support to :M
eg. :M*{Makefile*,.mk} matches any *Makefile* or *.mk
2026-07-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20260702
Merge with NetBSD make, pick up
o meta.c: .MAKE.META.FILTER can be used to more generally filter
relevant content of .meta file in meta_oodate.
2026-06-19 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20260619
Merge with NetBSD make, pick up
o make.1: fix description of .MADE it is a source not a target.
* update mk files
2026-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20260609
Merge with NetBSD make, pick up
o parse.c: allow semicolons and parentheses in dependency line
expressions
mk/ChangeLog since bmake-20260508
2026-07-04 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20260704
2026-07-03 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: make use of alternation support in latest bmake
when setting .MAKE.META.IGNORE_FILTER so we can get both
Makefile.depend* and *.mk to make cache out-of-date.
2026-07-02 Simon J Gerraty <sjg@beast.crufty.net>
* meta2deps.py: detect corrupted filemon data on Linux,
caused by lost newlines.
2026-06-21 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20260621
* gendirdeps.mk: more debug output
* meta.autodep.mk: remove extra } from GENDIRDEPS_ENV
2026-06-19 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20260619
* install-new.mk: for POSIX_SHELL we need .new*
rather than just .new
2026-05-21 Simon J Gerraty <sjg@beast.crufty.net>
* meta2deps.{py,sh}: skip pathnames with spaces - not worth the pain.
Diffstat (limited to 'mk')
| -rw-r--r-- | mk/ChangeLog | 34 | ||||
| -rw-r--r-- | mk/dirdeps.mk | 6 | ||||
| -rw-r--r-- | mk/gendirdeps.mk | 20 | ||||
| -rw-r--r-- | mk/install-mk | 4 | ||||
| -rw-r--r-- | mk/install-new.mk | 4 | ||||
| -rw-r--r-- | mk/meta.autodep.mk | 4 | ||||
| -rwxr-xr-x | mk/meta2deps.py | 20 | ||||
| -rwxr-xr-x | mk/meta2deps.sh | 15 | ||||
| -rw-r--r-- | mk/sys.dirdeps.mk | 4 |
9 files changed, 96 insertions, 15 deletions
diff --git a/mk/ChangeLog b/mk/ChangeLog index a8805fa774bf..e904175f354d 100644 --- a/mk/ChangeLog +++ b/mk/ChangeLog @@ -1,3 +1,37 @@ +2026-07-04 Simon J Gerraty <sjg@beast.crufty.net> + + * install-mk (MK_VERSION): 20260704 + +2026-07-03 Simon J Gerraty <sjg@beast.crufty.net> + + * dirdeps.mk: make use of alternation support in latest bmake + when setting .MAKE.META.IGNORE_FILTER so we can get both + Makefile.depend* and *.mk to make cache out-of-date. + +2026-07-02 Simon J Gerraty <sjg@beast.crufty.net> + + * meta2deps.py: detect corrupted filemon data on Linux, + caused by lost newlines. + +2026-06-21 Simon J Gerraty <sjg@beast.crufty.net> + + * install-mk (MK_VERSION): 20260621 + + * gendirdeps.mk: more debug output + + * meta.autodep.mk: remove extra } from GENDIRDEPS_ENV + +2026-06-19 Simon J Gerraty <sjg@beast.crufty.net> + + * install-mk (MK_VERSION): 20260619 + + * install-new.mk: for POSIX_SHELL we need .new* + rather than just .new + +2026-05-21 Simon J Gerraty <sjg@beast.crufty.net> + + * meta2deps.{py,sh}: skip pathnames with spaces - not worth the pain. + 2026-05-09 Simon J Gerraty <sjg@beast.crufty.net> * gendirdeps.mk: also apply ':S,/$,,' and ':C,/(\.[^.]*)$,\1,' diff --git a/mk/dirdeps.mk b/mk/dirdeps.mk index abd3407eddf4..f4cf1a7f4d54 100644 --- a/mk/dirdeps.mk +++ b/mk/dirdeps.mk @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.178 2026/05/09 20:33:46 sjg Exp $ +# $Id: dirdeps.mk,v 1.179 2026/07/03 15:46:16 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # @@ -570,7 +570,11 @@ M_oneperline = @x@\\${.newline} $$x@ BUILD_DIRDEPS = no # ignore anything but these +.if ${MAKE_VERSION} > 20260702 +.MAKE.META.IGNORE_FILTER = M*{/${.MAKE.DEPENDFILE_PREFIX}*,.mk} +.else .MAKE.META.IGNORE_FILTER = M*/${.MAKE.DEPENDFILE_PREFIX}* +.endif dirdeps: dirdeps-cached dirdeps-cached: ${DIRDEPS_CACHE} .MAKE diff --git a/mk/gendirdeps.mk b/mk/gendirdeps.mk index 85af65668407..ad964e062205 100644 --- a/mk/gendirdeps.mk +++ b/mk/gendirdeps.mk @@ -1,4 +1,4 @@ -# $Id: gendirdeps.mk,v 1.55 2026/05/09 20:46:13 sjg Exp $ +# $Id: gendirdeps.mk,v 1.57 2026/06/21 19:04:57 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # @@ -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} @@ -157,10 +163,12 @@ META2DEPS := ${META2DEPS} .if ${_debug.gendirdeps} && ${DEBUG_GENDIRDEPS:Mmeta2d*} != "" _time = time +_set_x = set -x; _sh_x = sh -x _py_d = -ddd .else _time = +_set_x = _sh_x = _py_d = .endif @@ -238,7 +246,11 @@ x != echo; for m in $$_meta_files; do echo $$m; done > meta.list _meta_files_arg:= ${_meta_files} .endif -dir_list != cd ${_OBJDIR} && \ +.if ${_debug.gendirdeps} +.info ${RELDIR}: _meta_files_arg='${_meta_files_arg}' +.endif + +dir_list != cd ${_OBJDIR} && ${_set_x} \ ${META2DEPS_CMD} MACHINE=${MACHINE} \ SRCTOP=${SRCTOP} RELDIR=${RELDIR} CURDIR=${_CURDIR} \ ${META2DEPS_ARGS} \ @@ -250,6 +262,9 @@ dir_list != cd ${_OBJDIR} && \ .warning Skipping ${_DEPENDFILE:S,${SRCTOP}/,,} # we are not going to update anything .else +.if ${_debug.gendirdeps} +.info ${RELDIR}: raw_dir_list='${dir_list}' +.endif dpadd_dir_list= .if !empty(DPADD) _nonlibs := ${DPADD:T:Nlib*:N*include} @@ -270,7 +285,6 @@ ddeps != cat ${ddep_list:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \ sed ${GENDIRDEPS_SEDCMDS} .if ${_debug.gendirdeps} -.info ${RELDIR}: raw_dir_list='${dir_list}' .info ${RELDIR}: ddeps='${ddeps}' .endif dir_list += ${ddeps} diff --git a/mk/install-mk b/mk/install-mk index c272b63f2b54..1f4c2acee964 100644 --- a/mk/install-mk +++ b/mk/install-mk @@ -59,7 +59,7 @@ # Simon J. Gerraty <sjg@crufty.net> # RCSid: -# $Id: install-mk,v 1.275 2026/04/24 19:56:48 sjg Exp $ +# $Id: install-mk,v 1.278 2026/07/04 16:44:08 sjg Exp $ # # @(#) Copyright (c) 1994-2025 Simon J. Gerraty # @@ -69,7 +69,7 @@ # sjg@crufty.net # -MK_VERSION=20260424 +MK_VERSION=20260704 OWNER= GROUP= MODE=444 diff --git a/mk/install-new.mk b/mk/install-new.mk index 2fb9725a7a47..001460439ca8 100644 --- a/mk/install-new.mk +++ b/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/mk/meta.autodep.mk b/mk/meta.autodep.mk index 1998689306d4..a4d43f19fec1 100644 --- a/mk/meta.autodep.mk +++ b/mk/meta.autodep.mk @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.72 2026/01/11 05:32:29 sjg Exp $ +# $Id: meta.autodep.mk,v 1.73 2026/06/21 19:01:21 sjg Exp $ # # @(#) Copyright (c) 2010-2025, Simon J. Gerraty # @@ -275,7 +275,7 @@ META_FILES = ${.MAKE.META.FILES:N.depend*} # objects in subdirs META_FILE_FILTER += S,${_OBJDIR}/,,:O:u # we have to defer evaluation until the target script runs -GENDIRDEPS_ENV += META_FILES="${META_FILES:${META_FILE_FILTER:O:u:ts:}}}" +GENDIRDEPS_ENV += META_FILES="${META_FILES:${META_FILE_FILTER:O:u:ts:}}" .if ${_debug.autodep} .info ${_DEPENDFILE:S,${SRCTOP}/,,}: ${_depend} ${.PARSEDIR}/gendirdeps.mk ${META2DEPS} xtras=${META_XTRAS} diff --git a/mk/meta2deps.py b/mk/meta2deps.py index 42085e9e7f7d..8543ec4049ea 100755 --- a/mk/meta2deps.py +++ b/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.55 2026/01/13 04:32:45 sjg Exp $ + $Id: meta2deps.py,v 1.57 2026/07/03 15:45:29 sjg Exp $ Copyright (c) 2011-2025, Simon J. Gerraty Copyright (c) 2011-2017, Juniper Networks, Inc. @@ -73,6 +73,13 @@ import re import sys import stat +# Attempt to match bogus filemon data that could potentitally be truncated by +# the unreliable Linux filemon such as: +# R 2712488 /X 2712597 0 +# or +# R 1096904 /path/foo-linuR 1096904 /path/bar.py +filemon_fused_re = re.compile(r'[CDEFLMRSVWX] [0-9]+ ') + def resolve(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr): """ Return an absolute path, resolving via cwd or last_dir if needed. @@ -515,6 +522,17 @@ 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': + # Before assuming spaces in a pathname, make sure this + # isn't two records fused onto one line because of + # dropped data (unreliable Linux filemon). + if filemon_fused_re.search(line.split(None, 2)[2]): + raise AssertionError('corrupted filemon data: fused records (dropped newline): {} in: {}'.format(error_name, line.strip())) + # 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]) diff --git a/mk/meta2deps.sh b/mk/meta2deps.sh index 293ebdab6e7c..454b8eeb861c 100755 --- a/mk/meta2deps.sh +++ b/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 diff --git a/mk/sys.dirdeps.mk b/mk/sys.dirdeps.mk index bba3bfb9c678..46e76ce4e825 100644 --- a/mk/sys.dirdeps.mk +++ b/mk/sys.dirdeps.mk @@ -1,4 +1,4 @@ -# $Id: sys.dirdeps.mk,v 1.20 2026/04/24 19:56:01 sjg Exp $ +# $Id: sys.dirdeps.mk,v 1.21 2026/05/22 00:32:40 sjg Exp $ # # @(#) Copyright (c) 2012-2023, Simon J. Gerraty # @@ -15,8 +15,8 @@ # Include from [local.]sys.mk - if doing DIRDEPS_BUILD # we should not be here otherwise MK_DIRDEPS_BUILD ?= yes -MK_META_AUTODEP ?= yes # these are all implied +MK_META_AUTODEP ?= yes MK_AUTO_OBJ ?= yes MK_META_MODE ?= yes MK_STAGING ?= yes |
