From patchwork Mon Dec 13 19:04:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12674543 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 33722C433EF for ; Mon, 13 Dec 2021 19:07:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.246280.424735 (Exim 4.92) (envelope-from ) id 1mwqfR-00080F-Dp; Mon, 13 Dec 2021 19:07:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 246280.424735; Mon, 13 Dec 2021 19:07:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mwqfR-000808-AZ; Mon, 13 Dec 2021 19:07:21 +0000 Received: by outflank-mailman (input) for mailman id 246280; Mon, 13 Dec 2021 19:07:20 +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 1mwqfQ-000802-JU for xen-devel@lists.xenproject.org; Mon, 13 Dec 2021 19:07:20 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e3b324e5-5c47-11ec-9e60-abaf8a552007; Mon, 13 Dec 2021 20:07:19 +0100 (CET) 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: e3b324e5-5c47-11ec-9e60-abaf8a552007 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1639422438; h=from:to:cc:subject:date:message-id:mime-version; bh=8ru3lFSf84OZ17ioZSPEU1QzbNuOpBrkz3ImK0ue+tw=; b=GhrE9rqfBMU4jZf4iC7aj9O/jjSvQVCivMpfu9jRVHyhjj/B58WEA1Qn wVHGQjJT6V9+R0lJDoJ85zq8Gu9BCYeYmqEHsSQSXFvBGoI5B+NeCdgkI A/CTFIyMzou9JIM3YhJwIvidONCsLaTla5c5hiwcMQ+fkBs7uiiZDUj34 Q=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: KsaWIhNLvGOXcdLd28a8g/6bCkbsDR2v+kjJgEFTL47kuMHiQtrODB8K7N4dp0cWM2xYFCJrB0 VyzVWtwYDEzeHPNXfsswUc2WxoxKMLeOmJGNkyZQahX5GOOkPe0EQZMzJAEOSNsknCd2mBfw11 ixmrGBoP4uMM88f8Th1UQOmnkuzqlJGUQ5hZUUQOKFbYLY4t3amBYiTaGEoX81O/uZ7KyVtsCH Mv9LVc1J3HIt1easU7bWxOaFKpg2IKNtIXZZ9ICF+Xe1ZpAwcRzOqbQzVKLeq8Ml4c2jl+iI5K Ru0Bb81AQCcCcgOB/Y01+Via X-SBRS: 5.1 X-MesageID: 59420564 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:T40yZ6qdO1XHrH21A4S5cDp4KC1eBmInYhIvgKrLsJaIsI4StFCzt garIBnQOf+JMGCkf4h1atjlphwGvcKAx4JhTABqqSk3EHlHoJuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlZT4vE2xbuKU5NTsY0idfic5Dndx4f5fs7Rh2Ncx24HiW1jlV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjX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fYUDJBSyqNBncnWjgOU2LscALQT46gGbj wvGUw0FoeTtopMu9IWbj66zsIr0QfB1GVBXHjeH4O/uZzXa5Geq3aRJTP2MIWLGTGrx9aivO bdVwvX7PKFVlVpGqdMhQbNizKZ47Nrzvb5KiA9jGSyTPVisD7phJFiA3NVO6fIRluMI51PuV xLd4MReNJWIJNjhQQwYKwcSZ+ie0e0Zx2vJ5vMvLUSmvCJ68dJri6mJ08VgXMCFEIZIDQ== IronPort-HdrOrdr: A9a23:NcZcC6NIEWjrF8BcTtejsMiBIKoaSvp037Eqv3oedfU1SL3+qy nAppQmPHPP5Ar5O0tQ/exoWpPwIk80nKQdieJ6UItKNDOW3VdAR7sC0WKN+VLd8lXFh4xg6Z s= X-IronPort-AV: E=Sophos;i="5.88,203,1635220800"; d="scan'208";a="59420564" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Juergen Gross , Wei Liu , Anthony PERARD Subject: [PATCH] tools/libs: Don't recursively expand MAJOR ?= $(shell ...) Date: Mon, 13 Dec 2021 19:04:49 +0000 Message-ID: <20211213190449.4830-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 ?= is a deferred assignment. Switch to an alternative form which lets us use an immediate assignment. Before, version.sh gets run anywhere between 46 and 88 times, with 50 on a `clean`. After, 6 times, invariant of main rune, and whether it is an incremental build or not. Signed-off-by: Andrew Cooper Reviewed-by: Anthony PERARD --- CC: Juergen Gross CC: Wei Liu CC: Anthony PERARD The identity transform comes from the docs https://www.gnu.org/software/make/manual/make.html#Flavors (final paragraph). Something slightly weird is going on. Before this, the exact number of hits that verson.sh gets isn't stable, even when running repeat incremental builds. I suspect this means we've got a lurking parallel build issue. --- tools/libs/libs.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index dfbbef4080f6..b21e0bf083a0 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -6,7 +6,10 @@ # MINOR: minor version of lib (0 if empty) LIBNAME := $(notdir $(CURDIR)) -MAJOR ?= $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile) + +ifeq ($(origin MAJOR), undefined) +MAJOR := $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile) +endif MINOR ?= 0 SHLIB_LDFLAGS += -Wl,--version-script=libxen$(LIBNAME).map