From patchwork Mon Apr 4 13:20:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Eckert X-Patchwork-Id: 1613031 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ZWKTSHS0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KXBQK0GpFz9sFq for ; Mon, 4 Apr 2022 23:27:05 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=u0YXokEkkOVuoz9bMwIZrVhmo2WIRLzIc4TX27jBh+o=; b=ZWKTSHS0Wq5wrP Mx3nUxNWALmdJ6MHOWaAOLoZ3TN2P3xXB23deXN0zQ7/lavRjlESm558uIXgzxLNcRR/d5O33Ckll 781dWuu8KtsQbYnC8wN5ru1DLrcwED/MT+6D3fH0lmWHA3LOhVzlCJJD7NUw+AGViQxN/XJWnf7Rh 9AUxhJ7SNq13oEZPDE9nlLBHJFCPBSCcxzOJIQbpOblC7g7lim3VxwMtwdl+Q2VO1LC//a2rOmZzb t8hWyLmxV+o0BNb5AocyIj7MHkHMDiBcfB45gzQpcAzVs/sK3LQTKqrdV6J9gs34+Is7uZkU29K1e fSlsJ9QQieoKkPl5p3tA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbMhY-00F5lz-6c; Mon, 04 Apr 2022 13:25:00 +0000 Received: from mxout70.expurgate.net ([91.198.224.70]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbMds-00F4JP-EM for openwrt-devel@lists.openwrt.org; Mon, 04 Apr 2022 13:21:14 +0000 Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1nbMdl-000LyZ-8l; Mon, 04 Apr 2022 15:21:05 +0200 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbMdk-000IKG-Ct; Mon, 04 Apr 2022 15:21:04 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id D9B6424004B; Mon, 4 Apr 2022 15:21:03 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 7DD51240040; Mon, 4 Apr 2022 15:21:03 +0200 (CEST) Received: from localhost.localdomain (unknown [10.2.3.40]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 12A1820B9C; Mon, 4 Apr 2022 15:21:02 +0200 (CEST) From: Florian Eckert To: nbd@nbd.name, mail@aparcar.org, Eckert.Florian@googlemail.com Cc: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/2] build: add logging output for host build Date: Mon, 4 Apr 2022 15:20:53 +0200 Message-ID: <20220404132054.3387697-1-fe@dev.tdt.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dev.tdt.de X-purgate-type: clean X-purgate: clean X-purgate-ID: 151534::1649078465-00000617-3183A9F5/0/0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220404_062112_672971_DAD3EFDF X-CRM114-Status: GOOD ( 10.46 ) X-Spam-Score: -0.7 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The output of the build log is very confusing. In order to better distinguish the individual steps during debugging, this commit writes a logging mark into the build log. - *** Calling Host/Configure/ [...] Content analysis details: (-0.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [91.198.224.70 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The output of the build log is very confusing. In order to better distinguish the individual steps during debugging, this commit writes a logging mark into the build log. - *** Calling Host/Configure/Default () - *** Calling Host/Compile/Default () - *** Calling Host/Install/Default () Signed-off-by: Florian Eckert --- include/host-build.mk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/host-build.mk b/include/host-build.mk index 7f76eb1a2f..b31bf93b30 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -82,6 +82,7 @@ ifeq ($(HOST_OS),Darwin) endif define Host/Configure/Default + @echo '*** Calling Host/Configure/Default ($(PKG_NAME)) ***' $(if $(HOST_CONFIGURE_PARALLEL),+)(cd $(HOST_BUILD_DIR)/$(3); \ if [ -x configure ]; then \ $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/$(3)/ && \ @@ -95,10 +96,11 @@ define Host/Configure/Default endef define Host/Configure - $(call Host/Configure/Default) + $(call Host/Configure/Default) endef define Host/Compile/Default + @echo '*** Calling Host/Compile/Default ($(PKG_NAME)) ***' +$(HOST_MAKE_VARS) \ $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ $(HOST_MAKE_FLAGS) \ @@ -106,18 +108,18 @@ define Host/Compile/Default endef define Host/Compile - $(call Host/Compile/Default) + $(call Host/Compile/Default) endef define Host/Install/Default + @echo '*** Calling Host/Install/Default ($(PKG_NAME)) ***' $(call Host/Compile/Default,install) endef define Host/Install - $(call Host/Install/Default,$(HOST_BUILD_PREFIX)) + $(call Host/Install/Default) endef - ifneq ($(if $(HOST_QUILT),,$(CONFIG_AUTOREBUILD)),) define HostHost/Autoclean $(call rdep,${CURDIR} $(PKG_FILE_DEPENDS),$(HOST_STAMP_PREPARED)) From patchwork Mon Apr 4 13:20:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Eckert X-Patchwork-Id: 1613030 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=0bjmu4uD; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KXBQ46WKcz9sFq for ; Mon, 4 Apr 2022 23:26:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e4puxo3Xycml4yQXPAa7Kzm6+5t1cXqLBiBIc6CoQZE=; b=0bjmu4uDUG2sOL ojRS2eomCi2UJY9LItvPV7yk+2Fo6khj1e9KEkHHoHYqaxT9EX0/gWkVFyZR2JhmsfLF3if4WljsP CParGnK57ZvbxXLtrTivJk5V91ioot/Y0/C2fN1AViOGv0Nk0slz5v61diVNhFnivpwpa5V0PxcQS p1EV2XulChzWgajTwKK96aEWstB08ltVL4qoOoCdY72LQTI75uOCokbkvuyolmzI5O/AXBLAEZHXy zQxbEZzr2rRWSThE7cZUHXvf+5Qbwny6OtsZTNU9ysyKVBZZ9Bvp6lncsQnSvekpbeQBCfjpKYAk4 jPSIvEYU3c335LCx9dEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbMgT-00F5QA-WA; Mon, 04 Apr 2022 13:23:54 +0000 Received: from mxout70.expurgate.net ([91.198.224.70]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbMds-00F4Jh-E9 for openwrt-devel@lists.openwrt.org; Mon, 04 Apr 2022 13:21:13 +0000 Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1nbMdl-000JNr-8y; Mon, 04 Apr 2022 15:21:05 +0200 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbMdk-000IKF-Ck; Mon, 04 Apr 2022 15:21:04 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 1A19E240040; Mon, 4 Apr 2022 15:21:04 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id AF517240049; Mon, 4 Apr 2022 15:21:03 +0200 (CEST) Received: from localhost.localdomain (unknown [10.2.3.40]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 788372675C; Mon, 4 Apr 2022 15:21:03 +0200 (CEST) From: Florian Eckert To: nbd@nbd.name, mail@aparcar.org, Eckert.Florian@googlemail.com Cc: openwrt-devel@lists.openwrt.org Subject: [PATCH 2/2] build: add Uninstall for host build Date: Mon, 4 Apr 2022 15:20:54 +0200 Message-ID: <20220404132054.3387697-2-fe@dev.tdt.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220404132054.3387697-1-fe@dev.tdt.de> References: <20220404132054.3387697-1-fe@dev.tdt.de> MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dev.tdt.de X-purgate-ID: 151534::1649078465-00006984-0C8DA71D/0/0 X-purgate-type: clean X-purgate: clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220404_062112_655526_03B0BEC4 X-CRM114-Status: GOOD ( 15.57 ) X-Spam-Score: -0.7 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently there is no possibility for host package to cleanly remove the installed files in staging. There is the possibility to call an uninstall make target, but if this is not implemented, and so n [...] Content analysis details: (-0.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [91.198.224.70 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Currently there is no possibility for host package to cleanly remove the installed files in staging. There is the possibility to call an uninstall make target, but if this is not implemented, and so nothing happens. For debugging, it makes sense to know what is being installed. With this change, the install process is called twice. Once to create a .host-install file and once to install the package files into the staging directory. If the tool is removed, the .host-install file is used to remove all files from the staging dirctories. This only works for the generic autotools install and uninstall target. Signed-off-by: Florian Eckert --- include/host-build.mk | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/include/host-build.mk b/include/host-build.mk index b31bf93b30..d0f1a3eda5 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -113,13 +113,37 @@ endef define Host/Install/Default @echo '*** Calling Host/Install/Default ($(PKG_NAME)) ***' - $(call Host/Compile/Default,install) + +$(HOST_MAKE_VARS) \ + $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ + DESTDIR="$(HOST_INSTALL_DIR)" \ + $(HOST_MAKE_FLAGS) \ + install + cd $(HOST_INSTALL_DIR) && \ + find . | sed 's|^.||' > $(HOST_BUILD_DIR)/.host-install && \ + rm -rf $(HOST_INSTALL_DIR) + +$(HOST_MAKE_VARS) \ + $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ + $(HOST_MAKE_FLAGS) \ + install endef define Host/Install $(call Host/Install/Default) endef +define Host/Uninstall/Default + @echo '*** Calling Host/Uninstall/Default ($(PKG_NAME)) ***' + if [ -f "$(HOST_BUILD_DIR)/.host-install" ]; then \ + $(XARGS) $(RM) < $(HOST_BUILD_DIR)/.host-install; \ + $(FIND) $(STAGING_DIR_HOST) -type d -empty -print -delete; \ + $(FIND) $(STAGING_DIR_HOSTPKG) -type d -empty -print -delete; \ + fi +endef + +define Host/Uninstall + $(call Host/Uninstall/Default) +endef + ifneq ($(if $(HOST_QUILT),,$(CONFIG_AUTOREBUILD)),) define HostHost/Autoclean $(call rdep,${CURDIR} $(PKG_FILE_DEPENDS),$(HOST_STAMP_PREPARED))