From patchwork Thu Jul 27 14:54:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 13330210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1EE7C04A6A for ; Thu, 27 Jul 2023 14:55:11 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.571158.894338 (Exim 4.92) (envelope-from ) id 1qP2OH-0003Sh-Vs; Thu, 27 Jul 2023 14:54:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 571158.894338; Thu, 27 Jul 2023 14:54:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qP2OH-0003RY-Px; Thu, 27 Jul 2023 14:54:57 +0000 Received: by outflank-mailman (input) for mailman id 571158; Thu, 27 Jul 2023 14:54:56 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qP2OG-0003Ok-RC for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:54:56 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8ca5998a-2c8d-11ee-b248-6b7b168915f2; Thu, 27 Jul 2023 16:54:55 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8ca5998a-2c8d-11ee-b248-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1690469696; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ohc1iV0GThxiLbuhMafuZPgcgU3YvgSTIZgUQtbNJOA=; b=App6GUa/Xmz82snkjg8mykFveGwhLbPMKDmxNfy0zHkztz+m3GMXfuiQ V1cZl4WKym9oIZTyw3kho1Num+MEc9IYJ0iQe7thZUc82BsO7BAEjCPze en184+FwPOB5mkMg/5ZxVWH98pNZsR8gXVV8+MDm5htzNDeqN91Kdum/E Y=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 118094561 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:Of4ZtaBNa7/YixVW/+3jw5YqxClBgxIJ4kV8jS/XYbTApG5w1mECy GFKDW3VPquKNDT9LdF+Po2zpksGsJSAyYQwQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxC4QRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw6sRbG2131 /YkLxsmNU/SqtLv8rOpY7w57igjBJGD0II3v3hhyXfSDOo8QICFSKLPjTNa9G5u3IYUR6+YP pdHL2M1N3wsYDUWUrsTIJs4gOevgGi5azBCoUiZjaE2/3LS3Ep6172F3N/9I4XaHZQ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01,235,1684814400"; d="scan'208";a="118094561" From: Anthony PERARD To: CC: Anthony PERARD , Jason Andryuk , Andrew Cooper , "George Dunlap" , Jan Beulich , "Julien Grall" , Stefano Stabellini , Wei Liu Subject: [XEN PATCH v3 1/2] build: evaluate XEN_BUILD_* and XEN_DOMAIN immediately Date: Thu, 27 Jul 2023 15:54:46 +0100 Message-ID: <20230727145447.2701-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727145447.2701-1-anthony.perard@citrix.com> References: <20230727145447.2701-1-anthony.perard@citrix.com> MIME-Version: 1.0 With GNU make 4.4, the number of execution of the command present in these $(shell ) increased greatly. This is probably because as of make 4.4, exported variable are also added to the environment of $(shell ) construct. Also, `make -d` shows a lot of these: Makefile:15: not recursively expanding XEN_BUILD_DATE to export to shell function Makefile:16: not recursively expanding XEN_BUILD_TIME to export to shell function Makefile:17: not recursively expanding XEN_BUILD_HOST to export to shell function Makefile:14: not recursively expanding XEN_DOMAIN to export to shell function So to avoid having these command been run more than necessary, we will replace ?= by an equivalent but with immediate expansion. Reported-by: Jason Andryuk Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- Notes: v3: - replace evaluation on first use construct by immediate expansion which isn't likely to break and is clearer. xen/Makefile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index e8aa663781..c1738dbbde 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -11,10 +11,18 @@ export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) -include xen-version export XEN_WHOAMI ?= $(USER) -export XEN_DOMAIN ?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown])) -export XEN_BUILD_DATE ?= $(shell LC_ALL=C date) -export XEN_BUILD_TIME ?= $(shell LC_ALL=C date +%T) -export XEN_BUILD_HOST ?= $(shell hostname) +ifeq ($(origin XEN_DOMAIN), undefined) +export XEN_DOMAIN := $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown])) +endif +ifeq ($(origin XEN_BUILD_DATE), undefined) +export XEN_BUILD_DATE := $(shell LC_ALL=C date) +endif +ifeq ($(origin XEN_BUILD_TIME), undefined) +export XEN_BUILD_TIME := $(shell LC_ALL=C date +%T) +endif +ifeq ($(origin XEN_BUILD_HOST), undefined) +export XEN_BUILD_HOST := $(shell hostname) +endif # Best effort attempt to find a python interpreter, defaulting to Python 3 if # available. Fall back to just `python` if `which` is nowhere to be found. From patchwork Thu Jul 27 14:54:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 13330212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F55BC04A6A for ; Thu, 27 Jul 2023 14:55:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.571159.894352 (Exim 4.92) (envelope-from ) id 1qP2OO-0003yc-8J; Thu, 27 Jul 2023 14:55:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 571159.894352; Thu, 27 Jul 2023 14:55:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qP2OO-0003yV-3u; Thu, 27 Jul 2023 14:55:04 +0000 Received: by outflank-mailman (input) for mailman id 571159; Thu, 27 Jul 2023 14:55:02 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qP2OM-0003ww-LK for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:55:02 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8e600259-2c8d-11ee-8613-37d641c3527e; Thu, 27 Jul 2023 16:55:00 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8e600259-2c8d-11ee-8613-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1690469700; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u9VUyPNCX/m9UxlOUYomFLQl8PbYRLIgdSRaAegbCOg=; b=PeD/0QXGY+YPnkjbCckE1lw1hasHd65KcNu5uqQ0nTvgGbJhCSTNbAUu 6SqtuTLhkwhf8O1mEnmiRX9DBIHBoVOJErat+7gLaI2M4MY20KF32wmYu 6PPHLTWCgpY8WjFXeNGCFlypSwVkQb+L4wCKRfReIPKRCS5CU6xHHOGlq Y=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 117536776 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:FVLePqmvXHapho1kMBNQOvzo5gxFJkRdPkR7XQ2eYbSJt1+Wr1Gzt xJKWDvSP/aDamKgLtAgad/j9k9SvJTdztRkSwNsrnhhFiMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE0p5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YssQ4b6Ky90cW7IE80lqQFkrX5Q43SPjUO0VHAROtfBODZsl7d8kPFh4tgPa wJSdkANDWZZ2IXsS6QijPWLz7uquPrzImYwd77i1NRZUVSbadkhj0JeDpy0CdNNXd77V5SLu vt2iKDzQDQCEj/Ff7LYkUtbqz4vtjWk5CjSQcebiRXkTWmvHeT8bvnFBrd9QsfVj4n+8ZezU H11zbh47mlsbWdwhvRvlWjiKh+qZ/a095eA87JrNYTJi6EsHfPWK1RH4eauSwzoqWUyHtCqq i1nz4Qe/5r7m/XfCWOrQDz1xLG2DIjgkWSsmOwsD/YuMnkQzB/NMZbn4JedXLimjAdgO0= X-Talos-CUID: 9a23:YQulCGGUfY41HZugqmJb+3cbRuEmc0SM5ynPJUGHDmhGaaCaHAo= X-Talos-MUID: 9a23:ckGnNwqx0NXaDvIFtdoezzxtOf9Q+pWBMRBOoZo6ifDDMRF0Ih7I2Q== X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; d="scan'208";a="117536776" From: Anthony PERARD To: CC: Anthony PERARD , Jason Andryuk , Andrew Cooper , "George Dunlap" , Jan Beulich , "Julien Grall" , Stefano Stabellini , Wei Liu Subject: [XEN PATCH v3 2/2] Config.mk: evaluate XEN_COMPILE_ARCH and XEN_OS immediately Date: Thu, 27 Jul 2023 15:54:47 +0100 Message-ID: <20230727145447.2701-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727145447.2701-1-anthony.perard@citrix.com> References: <20230727145447.2701-1-anthony.perard@citrix.com> MIME-Version: 1.0 With GNU make 4.4, the number of execution of the command present in these $(shell ) increased greatly. This is probably because as of make 4.4, exported variable are also added to the environment of $(shell ) construct. So to avoid having these command been run more than necessary, we will replace ?= by an equivalent but with immediate expansion. Reported-by: Jason Andryuk Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- Notes: v3: - replace evaluation on first use construct by immediate expansion which isn't likely to break and is clearer. Config.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Config.mk b/Config.mk index c529b1ba19..dc3afaa47e 100644 --- a/Config.mk +++ b/Config.mk @@ -19,13 +19,17 @@ or = $(if $(strip $(1)),$(1),$(if $(strip $(2)),$(2),$(if $(strip $(3)),$( -include $(XEN_ROOT)/.config -XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \ +ifeq ($(origin XEN_COMPILE_ARCH), undefined) +XEN_COMPILE_ARCH := $(shell uname -m | sed -e s/i.86/x86_32/ \ -e s/i86pc/x86_32/ -e s/amd64/x86_64/ \ -e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \ -e s/aarch64/arm64/) +endif XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) -XEN_OS ?= $(shell uname -s) +ifeq ($(origin XEN_OS), undefined) +XEN_OS := $(shell uname -s) +endif CONFIG_$(XEN_OS) := y