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

Re: [PATCH] build: omit "source" symlink when building hypervisor in-tree


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 16 Mar 2023 14:30:03 +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=eUPrYMX1oj9WbH6Z8NhWbGl+MxeAQXSqdKsLLe3AQgM=; b=bf/0bEVJZ6AjG3uhPP8Wg/fCDghNOBeFcK0yodOcZ/atu1PZ7mZQTFMC+6AGKyLTvecwCHJoBV7VLrqofgK5F7DcfPdEoa19bHgsX/voOKHI1oo+Cm3KkXsIFkaG5Zfr7xhqWnWkGtGzyxmuSvdm0rtNPdvuRozQjKD2eu73cgn63PAZAuEC2e/oS5Rp6ERNjQDt24/iScpekqr7A9By66U7nq2/HlOjqmq7Xf+9sXkkVnPslIiDXbkiu3JbOucvHU/3cN7kF+H3wJ26pqBYrTuBwE1K1pofMn1eI3u7yTx7YnM9x+Ls0hLvmTa1B6POrkh95NfaIGEpRJfprj+8Fw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nEPxSbmLFcAFneXRXMuYT2VdUkkZvRhzG0Smrv9uTwVl7AwxrOJJoSiPvawC8Di7kIt1MJRcjKxk0sHB3JBJN31W6bzGO4bPS/XkO49lF6YuY+jKNWQ7ctp2RpSpFGNawx87Nekz8SF0OEdcjArGGKM2UTcxYwGnYMG0uFitQmuwGfFmBn1d/SPQNIeSglQCzA3amIfNFuPU+57OtGBaGbidjbwrIPtlcek8tJ6JvefZ4/0osL7PbC7JxABQEQJMZF5yDu+bxEjk3c1xc3EErqbVV9BjEU2hp2BgzgnA+KtY6sLYaTFFZ72BI+nXPNEQNw8jUM5xQ3qai9FDBl218A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 16 Mar 2023 13:30:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.03.2023 16:20, Anthony PERARD wrote:
> On Wed, Mar 15, 2023 at 03:56:21PM +0100, Jan Beulich wrote:
>> This symlink is getting in the way of using e.g. "find" on the xen/
>> subtree, and it isn't really needed when not building out-of-tree:
>> the one use that there was can easily be avoided.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>
>> --- a/xen/common/efi/efi-common.mk
>> +++ b/xen/common/efi/efi-common.mk
>> @@ -5,11 +5,16 @@ CFLAGS-y += -fshort-wchar
>>  CFLAGS-y += -iquote $(srctree)/common/efi
>>  CFLAGS-y += -iquote $(srcdir)
>>  
>> +source :=
>> +ifneq ($(abs_objtree),$(abs_srctree))
> 
> Could you use "ifdef building_out_of_srctree" instead, or at least use
> the variable $(building_out_of_srctree)? At least that mean there's a
> single way in the tree to differentiate between both kind of build.

I should have added a remark, I realize. I am actually aware of that
variable and also the fact that it is getting exported, but I was
seriously wondering why we do that: It's redundant information, and imo
a variable of this name shouldn't really be exported.

Furthermore I consider the conditional I'm presently using (matching
the one controlling the definition of building_out_of_srctree) more
descriptive: I had to go and convince myself that the variable really
is set based on comparing the paths; I had suspected it might be some
other conditional, not the least because of me not expecting that we'd
carry (and even export) redundant information.

So yes, if you insist I will switch. My preferred route would be to
ditch building_out_of_srctree, though.

>> +source := source/
>> +endif
>> +
>>  # Part of the command line transforms $(obj)
>>  # e.g.: It transforms "dir/foo/bar" into successively
>>  #       "dir foo bar", ".. .. ..", "../../.."
>>  $(obj)/%.c: $(srctree)/common/efi/%.c FORCE
>> -    $(Q)ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, 
>> ,$(obj))))/source/common/efi/$(<F) $@
>> +    $(Q)ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, 
>> ,$(obj))))/$(source)common/efi/$(<F) $@
> 
> Instead of $(source), I did proposed initially
> "$(if $(building_out_of_srctree),source/)" for here, or it that making
> the command line too long?
> https://lore.kernel.org/xen-devel/YebpHJk1JIArcdvW@perard/t/#u

Oh, I'm sorry for driving you into adding that symlink, which is now
getting in the way. But yes, putting it inline would imo make an already
too long line yet worse. Otoh I could of course wrap the line, albeit
some care may then be needed to not introduce whitespace in the wrong
place.

> Having "source := $(if $(building_out_of_srctree),source/)" might be an
> ok alternative in place of the use if "ifneq/endif" which take 4 lines?

As per above, if you're determined that building_out_of_srctree should
stay around, then I could do so. Alternatively how about

source := $(if $(patsubst $(abs_objtree),,$(abs_srctree)),,source/)

or the same with $(subst ...) or yet shorter

source := $(if $(abs_srctree:$(abs_objtree)=),,source/)

if you're after cutting the number of lines?

Jan



 


Rackspace

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