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

Re: [PATCH 1/2][4.15?] tools/x86: don't rebuild cpuid-autogen.h every time



On 08.03.2021 10:59, Ian Jackson wrote:
> Jan Beulich writes ("[PATCH 1/2][4.15?] tools/x86: don't rebuild 
> cpuid-autogen.h every time"):
>> The first thing the "xen-dir" rule does is delete the entire xen/
>> subtree. Obviously this includes deleting xen/lib/x86/*autogen.h. As a
>> result there's no original version for $(move-if-changed ...) to compare
>> against, and hence the file and all its consumers would get rebuilt
>> every time. Introduce a "prep-y" rule to move xen/lib/x86/ on the side,
>> to then recover any *autogen.h from there prior to invoking the
>> respective recursive $(MAKE) invocation.
> 
> Urgh.  Thanks for working on this swamp.
> 
> However,
> 
>> +# Arrange for preserving of auto-generated headers (to avoid them getting
>> +# rebuilt every time): Move the entire xen/lib/x86/ to a temporary place.
>> +prep-$(CONFIG_X86):
>> +    rm -rf .xen-lib-x86
>> +    test ! -d xen/lib/x86 || mv xen/lib/x86 .xen-lib-x86
>> +
>>  all-$(CONFIG_X86): xen-dir
>> +    $(if $(wildcard .xen-lib-x86/*autogen.h),mv .xen-lib-x86/*autogen.h 
>> xen/lib/x86/)
>> +    rm -rf .xen-lib-x86
>>      $(MAKE) -C xen/lib/x86 all XEN_ROOT=$(XEN_ROOT) PYTHON=$(PYTHON)
> 
> Isn't there some better way of doing this ?  I am very wary of adding
> additional on-disk Makefile-managed state to a Makefile which is
> already going wrong.  I haven't thought about this in enough detail to
> identify a specific bug but I think convincing myself that it is
> definitely correct is nontrivial.
> 
> Perhaps we could do the removal with a find rune instead, so we can
> just skip the files we wanted to keep ?

Maybe, and I did consider the option, but it would have felt more
fragile to me than this dedicated keep-just-the-few-files approach.
The problems we've had with this symlinking don't make me confident
in leaving around parts of this subtree; populating from scratch
seems like the most robust model (short of the suggested but never
carried out removal of the symlinking) to me.

Jan



 


Rackspace

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