From nobody Thu Jul 27 04:12:01 2023 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 4RBHQn71n3z4pQLp; Thu, 27 Jul 2023 04:12:01 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RBHQn25MHz3nd3; Thu, 27 Jul 2023 04:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690431121; 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=yRyJyAz/62WkPpr1k701R7Xec/Fqee1zIn/TWyqXWe8=; b=ix7dJERxmF0ZHbkQvkfgbOuimHrGbgyUY81SblnucD2yaRFUogSDHE+PGx1gfQfonycrWv KWQeNe1RforXTYBbHMlXGbf6BUGoclOEKP5+gR53mNONNaVme/2OwVnQdpUgvAkQ4+Xz5K v7DniCtpdKQYIIhcUtPm095uOQJLtwX4MKi4vmrFkLpDvA7y7vgoyGW/Ob5K79ZF/aO5UN D+ovbH6gf9tcwRAKVZE5QdKfNVm5/NoGaklgP3QRvqLOs6StN0gfYTK9JvF87Lsl+H4qFd +WZJpja9qq+CPZnL+O0S2dMQNrzjHftzYzcSHimxvZxHJ/pR4xv2+poCGg8p1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690431121; 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=yRyJyAz/62WkPpr1k701R7Xec/Fqee1zIn/TWyqXWe8=; b=RWECaFW9KGF90whCsL99J03lobTPK7BwY/MwgFictv6DlhTzR93VTRMtXTf5S0eKDtQ6J5 crmtyt0HDaZNc6BuKZTbgwEYdLLrGFs+AHDH+TgzxNVAmXMfOaDZCW2lN5gYiLCKGmSBeh drI8S4U1bqd0bGkTGGG0I8jrG5PuA4jqWSbefPq2emS0Jw8z7l5727qetBDUe1wtreKZ8S awlj62YVN0eVzZq+h1//FWhEwjskIFWZja3FsUZDGCYcPbUAO662P5bhOtXAv6lefbOKKe asTMy8aZYtCnodlhm/vj87m/W6aiQPKGHxtI5obq+CmduMot0i8roRLh08v2aA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690431121; a=rsa-sha256; cv=none; b=Wwg9GKDq2sK/kmJIQzc2zFkcXcS7Ue7bXDnZE8bjD/TaD9R9nCpgiO+I4QWlkLNb2TgyXr MwWBX9fPtGMaOrISeb482Df6Ie6trQBT1CjFWlQipDbD2/tGcCqGhQbOhSP//KZ/wAfFjV glYU7HOK8ajkieoP3vzPuOucZBSEZUMnNtASZnnXYgY4G6GsPn67CHOq056R6hXIq6dLKB mtY3Ze2JRtFmHyoRN2DW9F1X1Z38N5HubRVHkZROa1YzobjbJ3Vfwb2tQVv9gcYM4bSbY1 g+ceJ2ljhc1Snlt3HE0RdastO33tQRplBfFJ4MskjmOyk+hXDgpQ2Bvg740ylA== 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 4RBHQn19Qxz191L; Thu, 27 Jul 2023 04:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36R4C1Bx097646; Thu, 27 Jul 2023 04:12:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36R4C1cY097645; Thu, 27 Jul 2023 04:12:01 GMT (envelope-from git) Date: Thu, 27 Jul 2023 04:12:01 GMT Message-Id: <202307270412.36R4C1cY097645@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 81805ec30074 - main - depend-cleanup.sh: Generalise lib32 code and avoid duplication 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81805ec30074363e5d7d7add37b3ccf4f1eb396b Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=81805ec30074363e5d7d7add37b3ccf4f1eb396b commit 81805ec30074363e5d7d7add37b3ccf4f1eb396b Author: Jessica Clarke AuthorDate: 2023-07-27 04:10:47 +0000 Commit: Jessica Clarke CommitDate: 2023-07-27 04:10:47 +0000 depend-cleanup.sh: Generalise lib32 code and avoid duplication By passing through _ALL_libcompats we can avoid hard-coding the list of libcompats in depend-cleanup.sh. This cleanup also makes clean_dep shorter by using a loop instead of handling each case explicitly (at the expense of slightly tweaked logging). Reviewed by: brooks, jhb Differential Revision: https://reviews.freebsd.org/D41187 --- Makefile.inc1 | 1 + tools/build/depend-cleanup.sh | 44 +++++++++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index b3a33a928ee5..3f0546861bbd 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1026,6 +1026,7 @@ _sanity_check: .PHONY .MAKE _cleanobj_fast_depend_hack: .PHONY @echo ">>> Deleting stale dependencies..."; MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} \ + ALL_libcompats=${_ALL_libcompats:Q} \ sh ${.CURDIR}/tools/build/depend-cleanup.sh ${OBJTOP} _worldtmp: .PHONY diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 39ab518d5dc9..687f04f57f8c 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -73,6 +73,10 @@ if [ -z "${MACHINE_ARCH+set}" ]; then err "MACHINE_ARCH not set" fi +if [ -z "${ALL_libcompats+set}" ]; then + err "ALL_libcompats not set" +fi + run() { if [ "$VERBOSE" ]; then @@ -88,18 +92,15 @@ run() # $3 source extension clean_dep() { - if egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.*o 2>/dev/null; then - echo "Removing stale dependencies and objects for $2.$3" - run rm -f \ - "$OBJTOP"/$1/.depend.$2.* \ - "$OBJTOP"/$1/$2.*o - fi - if egrep -qw "$2\.$3" "$OBJTOP"/obj-lib32/$1/.depend.$2.*o 2>/dev/null; then - echo "Removing 32-bit stale dependencies and objects for $2.$3" - run rm -f \ - "$OBJTOP"/obj-lib32/$1/.depend.$2.* \ - "$OBJTOP"/obj-lib32/$1/$2.*o - fi + for libcompat in "" $ALL_libcompats; do + dirprfx=${libcompat:+obj-lib${libcompat}/} + if egrep -qw "$2\.$3" "$OBJTOP"/$dirprfx$1/.depend.$2.*o 2>/dev/null; then + echo "Removing stale ${libcompat:+lib${libcompat} }dependencies and objects for $2.$3" + run rm -f \ + "$OBJTOP"/$dirprfx$1/.depend.$2.* \ + "$OBJTOP"/$dirprfx$1/$2.*o + fi + done } # Date Rev Description @@ -113,7 +114,10 @@ if [ -e "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o ] && \ egrep -qw "cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c" \ "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o; then echo "Removing old ZFS tree" - run rm -rf "$OBJTOP"/cddl "$OBJTOP"/obj-lib32/cddl + for libcompat in "" $ALL_libcompats; do + dirprfx=${libcompat:+obj-lib${libcompat}/} + run rm -rf "$OBJTOP"/${dirprfx}cddl + done fi # 20200916 WARNS bumped, need bootstrapped crunchgen stubs @@ -134,7 +138,10 @@ fi # 20210108 821aa63a0940 non-widechar version of ncurses removed if [ -e "$OBJTOP"/lib/ncurses/ncursesw ]; then echo "Removing stale ncurses objects" - run rm -rf "$OBJTOP"/lib/ncurses "$OBJTOP"/obj-lib32/lib/ncurses + for libcompat in "" $ALL_libcompats; do + dirprfx=${libcompat:+obj-lib${libcompat}/} + run rm -rf "$OBJTOP"/${dirprfx}lib/ncurses + done fi # 20210608 f20893853e8e move from atomic.S to atomic.c @@ -183,10 +190,11 @@ clean_dep lib/libc kqueue1 S # 20230623 b077aed33b7b OpenSSL 3.0 update if [ -f "$OBJTOP"/secure/lib/libcrypto/aria.o ]; then echo "Removing old OpenSSL 1.1.1 tree" - run rm -rf "$OBJTOP"/secure/lib/libcrypto \ - "$OBJTOP"/secure/lib/libssl \ - "$OBJTOP"/obj-lib32/secure/lib/libcrypto \ - "$OBJTOP"/obj-lib32/secure/lib/libssl + for libcompat in "" $ALL_libcompats; do + dirprfx=${libcompat:+obj-lib${libcompat}/} + run rm -rf "$OBJTOP"/${dirprfx}secure/lib/libcrypto \ + "$OBJTOP"/${dirprfx}secure/lib/libssl + done fi # 20230714 ee8b0c436d72 replace ffs/fls implementations with clang builtins