xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <iwj@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 1/2][4.15?] tools/x86: don't rebuild cpuid-autogen.h every time
Date: Mon, 8 Mar 2021 09:59:12 +0000	[thread overview]
Message-ID: <24645.62832.737310.550811@mariner.uk.xensource.com> (raw)
In-Reply-To: <336aaf51-f163-8ee7-d8ee-297f6f3052fd@suse.com>

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 ?

Ian.


  reply	other threads:[~2021-03-08  9:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08  9:20 [PATCH 0/2] tools/x86: adjust populating of tools/include/xen/ Jan Beulich
2021-03-08  9:22 ` [PATCH 1/2][4.15?] tools/x86: don't rebuild cpuid-autogen.h every time Jan Beulich
2021-03-08  9:59   ` Ian Jackson [this message]
2021-03-08 10:11     ` Jan Beulich
2021-03-08 11:08       ` Ian Jackson
2021-03-08 11:36         ` Jan Beulich
2021-03-08 12:12           ` Ian Jackson
2021-03-08 13:10             ` Jan Beulich
2021-03-08 14:40               ` Ian Jackson
2021-03-08  9:22 ` [PATCH 2/2] tools/x86: move arch-specific include/xen/ population into arch-specific rule Jan Beulich
2021-03-08 10:00   ` Ian Jackson
2021-03-08 10:08     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24645.62832.737310.550811@mariner.uk.xensource.com \
    --to=iwj@xenproject.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).