From unknown Fri Aug 08 22:53:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52054: clangd cannot find Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: emmanuel.agullo@inria.fr, bug-guix@gnu.org Resent-Date: Tue, 23 Nov 2021 10:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52054 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 52054@debbugs.gnu.org Cc: emmanuel.agullo@inria.fr X-Debbugs-Original-To: bug-guix@gnu.org X-Debbugs-Original-Xcc: emmanuel.agullo@inria.fr Received: via spool by submit@debbugs.gnu.org id=B.16376621216859 (code B ref -1); Tue, 23 Nov 2021 10:09:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Nov 2021 10:08:41 +0000 Received: from localhost ([127.0.0.1]:50075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpSjA-0001mY-Lx for submit@debbugs.gnu.org; Tue, 23 Nov 2021 05:08:41 -0500 Received: from lists.gnu.org ([209.51.188.17]:44460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpSj8-0001mQ-6K for submit@debbugs.gnu.org; Tue, 23 Nov 2021 05:08:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpSj8-0001QI-2E for bug-guix@gnu.org; Tue, 23 Nov 2021 05:08:38 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:58414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpSj3-0005dv-QR for bug-guix@gnu.org; Tue, 23 Nov 2021 05:08:37 -0500 IronPort-Data: A9a23:6tguRKr5h2n6qz18PvNz939ixvFeBmI8ZxIvgKrLsJaIsI5as4F+vmVJXDiDbv+JZDfyett+a4u2oxwEuJ7Uzd5gSAY//C80QiMRo6IpJ/zJdxaqZ3v6wu7rFR88sZ1GMrEsFC2FJ5Pljk/F3oPJ8D8sislkepKmULSdY3krHlc+IMscoUkLd9AR09cAbeeRU1vlVePa+6UzCXf9s9JGGjp8B5Gr9HuDiM/PVAYw5TTSUxzkUGj2zBH5BLpHTU24wuCRroN8RoZWTM6bpF21E/+wwvsjNj+luu6TnkwiWL/YNw+I4pZUc/n7xEEc/mpri/l9bqJFAatUo2zhc9RZzMhBsoKxQkEiObDWhOkGexheCSB3e6NckFPCCSXk6ZDKlhWun3zEhq8G4FsNFYcF9aN4HGBe3fMeNXYKdB/rug4c6NpXUcE934F6cpGuZdpA/ys4lHfCEPw9B4jZRLXD6Zle0StYuyyHJt6GD+JxVNalRE6oj8VzB2oq IronPort-HdrOrdr: A9a23:QURqrK80BKO5AaAIeKluk+DdI+orL9Y04lQ7vn2ZhyYlEfBw8Pre/sjztCWYtN9/YhEdcLy7VpVoBEm8yXcK2/h1AV7SZmXbUQKTRekIh7cKgQeQfxEWndQz6U4PSdkYNDSJNykdsS8k2njAL+od X-IronPort-AV: E=Sophos;i="5.87,257,1631570400"; d="scan'208";a="5304110" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 11:08:25 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 3 Frimaire an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 23 Nov 2021 11:08:24 +0100 Message-ID: <87ilwjjiav.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=192.134.164.83; envelope-from=ludovic.courtes@inria.fr; helo=mail2-relais-roc.national.inria.fr X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hello, =E2=80=98clangd=E2=80=99 fails to find , as shown here: --8<---------------cut here---------------start------------->8--- $ printf '#include \nint foo (int x) {return x+2; }' > t.c $ guix shell -C -D hello --with-c-toolchain=3Dhello=3Dclang-toolchain clang= :extra strace guix shell: warning: transformation 'with-c-toolchain' had no effect on str= ace@5.8 guix shell: warning: transformation 'with-c-toolchain' had no effect on cla= ng@12.0.1 [env]$ clang -c t.c [env]$ clangd --check=3Dt.c I[10:02:40.349] clangd version 12.0.1 I[10:02:40.349] PID: 3 I[10:02:40.349] Working directory: /home/ludo/tmp/clangd-bug I[10:02:40.349] argv[0]: clangd I[10:02:40.349] argv[1]: --check=3Dt.c I[10:02:40.349] Entering check mode (no LSP server) I[10:02:40.349] Testing on source file /home/ludo/tmp/clangd-bug/t.c I[10:02:40.349] Loading compilation database... I[10:02:40.349] Failed to find compilation database for /home/ludo/tmp/clan= gd-bug/t.c I[10:02:40.349] Generic fallback command is: /gnu/store/nk5lp7wisgdlvds5cam= vcchgh19hnn23-clang-12.0.1/bin/clang /home/ludo/tmp/clangd-bug/t.c -fsyntax= -only -resource-dir=3D/gnu/store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.= 0.1-extra/lib/clang/12.0.1 I[10:02:40.350] Parsing command... I[10:02:40.352] internal (cc1) args are: -cc1 -triple x86_64-unknown-linux-= gnu -fsyntax-only -disable-free -disable-llvm-verifier -discard-value-names= -main-file-name t.c -mrelocation-model static -mframe-pointer=3Dall -fmath= -errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu= x86-64 -tune-cpu generic -fno-split-dwarf-inlining -debugger-tuning=3Dgdb = -resource-dir /gnu/store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.0.1-extr= a/lib/clang/12.0.1 -c-isystem /gnu/store/xl7wammzljnp0rg496n96h5m69y25isg-p= rofile/include -cxx-isystem /gnu/store/xl7wammzljnp0rg496n96h5m69y25isg-pro= file/include -internal-isystem /usr/local/include -internal-isystem /gnu/st= ore/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.0.1-extra/lib/clang/12.0.1/in= clude -internal-externc-isystem /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr= -glibc-2.31/include -fdebug-compilation-dir /home/ludo/tmp/clangd-bug -ferr= or-limit 19 -fgnuc-version=3D4.2.1 -faddrsig -x c /home/ludo/tmp/clangd-bug= /t.c I[10:02:40.352] Building preamble... I[10:02:40.368] Indexing headers... E[10:02:40.382] [pp_file_not_found] Line 1: in included file: 'stddef.h' fi= le not found I[10:02:40.382] Building AST... I[10:02:40.386] Indexing AST... I[10:02:40.386] Testing features at each token (may be slow in large files) I[10:02:40.387] All checks completed, 1 errors [env]$ ls /gnu/store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.0.1-extra/li= b/clang/12.0.1 ls: cannot access '/gnu/store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.0.1= -extra/lib/clang/12.0.1': No such file or directory [env]$ readlink -f $(type -P clang) /gnu/store/nk5lp7wisgdlvds5camvcchgh19hnn23-clang-12.0.1/bin/clang-12 [env]$ find -L /gnu/store/nk5lp7wisgdlvds5camvcchgh19hnn23-clang-12.0.1/ -n= ame stddef.h /gnu/store/nk5lp7wisgdlvds5camvcchgh19hnn23-clang-12.0.1/lib/clang/12.0.1/i= nclude/stddef.h [env]$ exit $ guix describe Generacio 195 Nov 22 2021 00:37:58 (nuna) guix 24aa7b3 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 24aa7b3c21309b63cc6e8e18d6417d2cddccf6c6 --8<---------------cut here---------------end--------------->8--- Above, the directory passed as =E2=80=98-resource-dir=E2=80=99 does not exi= st: instead of =E2=80=98=E2=80=A6-clang-12.0.1-extra=E2=80=99 it should be =E2=80=98=E2= =80=A6-clang-12.0.1=E2=80=99. This directory name is determined in =E2=80=98clangd/CompileCommands.cpp=E2= =80=99: --8<---------------cut here---------------start------------->8--- std::string detectStandardResourceDir() { static int Dummy; // Just an address in this process. return CompilerInvocation::GetResourcesPath("clangd", (void *)&Dummy); } [=E2=80=A6] CommandMangler CommandMangler::detect() { CommandMangler Result; Result.ClangPath =3D detectClangPath(); Result.ResourceDir =3D detectStandardResourceDir(); Result.Sysroot =3D detectSysroot(); return Result; } [=E2=80=A6] if (ResourceDir && !Has("-resource-dir")) Cmd.push_back(("-resource-dir=3D" + *ResourceDir)); --8<---------------cut here---------------end--------------->8--- We should either fix =E2=80=98GetResourcesPath=E2=80=99 or patch the file a= bove so it returns the Clang directory name known at build time. Ludo=E2=80=99. From unknown Fri Aug 08 22:53:12 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#52054: closed (Re: bug#52054: clangd cannot find ) Message-ID: References: <87wnhuvm62.fsf@gnu.org> <87ilwjjiav.fsf@inria.fr> X-Gnu-PR-Message: they-closed 52054 X-Gnu-PR-Package: guix Reply-To: 52054@debbugs.gnu.org Date: Wed, 16 Feb 2022 15:59:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1645027141-7280-1" This is a multi-part message in MIME format... ------------=_1645027141-7280-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #52054: clangd cannot find which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 52054@debbugs.gnu.org. --=20 52054: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D52054 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1645027141-7280-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 52054-done) by debbugs.gnu.org; 16 Feb 2022 15:58:09 +0000 Received: from localhost ([127.0.0.1]:49278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKMgy-0001sJ-Rc for submit@debbugs.gnu.org; Wed, 16 Feb 2022 10:58:09 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:59788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKMgx-0001rl-2O for 52054-done@debbugs.gnu.org; Wed, 16 Feb 2022 10:58:07 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 326BCA27; Wed, 16 Feb 2022 16:58:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YBFH4mPy2X7W; Wed, 16 Feb 2022 16:57:59 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 3683F57B; Wed, 16 Feb 2022 16:57:58 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 52054-done@debbugs.gnu.org Subject: Re: bug#52054: clangd cannot find References: <87ilwjjiav.fsf@inria.fr> Date: Wed, 16 Feb 2022 16:57:57 +0100 In-Reply-To: <87ilwjjiav.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Tue, 23 Nov 2021 11:08:24 +0100") Message-ID: <87wnhuvm62.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 326BCA27 X-Spamd-Result: default: False [0.46 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DBL_PROHIBIT(0.00)[5.0.0.8:email,12.0.0.1:email]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_MIXED_CHARSET(0.56)[subject]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 52054-done Cc: emmanuel.agullo@inria.fr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, Ludovic Court=C3=A8s skribis: > =E2=80=98clangd=E2=80=99 fails to find , as shown here: > > $ printf '#include \nint foo (int x) {return x+2; }' > t.c > $ guix shell -C -D hello --with-c-toolchain=3Dhello=3Dclang-toolchain cla= ng:extra strace > guix shell: warning: transformation 'with-c-toolchain' had no effect on s= trace@5.8 > guix shell: warning: transformation 'with-c-toolchain' had no effect on c= lang@12.0.1 > [env]$ clang -c t.c > [env]$ clangd --check=3Dt.c > I[10:02:40.349] clangd version 12.0.1 > I[10:02:40.349] PID: 3 > I[10:02:40.349] Working directory: /home/ludo/tmp/clangd-bug > I[10:02:40.349] argv[0]: clangd > I[10:02:40.349] argv[1]: --check=3Dt.c > I[10:02:40.349] Entering check mode (no LSP server) > I[10:02:40.349] Testing on source file /home/ludo/tmp/clangd-bug/t.c > I[10:02:40.349] Loading compilation database... > I[10:02:40.349] Failed to find compilation database for /home/ludo/tmp/cl= angd-bug/t.c > I[10:02:40.349] Generic fallback command is: /gnu/store/nk5lp7wisgdlvds5c= amvcchgh19hnn23-clang-12.0.1/bin/clang /home/ludo/tmp/clangd-bug/t.c -fsynt= ax-only -resource-dir=3D/gnu/store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-1= 2.0.1-extra/lib/clang/12.0.1 > I[10:02:40.350] Parsing command... > I[10:02:40.352] internal (cc1) args are: -cc1 -triple x86_64-unknown-linu= x-gnu -fsyntax-only -disable-free -disable-llvm-verifier -discard-value-nam= es -main-file-name t.c -mrelocation-model static -mframe-pointer=3Dall -fma= th-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-c= pu x86-64 -tune-cpu generic -fno-split-dwarf-inlining -debugger-tuning=3Dgd= b -resource-dir /gnu/store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.0.1-ex= tra/lib/clang/12.0.1 -c-isystem /gnu/store/xl7wammzljnp0rg496n96h5m69y25isg= -profile/include -cxx-isystem /gnu/store/xl7wammzljnp0rg496n96h5m69y25isg-p= rofile/include -internal-isystem /usr/local/include -internal-isystem /gnu/= store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.0.1-extra/lib/clang/12.0.1/= include -internal-externc-isystem /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0= cr-glibc-2.31/include -fdebug-compilation-dir /home/ludo/tmp/clangd-bug -fe= rror-limit 19 -fgnuc-version=3D4.2.1 -faddrsig -x c /home/ludo/tmp/clangd-b= ug/t.c > I[10:02:40.352] Building preamble... > I[10:02:40.368] Indexing headers... > E[10:02:40.382] [pp_file_not_found] Line 1: in included file: 'stddef.h' = file not found > I[10:02:40.382] Building AST... > I[10:02:40.386] Indexing AST... > I[10:02:40.386] Testing features at each token (may be slow in large file= s) > I[10:02:40.387] All checks completed, 1 errors Fixed with 35ea49daf6cdef5bf6156dd90add77cede364a4b (thanks, Greg!). Ludo=E2=80=99. ------------=_1645027141-7280-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 23 Nov 2021 10:08:41 +0000 Received: from localhost ([127.0.0.1]:50075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpSjA-0001mY-Lx for submit@debbugs.gnu.org; Tue, 23 Nov 2021 05:08:41 -0500 Received: from lists.gnu.org ([209.51.188.17]:44460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpSj8-0001mQ-6K for submit@debbugs.gnu.org; Tue, 23 Nov 2021 05:08:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpSj8-0001QI-2E for bug-guix@gnu.org; Tue, 23 Nov 2021 05:08:38 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:58414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpSj3-0005dv-QR for bug-guix@gnu.org; Tue, 23 Nov 2021 05:08:37 -0500 IronPort-Data: =?us-ascii?q?A9a23=3A6tguRKr5h2n6qz18PvNz939ixvFeBmI8ZxIvgKr?= =?us-ascii?q?LsJaIsI5as4F+vmVJXDiDbv+JZDfyett+a4u2oxwEuJ7Uzd5gSAY//C80QiMRo?= =?us-ascii?q?6IpJ/zJdxaqZ3v6wu7rFR88sZ1GMrEsFC2FJ5Pljk/F3oPJ8D8sislkepKmULS?= =?us-ascii?q?dY3krHlc+IMscoUkLd9AR09cAbeeRU1vlVePa+6UzCXf9s9JGGjp8B5Gr9HuDi?= =?us-ascii?q?M/PVAYw5TTSUxzkUGj2zBH5BLpHTU24wuCRroN8RoZWTM6bpF21E/+wwvsjNj+?= =?us-ascii?q?luu6TnkwiWL/YNw+I4pZUc/n7xEEc/mpri/l9bqJFAatUo2zhc9RZzMhBsoKxQ?= =?us-ascii?q?kEiObDWhOkGexheCSB3e6NckFPCCSXk6ZDKlhWun3zEhq8G4FsNFYcF9aN4HGB?= =?us-ascii?q?e3fMeNXYKdB/rug4c6NpXUcE934F6cpGuZdpA/ys4lHfCEPw9B4jZRLXD6Zle0?= =?us-ascii?q?StYuyyHJt6GD+JxVNalRE6oj8VzB2oq?= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AQURqrK80BKO5AaAIeKluk+DdI+orL9Y04lQ7?= =?us-ascii?q?vn2ZhyYlEfBw8Pre/sjztCWYtN9/YhEdcLy7VpVoBEm8yXcK2/h1AV7SZmXbUQ?= =?us-ascii?q?KTRekIh7cKgQeQfxEWndQz6U4PSdkYNDSJNykdsS8k2njAL+od?= X-IronPort-AV: E=Sophos;i="5.87,257,1631570400"; d="scan'208";a="5304110" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 11:08:25 +0100 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guix@gnu.org Subject: clangd cannot find X-Debbugs-Cc: emmanuel.agullo@inria.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 3 Frimaire an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 23 Nov 2021 11:08:24 +0100 Message-ID: <87ilwjjiav.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=192.134.164.83; envelope-from=ludovic.courtes@inria.fr; helo=mail2-relais-roc.national.inria.fr X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hello, =E2=80=98clangd=E2=80=99 fails to find , as shown here: --8<---------------cut here---------------start------------->8--- $ printf '#include \nint foo (int x) {return x+2; }' > t.c $ guix shell -C -D hello --with-c-toolchain=3Dhello=3Dclang-toolchain clang= :extra strace guix shell: warning: transformation 'with-c-toolchain' had no effect on str= ace@5.8 guix shell: warning: transformation 'with-c-toolchain' had no effect on cla= ng@12.0.1 [env]$ clang -c t.c [env]$ clangd --check=3Dt.c I[10:02:40.349] clangd version 12.0.1 I[10:02:40.349] PID: 3 I[10:02:40.349] Working directory: /home/ludo/tmp/clangd-bug I[10:02:40.349] argv[0]: clangd I[10:02:40.349] argv[1]: --check=3Dt.c I[10:02:40.349] Entering check mode (no LSP server) I[10:02:40.349] Testing on source file /home/ludo/tmp/clangd-bug/t.c I[10:02:40.349] Loading compilation database... I[10:02:40.349] Failed to find compilation database for /home/ludo/tmp/clan= gd-bug/t.c I[10:02:40.349] Generic fallback command is: /gnu/store/nk5lp7wisgdlvds5cam= vcchgh19hnn23-clang-12.0.1/bin/clang /home/ludo/tmp/clangd-bug/t.c -fsyntax= -only -resource-dir=3D/gnu/store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.= 0.1-extra/lib/clang/12.0.1 I[10:02:40.350] Parsing command... I[10:02:40.352] internal (cc1) args are: -cc1 -triple x86_64-unknown-linux-= gnu -fsyntax-only -disable-free -disable-llvm-verifier -discard-value-names= -main-file-name t.c -mrelocation-model static -mframe-pointer=3Dall -fmath= -errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu= x86-64 -tune-cpu generic -fno-split-dwarf-inlining -debugger-tuning=3Dgdb = -resource-dir /gnu/store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.0.1-extr= a/lib/clang/12.0.1 -c-isystem /gnu/store/xl7wammzljnp0rg496n96h5m69y25isg-p= rofile/include -cxx-isystem /gnu/store/xl7wammzljnp0rg496n96h5m69y25isg-pro= file/include -internal-isystem /usr/local/include -internal-isystem /gnu/st= ore/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.0.1-extra/lib/clang/12.0.1/in= clude -internal-externc-isystem /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr= -glibc-2.31/include -fdebug-compilation-dir /home/ludo/tmp/clangd-bug -ferr= or-limit 19 -fgnuc-version=3D4.2.1 -faddrsig -x c /home/ludo/tmp/clangd-bug= /t.c I[10:02:40.352] Building preamble... I[10:02:40.368] Indexing headers... E[10:02:40.382] [pp_file_not_found] Line 1: in included file: 'stddef.h' fi= le not found I[10:02:40.382] Building AST... I[10:02:40.386] Indexing AST... I[10:02:40.386] Testing features at each token (may be slow in large files) I[10:02:40.387] All checks completed, 1 errors [env]$ ls /gnu/store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.0.1-extra/li= b/clang/12.0.1 ls: cannot access '/gnu/store/hnw2acjhfpj5l2zrazj5fvq5ksy002f1-clang-12.0.1= -extra/lib/clang/12.0.1': No such file or directory [env]$ readlink -f $(type -P clang) /gnu/store/nk5lp7wisgdlvds5camvcchgh19hnn23-clang-12.0.1/bin/clang-12 [env]$ find -L /gnu/store/nk5lp7wisgdlvds5camvcchgh19hnn23-clang-12.0.1/ -n= ame stddef.h /gnu/store/nk5lp7wisgdlvds5camvcchgh19hnn23-clang-12.0.1/lib/clang/12.0.1/i= nclude/stddef.h [env]$ exit $ guix describe Generacio 195 Nov 22 2021 00:37:58 (nuna) guix 24aa7b3 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 24aa7b3c21309b63cc6e8e18d6417d2cddccf6c6 --8<---------------cut here---------------end--------------->8--- Above, the directory passed as =E2=80=98-resource-dir=E2=80=99 does not exi= st: instead of =E2=80=98=E2=80=A6-clang-12.0.1-extra=E2=80=99 it should be =E2=80=98=E2= =80=A6-clang-12.0.1=E2=80=99. This directory name is determined in =E2=80=98clangd/CompileCommands.cpp=E2= =80=99: --8<---------------cut here---------------start------------->8--- std::string detectStandardResourceDir() { static int Dummy; // Just an address in this process. return CompilerInvocation::GetResourcesPath("clangd", (void *)&Dummy); } [=E2=80=A6] CommandMangler CommandMangler::detect() { CommandMangler Result; Result.ClangPath =3D detectClangPath(); Result.ResourceDir =3D detectStandardResourceDir(); Result.Sysroot =3D detectSysroot(); return Result; } [=E2=80=A6] if (ResourceDir && !Has("-resource-dir")) Cmd.push_back(("-resource-dir=3D" + *ResourceDir)); --8<---------------cut here---------------end--------------->8--- We should either fix =E2=80=98GetResourcesPath=E2=80=99 or patch the file a= bove so it returns the Clang directory name known at build time. Ludo=E2=80=99. ------------=_1645027141-7280-1--