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: Emacs + bear + compile_commands.json + clangd Date: Tue, 11 Oct 2022 07:39:47 +0200 Message-ID: References: <87pmezvw4p.fsf@rfc20.org> 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="31533"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , emacs-devel To: Matt Armstrong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 11 07:51:42 2022 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 1oi8B3-00081C-Nl for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 07:51:41 +0200 Original-Received: from localhost ([::1]:53868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oi8B0-0002lq-2f for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 01:51:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oi7zh-00086N-O8 for emacs-devel@gnu.org; Tue, 11 Oct 2022 01:40:09 -0400 Original-Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:38860) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oi7zc-0000kx-Sz for emacs-devel@gnu.org; Tue, 11 Oct 2022 01:39:54 -0400 Original-Received: by mail-ej1-x633.google.com with SMTP id nb11so29049768ejc.5 for ; Mon, 10 Oct 2022 22:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=SJVF49ERcTVX2wAvF0M2zWt8LE2ijbDK10InZOZa/mA=; b=lNSnLLZhZJnOsMILSMF1RIzTUS14nopJVgLB4JQuc6Gym+aViwmTxtB5NPx/F0NGH+ rpFcdsJ84jXeg1KZAPAlYM8t5BuzequhFeMRv2taUHyu1AZgyVyFaP6rNJus6V586nux MOdpNP0SaqVtVC+3y9XCG2XvAhcrQlu/ollS+92YM5dRTioznL6qy36XkH+dYFFA2rIH ujiEp4B3gj/7hGL1zs5V5AjhL5y1fyFuMqx9g0zhxytDS4XDqF2RZzpG0sVm72vf+OQH iaOgbaFGQPfVD9mg51thp33PlirLGAWRfiuuzEHj1Cy5WbIRPGRPrma0sgLRroEQoAAj NGMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=SJVF49ERcTVX2wAvF0M2zWt8LE2ijbDK10InZOZa/mA=; b=K2DoIgII2jwUcnu8Ti/4L5EkLGXRNYatM7xVdFgEQW+vvzSU0VHvhQZ7K8I47RRJPs sQ8Hk1mMO1LQ2IQDqMtqBUgXtD6bAabRnba7hL5gDkZ1kAJYNnVlHyDGs516GPPoC+8b cLiH8Q9ZN758KjDsP9ldjBr0EtUVHM9Q7rgpR2e+zBcrWKjS/keBXNkdESS/Qyz2aqpp cMu0CAXAcTc2Uh5s82zEfQSZLyOVnHHQ6Wuuki9ACod/qTd8rfwTJ1Y4f3Cbs7qtlElQ 0H0Hi1EFSOJgPMmlTS/XoFcYtOM4kQ5D/4pc1Y/2+xJkGw7UkX1YxaHyzKbtN9hI1Yzk LeBg== X-Gm-Message-State: ACrzQf0Y+j7eg23O5BzWN8/t9v8pU8IREnmeeJ13y0ss21P2M1vft83C oEPDx+K2HIa9VhoKNKf1G2jeXZa/GNs= X-Google-Smtp-Source: AMsMyM427GrjX1BJUhv72/Mq55T+dIFppKV5AZK6E1I8HxoMWmDmqjgkvZH8FpD1AR9l+mwhJF1+jQ== X-Received: by 2002:a17:907:6d98:b0:78d:db32:6c8f with SMTP id sb24-20020a1709076d9800b0078ddb326c8fmr1188948ejc.221.1665466790178; Mon, 10 Oct 2022 22:39:50 -0700 (PDT) Original-Received: from Mini.fritz.box (pd9e36b2d.dip0.t-ipconnect.de. [217.227.107.45]) by smtp.gmail.com with ESMTPSA id s22-20020a05640217d600b0045af1e70137sm6547308edy.14.2022.10.10.22.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 22:39:49 -0700 (PDT) In-Reply-To: <87pmezvw4p.fsf@rfc20.org> (Matt Armstrong's message of "Mon, 10 Oct 2022 21:09:58 -0700") Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x633.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" Xref: news.gmane.io gmane.emacs.devel:297420 Archived-At: Matt Armstrong writes: > Hey Jo=C3=A3o, I had issues with Emacs source and clangd, especially with > header files. The issue is that many of Emacs' C header files are not > "self contained" so they can't be compiled alone. Also, `bear` will > only generate compile commands for .c files, and clangd uses > heuristics to guess a compile command for nearby .h files. It does a > reasonable job in some projects, but not Emacs due to the "self > contained" issue. Biggest issue: when editing an .h file clangd won't > include for you. I'm wondering how you use clangd. Is this lsp-mode or eglot? I'm using lsp-mode ATM, just because I tried it first, and it worked for me. > I now do this: > > ./configure > bear --force-wrapper -- make -j$CPUS > emacs-fixup-compile-commands.py > > where emacs-fixup-compile-commands.py is attached. Bonus to anyone > rewrites it in elisp. ;-) I've never had to use --force-wrapper or alter compile_commands.json. My current version is bear 3.0.20, on macOS 12.6. What's your system? P.S. WRT to seamless, I have to add, for macOS: This was true for me with Xcode 13, and is no longer with Xcode 14. Both clangd and lldb crash pretty frequently :-(.