All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH] build: adjust include/xen/compile.h generation
Date: Thu, 13 Jan 2022 11:22:45 +0000	[thread overview]
Message-ID: <YeALhTgXh7g2QdbB@perard> (raw)
In-Reply-To: <4f0766b2-cabd-cf5e-ed84-cc2b773bf5f8@suse.com>

On Tue, Jan 11, 2022 at 03:16:17PM +0100, Jan Beulich wrote:
> Prior to 19427e439e01 ("build: generate "include/xen/compile.h" with
> if_changed") running "make install-xen" as root would not have printed
> the banner under normal circumstances. Its printing would instead have
> indicated that something was wrong (or during a normal build the lack
> of printing would do so).

So, having several line of logs with one generating "compile.h", and
several object rebuild plus the re-linking of xen isn't enough has to
indicate that something is wrong?

Also, with this patch, the banner would no longer be printed on rebuild,
unless one doesn't try to prevent regeneration of "compile.h" by
exporting two variables.

I kind of like having the banner been nearly always printed, but I'm not
opposed to the change.

> Further aforementioned change had another undesirable effect, which I
> didn't notice during review: Originally compile.h would have been
> re-generated (and final binaries re-linked) when its dependencies were
> updated after an earlier build. This is no longer the case now, which
> means that if some other file also was updated, then the re-build done
> during "make install-xen" would happen with a stale compile.h (as its
> updating is suppressed in this case).

So, the comment:
    Don't refresh this files during e.g., 'sudo make install'
wasn't correct?

On the other hand, it's probably not good to not regen the file when the
prerequisite changes. It's kind of weird to "rm" the target, but I don't
have a better solution at the moment.

> Restore the earlier behavior for both aspects.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> An alternative to removing the target would be to replace "! -r $@" by
> "-n '$?'" in the shell "if", but that would cause unhelpful alteration
> of what gets recorded in include/xen/.compile.h.cmd. (The command
> normally changes every time anyway, due to the inclusion of
> $(XEN_BUILD_TIME), but I consider that different from varying the
> conditions of the "if".)
> 
> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -424,6 +424,7 @@ targets += .banner
>  quiet_cmd_compile.h = UPD     $@
>  define cmd_compile.h
>      if [ ! -r $@ -o -O $@ ]; then \
> +	cat .banner; \
>  	sed -e 's/@@date@@/$(XEN_BUILD_DATE)/g' \
>  	    -e 's/@@time@@/$(XEN_BUILD_TIME)/g' \
>  	    -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
> @@ -441,7 +442,7 @@ define cmd_compile.h
>  endef
>  
>  include/xen/compile.h: include/xen/compile.h.in .banner FORCE
> -	@cat .banner
> +	$(if $(filter-out FORCE,$?),rm -fv $@)

Is there a reason for -v? Do we care if the file existed?

Do we want to log "rm -f compile.h" ? Or could you just prefix the line
with $(Q)?

Thanks,

-- 
Anthony PERARD


  reply	other threads:[~2022-01-13 11:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 14:16 [PATCH] build: adjust include/xen/compile.h generation Jan Beulich
2022-01-13 11:22 ` Anthony PERARD [this message]
2022-01-13 12:11   ` Jan Beulich
2022-01-13 16:21     ` Anthony PERARD

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=YeALhTgXh7g2QdbB@perard \
    --to=anthony.perard@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.