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

Re: [PATCH] tools/libs: Don't recursively expand MAJOR ?= $(shell ...)


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 14 Dec 2021 09:17:53 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1M1jZEk8y/cZ4cSseQogy/PTToa4wa29DPrFL1OXdX0=; b=ZoBJviMsbeQ3SRj0X865tVNoWIs3KbFgtXV9/+a6GUN5ZZFb/8OXxH2fbEucWDdTJq5FDoivyf1lZ6G2lO4nv947bjjZQNQ9Zlg5kF9Y+kBo0lpxFh69Fm6LCxbWikpky1xfcfKP6ggJvXdjtgBjQAaTaUwwiQuFsi6q728gLhsvMaVhnsHe5sscPhbbp6LvyZOMjbIhJPLOoRbK6XvElNzJqsCBCcdWmjzYXdV+6TkNBbEZkJaMciiUk7dorQqPjYcLoaD2oy8m29aJQQb1N5JF+/jHBZwPX22VHKP07rmwx/BQyiAus/npRfCOKzTF5W+3ZXGEjF6k7MKO9WBW0A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZMalv9Vih9Lo+gi0Ir52NYo78yYwniSRvULX7Celnft0r3LTilzuUsFFwjb7YN2a+WjjP4wa5ocSLVR54Lif2srjKKZ9zkNXyUYRD2Lu5//5wdiImb0CjDo89eP9U8lAQffkwVQAR4rnmhGPYFTlsvPF5IW/uTUmoL+En5/l3xGs5f6h2fhXGTjJUiGJkNdhijlx9r3Bdxv2XO0wEAaGOpPDePm4KayEUTWUpajIB2+m2s880gWGkeqm27pQbGdRY0WXgVs9RjxrdduQ36HevCynLWD89IqCFLuQHGyD9/bEHzXdEnagz7CA1bC0wGCmlmXlL46o/8L1LbATrNfu/A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 14 Dec 2021 08:18:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.12.2021 20:04, Andrew Cooper wrote:
> --- 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

Wouldn't it be better to move the "endif" past the setting of MINOR
(which then could use := as well)? Libraries with their own versioning
would imo better specify both rather than relying on getting 0 from
here (which at present none of them does). Would require an
adjustment to the comment at the top of libs.mk, though.

And further, since you're switching to $(origin ...), wouldn't this
be an opportunity to avoid stray inheriting of values from the
environment, by switching to "ifneq ($(origin MAJOR), file)"? Or is
there an intention of allowing such control via the environment
(which would then override the versions for all libraries not
explicitly setting them)? In turn I would then further wonder
whether command line overrides are intended, but I guess people
doing so ought to indeed get what they have asked for (all libraries
versioned identically, assuming both MAJOR and MINOR get defined
that way).

Jan




 


Rackspace

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