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

[XEN PATCH 2/3] build: evaluate XEN_BUILD_* and XEN_DOMAIN on first use


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Wed, 21 Jun 2023 17:19:58 +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: Wed, 21 Jun 2023 16:20:38 +0000
  • Ironport-data: A9a23:d68rDq1mvf/mAbqcQvbD5e1xkn2cJEfYwER7XKvMYLTBsI5bp2RSy 2IWCjyFOfzZNmanLYslbYjl8RgP7JLUnNRjHgs5pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb8HuDgNyo4GlD5gJkPKgX1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfIzwTq dUdKWwxSxmDp7ik3LThcOdRmZF2RCXrFNt3VnBIyDjYCbAtQIzZQrWM7thdtNsyrpkQR7CEP ZNfMGcxKk2aOHWjOX9OYH46tO6umnn4dSwesF+PrLA7y2PS0BZwwP7mN9+9ltmiHJwPzxjI+ Dudl4j/KjMZNJ+0ygeMzm2D16zonT7+B5I9OKLto5aGh3XMnzdOWXX6T2CTsfS/z0KzRd9bA 0gV4TY167g/8lSxSdvwVAH+p2SL1jYeUtxcCfwn6ymCz6PV50CSAW1sZjxLZcEitcQ2bSc3z VLPlNTsbRRtrbmURHS15rqS6zSoNkA9NnQebCUJSQ8E5djLo4wpiB/LCNF5H8adkdndCTz2h TeQo0ADa6471JBRkf/hpBae3mzq/8KSJuIo2unJdkD4s19QYY/5W6mh6XiB/+pGdryXc0bU6 RDohPOiAPAy4YClzXLdH79dQ+j5vZ5pIxWH3wcxQsBJGyCFvif6INsOuGwWyFJBaJ5sRNP/X KPEVeq9Drd3NWDiU6J4apnZ5y8Cnfm5ToSNuhw5g7NzjnlNmOyvpnsGiba4hTyFraTVufhX1 W2nWcitF20GLq9s0SC7QewQuZdymHBhnzONHc2rlUT9uVZ7WJJyYe1fWGZik8hjtP/UyOkr2 4s32zS2J+V3D7SlP3i/HX87JlEWN3krba0aWOQOHtNv1jFOQTl7Y9eImONJRmCQt/gN/gs+1 i3nCxAwJZuWrSGvFDhmnVgzNO+wBcoj9ilT0O5FFQ/A5kXPqL2HtM83H6bbt5F9rISPEdYco yE5Rvi9
  • Ironport-hdrordr: A9a23:O4+ueq38PCzK4QmNl4MYoAqjBLQkLtp133Aq2lEZdPRUGvb2qy nIpoV96faUskdpZJhOo7G90cW7LE80sKQFg7X5Xo3SODUO2lHJEGgK1+KLqFfd8m/Fh4tgPM 9bAs5D4bbLY2SS4/yX3ODBKadC/OW6
  • 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>
---
 xen/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 9631e45cfb9b..b58c2a7f4539 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®.