From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: A note about clang-format Date: Wed, 23 Aug 2023 07:58:06 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24633"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Corwin Brust , emacs-devel To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 23 07:59:03 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qYgtT-0006GG-Ik for ged-emacs-devel@m.gmane-mx.org; Wed, 23 Aug 2023 07:59:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYgsi-0001z9-1Z; Wed, 23 Aug 2023 01:58:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYgsg-0001z1-EQ for emacs-devel@gnu.org; Wed, 23 Aug 2023 01:58:14 -0400 Original-Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYgsc-0000IJ-VM for emacs-devel@gnu.org; Wed, 23 Aug 2023 01:58:14 -0400 Original-Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-52a0856b4fdso3839643a12.1 for ; Tue, 22 Aug 2023 22:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692770288; x=1693375088; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X4iQPkEKLwvHwEBAAPGw/Sdrp+yw8wp65UiRMo1jPwc=; b=SvbhdBKkL7xliQIKDnYEMt3WT+0htrQb9rZjF2mYP7v0A1T8R3ocY1eisKzmMLAOBw 7oGOleOA2mBBvRbPX6L1VZGbttgWRro3Sq6YDRbYk48L5zb93xVQoQkmIEjcQ2hqOn51 dD/25MXHbq2rsZ3XFoI1qHR8KkKu3UtJZe5gKMrUo6V1daneFSde9yHb/P2nycm2XTDJ WCMrFoh746/biL/LUPjjcrgrb7zEEkiIke6UF9DIPR4PCa3dIgP3LMb4In3hCzmTV5L7 ry7nYBWl9sR2nXfUD2ZYa2GLeir+/GfCUf/GYG5JIgZ11LD/SaiH6iyj4G8xjMSujDeY WBpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692770288; x=1693375088; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=X4iQPkEKLwvHwEBAAPGw/Sdrp+yw8wp65UiRMo1jPwc=; b=X1/U/DcWuz2BGX/dRzzV5Sle1ybQtepxTtj5IS9smeD3PQx9GGhbzJSCNaT85L9m7/ JG5t1tFfAg47qICdtsj9Rc3gTie9sOxLyqpr/OSu+MFKq5uNP5bvfsZDBLX2Kj11po6f kaC5XrC8/tMd65MDw5ef7da4//OdBjGiaNVVk0qvaEskx92v18h9yx0B2F4u+B+gbaPM 4IJXOLsYasH1O1BR6/yhalKd1hdyR7TQeJujbOgnWzH4f1i6dABa5ynN+rRVILoG13r3 sixApw5bkhFqPlJvHv3eZ7HR3NMyoX/R6/sFzR8tCdkt66GvU8jNH4WzWo0rwgOTGsdH Ve7g== X-Gm-Message-State: AOJu0YzsuccUnXtqKyF5LtK78Wlj7re5RupgRpFRyLbZ/gAXGZaqI7CK 2HevNPGv9wawLyVDcAn43CbTKn47sn47JA4U X-Google-Smtp-Source: AGHT+IERGr2DNuitpmxTB+Bd208Bfh1vSIq80LiCg1uigZ6Mmw1X2uxGxJBwxiYqiCMlWzisaWVWPw== X-Received: by 2002:a17:907:7639:b0:99e:f3b:2f89 with SMTP id jy25-20020a170907763900b0099e0f3b2f89mr9379509ejc.41.1692770288267; Tue, 22 Aug 2023 22:58:08 -0700 (PDT) Original-Received: from Mini.fritz.box (p54b0c765.dip0.t-ipconnect.de. [84.176.199.101]) by smtp.gmail.com with ESMTPSA id k17-20020a1709062a5100b0099bc2d1429csm9413327eje.72.2023.08.22.22.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 22:58:07 -0700 (PDT) In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Tue, 22 Aug 2023 21:13:58 +0100") Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:309123 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > On Tue, Aug 22, 2023, 20:45 Gerd M=C3=B6llmann = 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=3D... make". Can't find that article ATM, maybe I'm confusing that with something else.