[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC] build: detect outdated configure outputs
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 11 Mar 2021 17:12:22 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=l1h4eBNBRVg/D53iyzM+NT306xc9zw0gYmxHjMYp8rA=; b=kTtvyj+QZAz7z4RSe6kKTVztXwmVsDq+9zsig/NLAW5GubEZtp0YaXMSiODdfrYC4yv/TM+kDiWS2Y7g57CwGuua6PMkS3cKaMz1hHNakZWqpBBA5SLRESBwIQmRsV2T6BNXz0YTLWg4P4yi1WDv8VHIMSe40uxMlCPWDpoR66N/oYYwAKifT6Iqh4gOQ5//hKr6ahKZAvFFPRy1vDQDVOF+ZJc1a8NfzMK8hvFtaMhj7zAOa8t79sltU7DKe64jBy3pOCpVLqjhtQt8yt3qcpfeO/4CNkkq8HOJSb0C91QtK1KiDOGi0f03UoLOLgSb/q+vqzoPMo2L8OjTA9ZHmw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n6iZNkkdAPkwZx+EAr22d1YwCSwf3GLhpVBg57rsvJfRzKd3qbT2Vrbv5jT4tkFwti9bGfbogmjp3g/RO+sPScYdKkiBwk5Ov1QjIsF1/5PZsu1qk1s0CIDfMSeJIZ66g2ITww4JWDrSGEsbvYx8cv1OJEq4cVgQxVF99JHFUzqLFCgsnMexHuJzBGomX8wRx5SGJ1nwA6vl7WNAbZ0kBTgS0nZQee5eiBWe02GuCk7NlX9ItQov8adbygjqEw4VcmWTP7Dw6C7ApKINo8QsTZ/R2ezGQTZItETPvFc4oYN74G4tsgZ+BHlO34D5pOfvzrG5scoZeANG8G0o4hydxQ==
- Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 11 Mar 2021 16:12:55 +0000
- Ironport-hdrordr: A9a23:0DGx365/v9XvrgrPAAPXwXqEI+orLtY04lQ7vn1ZYSd+NuSFis Gjm+ka3xfoiDAXHEotg8yEJbPoex3h3LZPy800Ma25VAfr/FGpIoZr8Jf4z1TbdBHW3tV2kZ 1te60WMrHNJHBnkMf35xS5Gd48wN+BtJuln/va0m0Fd2FXQotLhj0JbDqzOEtwWQVAGN4VFI CE4NBGujqnfh0sH7mGL1MCWPXOoMCOqYnvZgQICwVixA6Fiz6p77CSKWnl4j41VTRTzbA+tV XUigCR3NTYj9iX6D/5k1XS4ZNfhcf7xrJ4ZfCkp8AJJlzX+2OVTat7XbnqhkFQnMiO7xIQnM DIs1McOa1ImgzsV0WUhTeo5AX6yjYp7BbZuCylqF/uu9bwSj5/K+cpv/MgTjLj50AtvM5x3c twtgrz3fcnbmKj7VHAzuPFWB1wmk2/rWBKq59ps1VlXZYDc7gUlIQD/SpuYec9NRjn44MqGv QGNrCk2N9qdzqhHhfkl1gq6tmtUnMvJwyBU0gPt+eEugIm7UxR/g82wtcSkWwH8494Y55Y5/ 7cOqAtr71WSNQKBJgNS9spcI+SMCjgUBjMOGWdLRDOE7wGAWvEr9rS7K8u7O+nVZQUxPIJ6d r8eWIdkVR3V1PlCMWI0pEO2AvKWn+BUTPkzdwbz4Rlu5XnLYCbchGreRQL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3PzjqH59UpR3uDLcUxSxtbAr24HvXXSMJD3r rZ+hxnPe/8Bx3Z7n7kvu6Ho15ZlYunnZSjmobld2YpbREIpPSr99GFoD3qzMmK5pQvJWasksq0 PhOu7uoqa8JMH3F948JXiZCDcN6TZQSq/lW7rq+BzN/iXJ/nT2ZJRLY0ay/ZRV3QrLkCTY+Asa hrM5ug1mfGH8O+M0ic9vmxCACXRoIveRQIdbMNqSs6UTAqGXxqF0B9ujOve0IN9Mch0yLEfsse xvM=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Mar 11, 2021 at 02:01:53PM +0100, Jan Beulich wrote:
> On 11.03.2021 12:46, Roger Pau Monne wrote:
> > The Xen build system relies on configure to parse some .in files in
> > order to do substitutions based on the data gathered from configure.
> >
> > The main issue with those substitutions done at the configure level is
> > that make is not able to detect when they go out of date because the
> > .in file has been modified, and hence it's possible to end up in a
> > situation where .in files have been modified but the build is using
> > outdated ones. This is made even worse because the 'clean' targets
> > don't remove the output of the .in parsing, so doing a typical `make
> > clean && make` will still use the old files without complaining.
> > Note that 'clean' not removing the output of the .in transformations
> > is the right behavior, otherwise Xen would require re-executing the
> > configure script after each clean.
> >
> > Attempt to improve the situation by adding a global rule that spot the
> > outdated files as long as they are properly listed as makefile target
> > prerequisites.
> >
> > Ultimately those substitutions should be part of the build phase, not
> > the configure one.
> >
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> > ---
> > RFC because I'm not sure if there's some better way to handle this.
> > Also I think we would want to make sure all the .in outputs are
> > properly listed as target prerequisites, or else this won't work.
> >
> > Also not sure whether this will break some other usage of .in files
> > I'm not aware.
>
> There are a number of such files in the tree which aren't used to
> record configure results. Whether their existence could actually
> case a problem with this approach I can't tell. Would it be
> possible to ...
I think having other .in files in the tree is not a problem with the
target I've added, as it would only apply to files that have an .in
pair and are used as prerequisites.
> > --- a/Config.mk
> > +++ b/Config.mk
> > @@ -65,6 +65,10 @@ DEPS_RM = $(DEPS) $(DEPS_INCLUDE)
> > %.d2: %.d
> > sed "s!\(^\| \)$$PWD/! !" $^ >$@.tmp && mv -f $@.tmp $@
> >
> > +# Make sure the configure generated files are up to date
> > +%: %.in
> > + $(error $@ is outdated, please re-run configure)
>
> ... make this a static pattern rule for just the file names that
> are actually processed / produced by configure? Of course it
> wouldn't be very nice to have to keep in sync that list and what
> the various configure.ac scripts list in AC_CONFIG_FILES() et al.
> But not listing the targets explicitly would always risk the rule
> to kick in for a file where it's not supposed to apply.
Yes, I think it's going to be a pain to keep the list updated, as it's
part of two different configure.ac files.
>From a quick look there are other .in files used in a similar way by
ocaml, so those targets will override the pattern rule (%: %.in) in
some places, for example in tools/ocaml/libs/xl/Makefile. I think this
should be fine.
Thanks, Roger.
|