unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: Corwin Brust <corwin@bru.st>,  emacs-devel <emacs-devel@gnu.org>
Subject: Re: A note about clang-format
Date: Wed, 23 Aug 2023 07:58:06 +0200	[thread overview]
Message-ID: <m2h6oqz4ep.fsf@Mini.fritz.box> (raw)
In-Reply-To: <CALDnm516ziLG+WuD4un9vOUra0YA7+Oi7Kk=asE6zDzEGHRQnQ@mail.gmail.com> ("João Távora"'s message of "Tue, 22 Aug 2023 21:13:58 +0100")

João Távora <joaotavora@gmail.com> writes:

> On Tue, Aug 22, 2023, 20:45 Gerd Möllmann <gerd.moellmann@gmail.com> wrote:
>
>  > I think we (meaning you) should lobby Eli for compile_commands.json
>  > generation first :)
>
>  I think that might not even be necessary because users can do that
>  easily, if they know how.  See https://github.com/rizsotto/Bear, for
>  example, which is GPLv3.  With it, do an initial full build with "bear
>  -- gmake" instead of just "gmake".
>
> Yes, I've used 'bear' before (in fact I asked you, remember?).

Sorry, I didn't remember that that was you :-).

>
> But -- great as it is -- it's still basically a hack which requires
> actually compiling the code to learn _how_ it would be
> compiled. That's not always practical, perhaps not even always
> possible depending on the toolchain to use.

Some alternatives to Bear use a --dry-run.  I haven't tried them though:
https://github.com/nickdiego/compiledb for example.  Would that be
sufficient for the cases you think of?

> So it's a needless hindrance and, afair, not perfectly accurate (you
> had some non-trivial ad-hoc tweak script as I recall).

Yes, the script adds an "-include config.h" for the files in src/.  That
makes things a little bit smoother with clangd.  One can do without,
though.

> I don't see a fundamental technical reason not to generate this simple
> file from our own configuration script, which is the source of truth
> for this information after all.  In all Cmake projects I work with,
> it's a matter of setting a simple variable. I wonder if the automake
> world doesn't have something similar. If it doesn't, how hard can it
> be to add one?

AFAIK, there is nothing like that in autoconf/automake.  At least last
time I checked about a year ago there wasn't.  I also have a vague
memory that someone on their mailing list said it it would be
impoossible to produce a correct compilation database without running
make, because one could alwasys do something like "CFLAGS=... make".
Can't find that article ATM, maybe I'm confusing that with something
else.



  reply	other threads:[~2023-08-23  5:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 14:55 A note about clang-format Gerd Möllmann
2023-08-22 18:29 ` Corwin Brust
2023-08-22 18:34   ` João Távora
2023-08-22 18:59     ` Gerd Möllmann
2023-08-22 19:07       ` João Távora
2023-08-22 19:44         ` Gerd Möllmann
2023-08-22 20:13           ` João Távora
2023-08-23  5:58             ` Gerd Möllmann [this message]
2023-08-23  2:27         ` Eli Zaretskii
2023-08-22 19:02   ` Gerd Möllmann

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m2h6oqz4ep.fsf@Mini.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=corwin@bru.st \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).