All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>,
	Michal Marek <mmarek@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [RFC PATCH] Don't reset timestamps in include/generated if not needed
Date: Sun, 8 Mar 2015 16:08:06 -0700	[thread overview]
Message-ID: <CA+55aFx368q6kAuNV_7zskFdyh2yxYfpm77Yak5WQiexin_d9A@mail.gmail.com> (raw)
In-Reply-To: <15447.1425431256@turing-police.cc.vt.edu>

On Tue, Mar 3, 2015 at 5:07 PM, Valdis Kletnieks
<Valdis.Kletnieks@vt.edu> wrote:
>
> Kbuild regenerates bounds.h and asm-offsets.h, resetting the timestamps
> and forcing rebuilds even if the contents haven't changed.  Add a bit of
> shell magic to only replace the file if the contents have in fact changed,
> which should speed up git bisects and similar.
> ...
> RFC because I can't wrap my head around why this wasn't done ages ago.
> If I'm missing something something obvious, please apply a cluestick. :)
>
> Lightly tested - if I rm one of those two files, it gets rebuilt. If I
> insert some whitespace, it gets replaced. If I don't touch it, the datestamp
> doesn't change.

I don't think this is wrong, but I'd really prefer to do the whole
move-if-changed thing as a separate rule, and a separate command.

IOW, could we please have something that generates the "build.h" file
by separately creating a new temporary file, and then having the
traditional kind of move-if-changed definition

   define move-if-changed
        if ! cmp -s $(1) $(2); then mv -f $(1) $(2); else rm -f $(1); fi
   endef

kind of thing that just does

   $(call move-if-changed,build.h.tmp,build.h)

Hmm? That move-if-changed can be useful for other cases too, I've seen
something like it in a lot of makefiles. I'm surprised we don't have
one already.

That said, we already have that "filechk" define that does pretty much
all of this.

So I don't like the exact patch, but I do like the effect it gives. Michal?

                    Linus

  reply	other threads:[~2015-03-08 23:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04  1:07 [RFC PATCH] Don't reset timestamps in include/generated if not needed Valdis Kletnieks
2015-03-08 23:08 ` Linus Torvalds [this message]
2015-03-11 10:01   ` Michal Marek
2015-03-13  4:59     ` Masahiro Yamada
2015-03-13 10:00       ` Michal Marek
2015-03-24 15:36         ` [PATCH] kbuild: " Michal Marek
2015-03-24 16:08           ` Valdis.Kletnieks

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=CA+55aFx368q6kAuNV_7zskFdyh2yxYfpm77Yak5WQiexin_d9A@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /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.