[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH v2 4/5] build: evaluate XEN_BUILD_* and XEN_DOMAIN on first use


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 22 Jun 2023 16:30:04 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jason Andryuk <jandryuk@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "George Dunlap" <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 22 Jun 2023 15:33:30 +0000
  • Ironport-data: A9a23:2usFaapblDo58Dgg6laOglkQp0JeBmLcZRIvgKrLsJaIsI4StFCzt garIBmFMv2LZWXyeItwaY3k8klXvZSBx9EwQARv+309FiJA9JuZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weAzSNNUPrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXACkUbz2tnrKb/KqmWNZdndUDA5bxAapK7xmMzRmBZRonaZXKQqGM7t5ExjYgwMtJGJ4yZ eJAN2ApNk6ZJUQSZBFOUslWcOSA3xETdxVRrk6VoqwmpXDe1gVr3JDmMcbPe8zMTsJQ9qqdj jufpDypWUpLbbRzzxKAwi+JncmIpRriQY0+JJKBzNM6sE+Mkzl75Bo+CgLg/KjRZlSFc8JSL QkY9zQjqYA29Ve3VZ/tUhugunmGsxUAHd1KHIUS6giLxrDF/gWxCW0NTzoHY9sj3Oc0TzE30 l6Cn/vyGCdi9raSTBq19KqQrD60ETgYKykFfyBsZRAe/9DprYU3jxTOZtVuCqi4ipvyAz6Y6 y+OhDgzgfMUl8Fj6kmg1QmZ2XT2/MGPF1NroFyNBQpJ8z+Veqa8fo2Fx0GLwMpYMZSmf0KQn FdbgfW3ubVm4Y62qMCdfAkcNOj3t6nebm2C3Q4H84oJrGr0pSP6FWxEyHQnfRoybJ5ZEdP8S BWL0T698qO/K5dDgUVfR4uqQ/onwqH7fTgOfqCFN4EeCnSdmeLuwc2PWaJz9zq3+KTUuftjU ap3iO71ZZrgNYxpzSCtW8AW2qIxyyY1yAv7HM6rkE/4i+DOPCPOGN/p1WdiiMhjt8toRy2Pq b5i2zaikU0DAIUSnAGJmWLsEbz6BSdiXs2nwyCmXuWCPhBnCAkc5wz5mNscl3het/0NzI/gp yjtMnK0PXKj3RUr3y3WMCE8AF4uNL4jxU8G0dsEZA32hyN9Ptbztc/ytfIfJNEayQCq9tYsJ 9FtRilKKq8npujvk9jFUaTAkQ==
  • Ironport-hdrordr: A9a23:WZH+hKuyK7thvGKtIKL2NI8X7skDcNV00zEX/kB9WHVpmszxra +TdZMgpHjJYVcqKQgdcL+7WZVoLUmwyXcx2/hyAV7AZniDhILLFuFfBOLZqlWKcREWtNQtsJ uIG5IObuEYZmIVsS+V2mWF+q4bsbq6zJw=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 necessery, we
will use a construct to evaluate on first use.

Reported-by: Jason Andryuk <jandryuk@xxxxxxxxx>
Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Tested-by: Jason Andryuk <jandryuk@xxxxxxxxx>
---
 xen/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index ac2765050b..e3b1468f83 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -11,10 +11,10 @@ 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)
+export XEN_DOMAIN      ?= $(eval XEN_DOMAIN := $(shell ([ -x 
/bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && 
/bin/domainname || echo [unknown])))$(XEN_DOMAIN)
+export XEN_BUILD_DATE  ?= $(eval XEN_BUILD_DATE := $(shell LC_ALL=C 
date))$(XEN_BUILD_DATE)
+export XEN_BUILD_TIME  ?= $(eval XEN_BUILD_TIME := $(shell LC_ALL=C date 
+%T))$(XEN_BUILD_TIME)
+export XEN_BUILD_HOST  ?= $(eval XEN_BUILD_HOST := $(shell 
hostname))$(XEN_BUILD_HOST)
 
 # 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.
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.