From nobody Wed Mar 12 14:33:10 2025 X-Original-To: dev-commits-src-main@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 4ZCY5L6RjNz5r1l5; Wed, 12 Mar 2025 14:33:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZCY5L5jh8z3vNt; Wed, 12 Mar 2025 14:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741789990; 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=cXorMP5XbOfn1m8TGbxZMWUnOuUEfcytZHuzAr5jwwI=; b=MXzhTO3KH4XRaakoaBhePZIdvOFcf08yAuQrh+eIGGNKxxqdx9byeQVlq4dxkppaMZ/Ebd orR9Ms55LUceWwqfHtahpTORMdo4MJE4EWABp3/Nx7WEhELqFOXo5KSizVuV4M2kFBieRb dBl8GIrbTr4vcwFJHKm0tiD9CJPkhFO9NKepLaL2bxHdxoltgZgO4OKfpO3NonWE6K1Ooj v5Td8YX0j13vcNW7jgu2+G0enijSJcmEngQbtqWvu7EwFNc5Cq4mB92JLv0A3p0cF2dt0N UiPt66I6GWmMI2r5jdsSDIO8n+hjyNToff4zWROD1g16wfLH57zLiXQUySx1xA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741789990; a=rsa-sha256; cv=none; b=kEkNHC6zr0K6cfMXiNied0jkVqoOaKX5BnO3j79wsmIXP+pyZdDDWkTM16px5c80EW0Egt DS1AriSiwO8e/X/B/ST4EiBnNEYAdeIE1DjMnF8b+db8FpQ9Yv0FCjM+Sag6Z/xrHyIJr9 1Eps6fW4ziA2KAILfNawrydkV8de8ep7Y5jQ3kjvNMs5iG8/O91QMoOzFdUcdw0tHKHwMl G3E/rPfO++sEa/DiburcWMUhDILeL/qBi97fIHzxHqLLF7hg7obERsD7h3E6yvcjj2BA0c wJTvLFacAoMWL1Cb5IJ8rPiITikULwDUJjho9LJAKbYHfP2YOaFO/UKeINvEww== 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=1741789990; 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=cXorMP5XbOfn1m8TGbxZMWUnOuUEfcytZHuzAr5jwwI=; b=rhaZ7OKJ/vlNBImP7cWYZganFj7wSCixIe4u8Rxej5GacUIi3JWs/NsPwdl6H+mJUpe5p4 KCf8ypm07neJvGjKZD1pJvf/2fKQ21xfuUoBKLli/m4gGAKfGVdxPm0kpgifIQgNnltDUN i9K5Rk/S1klMmfd0IghY5hVOANL2iMewRF1zM1onxPjsZFyg4c7z9kSxTdIh3wP2dGRECt qWMoHdTfi5dgSEQVZn1kxnCSg5CWjgu7Tp9MgsMJSWEVcoqZc8eUSmgwZPDsWccdSYnCM7 Hnx/N99IPoFDOm8rDpN+ZzoI3b6MnTh+zjrBWf8ZFDqd2ne79otX765w042y2A== 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 4ZCY5L5BhLz15c; Wed, 12 Mar 2025 14:33:10 +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 52CEXAgk077105; Wed, 12 Mar 2025 14:33:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52CEXAvF077102; Wed, 12 Mar 2025 14:33:10 GMT (envelope-from git) Date: Wed, 12 Mar 2025 14:33:10 GMT Message-Id: <202503121433.52CEXAvF077102@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 87eaa30e9b39 - main - depend-cleanup: Add examples for common cases List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87eaa30e9b3954f5638565318d36bf4a48456a99 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=87eaa30e9b3954f5638565318d36bf4a48456a99 commit 87eaa30e9b3954f5638565318d36bf4a48456a99 Author: Ed Maste AuthorDate: 2025-01-20 14:12:26 +0000 Commit: Ed Maste CommitDate: 2025-03-12 14:32:58 +0000 depend-cleanup: Add examples for common cases Reviewed by: andrew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48521 --- tools/build/depend-cleanup.sh | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 86a8340e2ce4..eec073feca19 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -3,9 +3,15 @@ # # Our current make(1)-based approach to dependency tracking cannot cope with # certain source tree changes, including: +# # - removing source files # - replacing generated files with files committed to the tree # - changing file extensions (e.g. a C source file rewritten in C++) +# - moving a file from one directory to another +# +# Note that changing extensions or moving files may occur in effect as a result +# of switching from a generic machine-independent (MI) implementation file to a +# machine-dependent (MD) one. # # We handle those cases here in an ad-hoc fashion by looking for the known- # bad case in the main .depend file, and if found deleting all of the related @@ -15,6 +21,48 @@ # should be removed once enough time has passed and it is extremely unlikely # anyone would try a NO_CLEAN build against an object tree from before the # related change. One year should be sufficient. +# +# Groups of cleanup rules begin with a comment including the date and git hash +# of the affected commit, and a description. The clean_dep function (below) +# handles common dependency cleanup cases. See the comment above the function +# for its arguments. +# +# Examples of each of the special cases: +# +# - Removing a source file (including changing a file's extension). The path, +# file, and extension are passed to clean_dep. +# +# # 20231031 0527c9bdc718 Remove forward compat ino64 stuff +# clean_dep lib/libc fstat c +# +# # 20221115 42d10b1b56f2 move from rs.c to rs.cc +# clean_dep usr.bin/rs rs c +# +# - Moving a file from one directory to another. Note that a regex is passed to +# clean_dep, as the default regex is derived from the file name (strncat.c in +# this example) does not change. The regex matches the old location, does not +# match the new location, and does not match any dependency shared between +# them. The `/`s are replaced with `.` to avoid awkward escaping. +# +# # 20250110 3dc5429158cf add strncat SIMD implementation +# clean_dep lib/libc strncat c "libc.string.strncat.c" +# +# - Replacing generated files with files committed to the tree. This is special +# case of moving from one directory to another. The stale generated file also +# needs to be deleted, so that it isn't found in make's .PATH. Note the +# unconditional `rm -f`: there's no need for an extra call to first check for +# the file's existence. +# +# # 20250110 3863fec1ce2d add strlen SIMD implementation +# clean_dep lib/libc strlen S arm-optimized-routines +# run rm -f "$OBJTOP"/lib/libc/strlen.S +# +# A rule may be required for only one architecture: +# +# # 20220326 fbc002cb72d2 move from bcmp.c to bcmp.S +# if [ "$MACHINE_ARCH" = "amd64" ]; then +# clean_dep lib/libc bcmp c +# fi set -e set -u