From fe271bdb43cf88ee129d94c0e286fe618fd28e89 Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Mon, 6 Apr 2026 11:25:05 -0700 Subject: Import bmake-20260313 Intersting/relevant changes since bmake-20251111 ChangeLog since bmake-20251111 2026-03-12 Simon J Gerraty * VERSION (_MAKE_VERSION): 20260313 Merge with NetBSD make, pick up o make: ensure .MAKE.SAVE_DOLLARS is initialized so makefiles like sys.vars.mk can test its value to know how to deal with macros that need to save '$' during ':='. * Makefile: default MAKE_SAVE_DOLLARS_DEFAULT to "no" for traditional behavior. 2026-03-10 Simon J Gerraty * VERSION (_MAKE_VERSION): 20260310 Merge with NetBSD make, pick up o unit-tests ensure TEST_MAKE is absolute path and tests that make symlink for ${MAKE} can run in parallel. 2026-03-03 Simon J Gerraty * VERSION (_MAKE_VERSION): 20260303 Merge with NetBSD make, pick up o job.c: MaybeSubMake: Look for expansion of ${.MAKE} and if necessary its basename, and only match if at start of line or preceded by space. 2026-02-28 Simon J Gerraty * Makefile: mark ${PROG} and ${OBJS} as .META MaybeSubMake will otherwise mistake them for sub-makes * VERSION (_MAKE_VERSION): 20260301 Merge with NetBSD make, pick up o job.c: MaybeSubMake: skip control chars [@+-] at start of line when checking for ${MAKE} 2026-02-22 Simon J Gerraty * VERSION (_MAKE_VERSION): 20260222 o mk file update 2026-02-16 Simon J Gerraty * VERSION (_MAKE_VERSION): 20260216 Merge with NetBSD make, pick up o minor cleanups 2026-02-10 Simon J Gerraty * VERSION (_MAKE_VERSION): 20260210 Merge with NetBSD make, pick up o document that multiple variables can be set on command line. o move MaybeSubMake to job.c so it can be called on expanded commands for more accuracy and less overhead. o main.c: set .MAKE.VERSION as read-only. * unit-tests/opt-{chdir,where-am-i}.mk: use MAKEOBJDIRPREFIX=/ to avoid tripping over an unreadable /usr/obj 2026-02-04 Simon J Gerraty * unit-tests/varname-make_stack_trace.mk: for FreeBSD and similar set .MAKE.ALWAYS_PASS_JOB_QUEUE=no to ensure we get the expected errors. * VERSION (_MAKE_VERSION): 20260202 Merge with NetBSD make, pick up o on error avoid duplicate stack trace to stderr 2026-01-11 Simon J Gerraty * VERSION (_MAKE_VERSION): 20260111 Merge with NetBSD make, pick up o var.c: add explicit check for empty re as not all regex libs throw an error as expected, in this case. 2026-01-10 Simon J Gerraty * VERSION (_MAKE_VERSION): 20260110 Merge with NetBSD make, pick up o minor cleanups mk/ChangeLog since bmake-20251111 2026-03-12 Simon J Gerraty * install-mk (MK_VERSION): 20260313 * sys.vars.mk: use .MAKE.VERSION M_type can simply use '$x' 2026-02-22 Simon J Gerraty * install-mk (MK_VERSION): 20260222 * dirdeps.mk, sys.mk: add dependent option UPDATE_DIRDEPS_CACHE/DIRDEPS_CACHE. It can be useful to use -DWITHOUT_UPDATE_DIRDEPS_CACHE to temporarily treat dynamic DIRDEPS_CACHE as static. 2026-01-10 Simon J Gerraty * meta.autodep.mk (${_DEPENDFILE}): add .NOMETA 2026-01-08 Simon J Gerraty * rust.mk: better accommodation for RUST_LIBS. Set RUST_{LIBS,PROGS}_CARGO_BUILD_OUTPUT_LIST to simplify staging. 2025-12-08 Simon J Gerraty * install-mk (MK_VERSION): 20251207 * sys.vars.mk: replace MAKE_POSIX_SHELL usage with isPOSIX_SHELL Using ${isPOSIX_SHELL:U:Nfalse} provides a boolean for make and ${isPOSIX_SHELL:Ufalse} does the same for target scripts. Both will be false if isPOSIX_SHELL is not set or set to false. This has the advantage that if only POSIX shells are expected sys.mk (or something it includes) can simply do isPOSIX_SHELL?=: --- unit-tests/varname-make_stack_trace.mk | 36 +++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'unit-tests/varname-make_stack_trace.mk') diff --git a/unit-tests/varname-make_stack_trace.mk b/unit-tests/varname-make_stack_trace.mk index cba02559bafe..26b06448d583 100644 --- a/unit-tests/varname-make_stack_trace.mk +++ b/unit-tests/varname-make_stack_trace.mk @@ -1,4 +1,4 @@ -# $NetBSD: varname-make_stack_trace.mk,v 1.1 2025/06/13 03:51:18 rillig Exp $ +# $NetBSD: varname-make_stack_trace.mk,v 1.8 2026/03/10 05:02:00 sjg Exp $ # # Tests for the MAKE_STACK_TRACE environment variable, which controls whether # to print inter-process stack traces that are useful to narrow down where an @@ -11,27 +11,53 @@ # with the space for the command line arguments, and long command lines are # already written to a temporary file by Cmd_Exec to not overwhelm this space. +_make ?= .make${.MAKE.PID} +.export _make + all: .PHONY @${MAKE} -f ${MAKEFILE} disabled-compat || : @${MAKE} -f ${MAKEFILE} -j1 disabled-parallel || : @MAKE_STACK_TRACE=yes ${MAKE} -f ${MAKEFILE} enabled-compat || : @MAKE_STACK_TRACE=yes ${MAKE} -f ${MAKEFILE} -j1 enabled-parallel || : + @MAKE_STACK_TRACE=yes ${MAKE} -f ${MAKEFILE} -j1 multi-stage-1 + @rm -f ${_make} -# expect-not: in target "disabled-compat" +# expect-not-matches: in target "disabled%-compat" disabled-compat: .PHONY @${MAKE} -f ${MAKEFILE} provoke-error -# expect-not: in target "disabled-parallel" +# expect-not-matches: in target "disabled%-parallel" disabled-parallel: .PHONY @${MAKE} -f ${MAKEFILE} provoke-error -# expect: in target "enabled-compat" +# expect: in target "enabled-compat" from varname-make_stack_trace.mk:35 enabled-compat: .PHONY @${MAKE} -f ${MAKEFILE} provoke-error -# expect: in target "enabled-parallel" +# expect: in target "enabled-parallel" from varname-make_stack_trace.mk:39 enabled-parallel: .PHONY @${MAKE} -f ${MAKEFILE} provoke-error provoke-error: .PHONY @echo ${:Z} + +# The stack trace must be printed exactly once. +# expect: in target "multi-stage-4" from varname-make_stack_trace.mk:56 +# expect: in target "multi-stage-1" from varname-make_stack_trace.mk:50 +# expect-not-matches: in target "multi%-stage%-4" +# expect-not-matches: in target "multi%-stage%-1" +multi-stage-1: .PHONY ${_make} + @${MAKE} -f ${MAKEFILE} -j1 multi-stage-2 +multi-stage-2: .PHONY + @${MAKE} -f ${MAKEFILE} -j1 multi-stage-3 +multi-stage-3: .PHONY + @${MAKE} -f ${MAKEFILE} -j1 multi-stage-4 +multi-stage-4: .PHONY + @./${_make} -f ${MAKEFILE} -j1 multi-stage-5 +multi-stage-5: .PHONY + +${_make}: + @ln -s ${MAKE} ${.TARGET} + +# for FreeBSD and similar make sure we get the expected errors. +.MAKE.ALWAYS_PASS_JOB_QUEUE= no -- cgit v1.3