From: Jeff King <peff@peff.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ramsay Jones <ramsay@ramsayjones.plus.com>,
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/1] Makefile: use `git ls-files` to list header files, if possible
Date: Mon, 4 Mar 2019 16:37:33 -0500 [thread overview]
Message-ID: <20190304213733.GA3347@sigill.intra.peff.net> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1903041210410.45@tvgsbejvaqbjf.bet>
On Mon, Mar 04, 2019 at 01:38:13PM +0100, Johannes Schindelin wrote:
> > So, tl;dr: soon, I will be submitting a patch to remove the
> > 'hdr-check' target completely, for now anyway.
>
> You mentioned later that you might be the only person using that target,
> and if that were so, I would agree.
>
> However, I started looking into adding `hdr-check` to the Azure Pipeline
> we have (which would make a *ton* of sense, if you ask me), along with the
> `sparse` thing we talked about.
>
> So I am a bit opposed to removing that target.
Yeah, I agree. If it's a linting check we expect developers to follow,
then we need to make it easy for developers to run it.
> > Yep, for me too. There is a similar problem if you build with
> > NO_CURL and don't have the 'curl/curl.h' header file, etc ...
>
> I think all it needs to do is to pass `$(ALL_CFLAGS)` to gcc (although we
> might need to add something like `#if defined(SHA256_GCRYPT) ... #endif`
> guards to `sha256/gcrypt.h` to make it work in Peff's case).
>
> But given that this target really is meant to catch all kinds of errors,
> I'd be in favor of declaring that target requiring things like libgcrypt's
> header files to be installed. We can easily make that happen in our CI
> builds.
I don't think that really scales, though. For CI, perhaps it's not too
bad, but IMHO there's real value making it possible for everyday
developers to run linting and tests locally, because it keeps the
feedback cycle tight. In other words, imagine my changes go through a
sequence like this:
1. I run "make" locally
2. I run "make test" locally
3. I push, and CI runs "make && make test" on more platforms, or with
more knobs tweaked.
it's preferable to find out about problems in the early steps, because
the cost to run each of the subsequent steps is much higher.
So if we're adding more linting, it would ideally be part of the build.
The obvious reasons not to are that it's expensive, or that it's hard
for the local user to set up. But I think at least a hdr-check that
checks _your_ platform would be valuable to run as part of step 1 or 2.
I also think it points to a weakness in the current hdr-check scheme. It
omits compat/* entirely, so we can't detect any problems there. But if
we are going to add those back in, then making it run in CI is not as
simple as "just make sure we have all libraries installed". It's
inherently going to be a different set per platform (and we'd want to
run "make hdr-check" on each of the platforms where we already run "make
test").
> > Anyway, for now, since I seem to be the only person using this
> > target, I think we should just remove it while I think again.
> > (I can put it in my config.mak, so there will be no loss for me).
>
> As I said above, I would rather keep it, with the `ls-files` and `:=`
> fixup.
>
> If others *really* feel strongly about lazy-evaluating `LIB_H`, then I
> would *additionally* use Peff's sub-make hack. But only if others feel
> strongly about it, because I, for one, certainly don't.
My measurements show it's not a big expense at least on my system (even
with the 3x runs). So I can live with just moving it to ls-files to
bound the filesystem access, and calling that good enough.
-Peff
next prev parent reply other threads:[~2019-03-04 21:37 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-01 19:57 [PATCH 0/1] Avoid calling find in the Makefile, if possible Johannes Schindelin via GitGitGadget
2019-03-01 19:57 ` [PATCH 1/1] Makefile: use `git ls-files` to list header files, " Johannes Schindelin via GitGitGadget
2019-03-01 21:36 ` Jeff King
2019-03-01 21:54 ` Jeff King
2019-03-01 22:01 ` Jeff King
2019-03-02 19:54 ` Johannes Schindelin
2019-03-03 17:08 ` Jeff King
2019-03-02 19:57 ` Johannes Schindelin
2019-03-03 17:11 ` Jeff King
2019-03-02 20:05 ` Johannes Schindelin
2019-03-03 17:19 ` Jeff King
2019-03-03 21:30 ` Ramsay Jones
2019-03-04 12:38 ` Johannes Schindelin
2019-03-04 20:31 ` Ramsay Jones
2019-03-04 21:37 ` Jeff King [this message]
2019-03-04 11:08 ` Johannes Schindelin
2019-03-04 21:41 ` Jeff King
2019-03-05 5:50 ` Junio C Hamano
2019-03-05 15:28 ` Johannes Schindelin
2019-03-05 22:26 ` Junio C Hamano
2019-03-05 23:07 ` Jeff King
2019-03-06 0:23 ` Ramsay Jones
2019-03-06 4:40 ` Jeff King
2019-03-06 5:28 ` Junio C Hamano
2019-03-06 19:05 ` [PATCH] compat/bswap: add include header guards Jeff King
2019-03-06 22:42 ` Junio C Hamano
2019-03-04 13:47 ` [PATCH v2 0/1] Avoid calling find in the Makefile, if possible Johannes Schindelin via GitGitGadget
2019-03-04 13:47 ` [PATCH v2 1/1] Makefile: use `git ls-files` to list header files, " Johannes Schindelin via GitGitGadget
2019-03-04 20:38 ` Ramsay Jones
2019-03-04 21:01 ` Ramsay Jones
2019-03-04 21:43 ` Jeff King
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=20190304213733.GA3347@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=ramsay@ramsayjones.plus.com \
/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).