[{"id":38837,"web_url":"https://patchwork.libcamera.org/comment/38837/","msgid":"<bedcf598-78a3-494e-af60-52d327a1c69e@ideasonboard.com>","date":"2026-05-09T23:35:16","subject":"Re: [PATCH] clangd: add compilation database configuration","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2026. 05. 09. 23:06 keltezéssel, Javier Tia írta:\n> Without this, clangd cannot find build-generated headers such as\n> build/src/libcamera/tracepoints.h and build/config.h, causing spurious\n> diagnostics for any file that includes them.\n> \n> build/ is the project-canonical build directory, already listed in\n> .gitignore and used in the contributing documentation. Developers using\n> a custom build directory can place a local .clangd override; if build/\n> is absent, clangd falls back to its normal heuristics with no regression.\n> \n> Signed-off-by: Javier Tia <floss@jetm.me>\n> ---\n>   .clangd | 2 ++\n>   1 file changed, 2 insertions(+)\n>   create mode 100644 .clangd\n> \n> diff --git a/.clangd b/.clangd\n> new file mode 100644\n> index 00000000..e95990a8\n> --- /dev/null\n> +++ b/.clangd\n> @@ -0,0 +1,2 @@\n> +CompileFlags:\n> +  CompilationDatabase: build/\n\nIsn't this the default? I've been using clangd for years and it\nhas always recognized `build/compile_commands.json`.\n\nhttps://clangd.llvm.org/installation#compile_commandsjson says\n\n```\nclangd will look in the parent directories of the files you edit looking for it,\nand also in subdirectories named build/. For example, if editing $SRC/gui/window.cpp,\nwe search in $SRC/gui/, $SRC/gui/build/, $SRC/, $SRC/build/, …\n```\n\nBased on the above this change should not be necessary. Do you maybe have\nsomething in your top-level clangd config?\n\n\nRegards,\nBarnabás Pőcze\n\n> --\n> Javier Tia","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6ADC7BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  9 May 2026 23:35:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5924263025;\n\tSun, 10 May 2026 01:35:23 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D528962FD3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 10 May 2026 01:35:20 +0200 (CEST)","from [192.168.33.29] (185.221.140.217.nat.pool.zt.hu\n\t[185.221.140.217])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AB60673B;\n\tSun, 10 May 2026 01:35:14 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"WIwEuP7C\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1778369714;\n\tbh=yQPnUvMrH8AagtlNr6TY2pyQnhrb9NSzRshSLmYR65k=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=WIwEuP7CY+9gGj/PO07jD9uOHc9EsNtPO4yiHd/yUGIK/KK3o+2UBdNhH9O3Ax+73\n\tBBJAJS+iXPruUZejDD+bb35MfoK/s0uFkcwVJ/NQ6oOQBnA+n3hGHTpdmjlJolJUey\n\tO3nmwult1FSB+FA72Eppt40L7WWmYJjjJT+RKkV0=","Message-ID":"<bedcf598-78a3-494e-af60-52d327a1c69e@ideasonboard.com>","Date":"Sun, 10 May 2026 01:35:16 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] clangd: add compilation database configuration","To":"Javier Tia <floss@jetm.me>, libcamera-devel@lists.libcamera.org","References":"<YZZrHVXrCbQtD-IO4d56mngTt5e0vcw4K1IAjtEk94nDqFzhcqLzQSpLu-fLG8-Ks8q_TA5siG1KUwUoP9xzzw==@protonmail.internalid>\n\t<20260509210758.F3F7F1EA006C@mailuser.phl.internal>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260509210758.F3F7F1EA006C@mailuser.phl.internal>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38838,"web_url":"https://patchwork.libcamera.org/comment/38838/","msgid":"<20260510022847.1E5C51EA006C@mailuser.phl.internal>","date":"2026-05-10T02:23:09","subject":"Re: [PATCH] clangd: add compilation database configuration","submitter":{"id":261,"url":"https://patchwork.libcamera.org/api/people/261/","name":"Javier Tia","email":"floss@jetm.me"},"content":"Hi Barnabás,\n\nOn 2026-05-09 Barnabás Pőcze wrote:\n> Isn't this the default? I've been using clangd for years and it\n> has always recognized `build/compile_commands.json`.\n[...]\n> Based on the above this change should not be necessary. Do you maybe\n> have something in your top-level clangd config?\n\nYou're right. I checked and have no ~/.config/clangd/config.yaml or\nany other override, and the documentation you quoted matches the\ndefault discovery behavior. The patch is redundant - please drop it.\n\nThanks for the catch.","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2375ABDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 10 May 2026 02:28:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D55046301E;\n\tSun, 10 May 2026 04:28:50 +0200 (CEST)","from fout-a1-smtp.messagingengine.com\n\t(fout-a1-smtp.messagingengine.com [103.168.172.144])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DC42C62FD3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 10 May 2026 04:28:48 +0200 (CEST)","from phl-compute-02.internal (phl-compute-02.internal\n\t[10.202.2.42])\n\tby mailfout.phl.internal (Postfix) with ESMTP id DC63CEC0192;\n\tSat,  9 May 2026 22:28:47 -0400 (EDT)","from phl-imap-07 ([10.202.2.97])\n\tby phl-compute-02.internal (MEProxy); Sat, 09 May 2026 22:28:47 -0400","by mailuser.phl.internal (Postfix, from userid 501)\n\tid 1E5C51EA006C; Sat,  9 May 2026 22:28:47 -0400 (EDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=jetm.me header.i=@jetm.me header.b=\"O4Kq+eGa\";\n\tdkim=pass (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"PlttwAf0\"; \n\tdkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=jetm.me; h=cc:cc\n\t:content-transfer-encoding:content-type:content-type:date:date\n\t:from:from:in-reply-to:in-reply-to:message-id:mime-version\n\t:references:reply-to:subject:subject:to:to; s=fm2; t=1778380127;\n\tx=1778466527; bh=gTvOigX/9cEwBDTB2PWlHl6CAWGZvjkJvTJ+HD3yiIc=; b=\n\tO4Kq+eGaAN9H869KQ9OdMM6NfmWxVt00s7KIWgGyM+whyve5Tww1cn/EqMAP3jdZ\n\tbfeBNfq5RL72j/4xgFFlOOlhhy01mHIwkBw9nzUv1wvu8B94w4OOMYhL7W/TDDqA\n\tQO8qBs3EeQI2ASHe2MQiR4AchFW2VJTkGygkcxIPZl2ZGgIxjKkmKfouxKd4RojT\n\ttUquYljuJq40vSoY8Y130oJbSx0B0iSTvvydDnsbaCDBI2NeqDcZhFQ/Zxa17DdD\n\tWYd/Q+DNYdAajiNx806WtZpfSk5pXbjyzrqUdYra/DPEW99AgVxXspx26IRhcxIy\n\t6ZzD1/Kb0eOugl4JJ5gjNg==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:cc:content-transfer-encoding\n\t:content-type:content-type:date:date:feedback-id:feedback-id\n\t:from:from:in-reply-to:in-reply-to:message-id:mime-version\n\t:references:reply-to:subject:subject:to:to:x-me-proxy\n\t:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1778380127; x=\n\t1778466527; bh=gTvOigX/9cEwBDTB2PWlHl6CAWGZvjkJvTJ+HD3yiIc=; b=P\n\tlttwAf0CZUS5JXKCzazXtT3ZiQCOMYXbmtEFVqFZLq7QgUZ5cHtNXq6Qh86vKOCv\n\tiSxoJAQZeh4uA5HWQrBSyvPIqw7JsToDSKZ8KigyKSloSMfYzcaMQ8JxbufsYF1E\n\te9TQIwKghkcLLtTzSLdior4tukoo99ZJCbaa9ktidMi2aL7fBUtpZAw89PETnRdJ\n\tkdNTQv/OXq2bn+vXmU/CqTkSce6NvW5bh717FBsSkaWiBULkh7kVuLwn7qoS12sS\n\tgyiiV69edsBXxCIutjKXItzwA8hSA2H1l9MkE/CtGmaH2XlJqvvqDl16HkLThIgg\n\t4Jj6y4+QwmFhV8EcfSVjA=="],"X-ME-Sender":"<xms:X-3_aWhVbGwpFuVm-O6kwSH_ZU4bEC385UhB7UoWf9IgayY_HLjqKA>\n\t<xme:X-3_aR2hSkaiNzCWS_oa5i_zFajyeLSg9QVLFid3GboXAyy6NOVSB0WNjaBqA_MEd\n\tLdKLk9wqsFnBwkdNGC9w6-i2f5REE-0iQJV94Tkdn_VSXJ2h6Q-xnE3>","X-ME-Proxy-Cause":"gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduudegleduucetufdoteggodetrf\n\tdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu\n\trghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegopf\n\thokfffucdluddtmdenucfjughrpefotggggffhvfffufevjghfsehtkedttdertdejnecu\n\thfhrohhmpeflrghvihgvrhcuvfhirgcuoehflhhoshhssehjvghtmhdrmhgvqeenucggtf\n\tfrrghtthgvrhhnpedtudejffejkeekteelueefvdejvdeuhfefteehkeevtddvleduteek\n\tleetvdelhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh\n\thmpehflhhoshhssehjvghtmhdrmhgvpdhnsggprhgtphhtthhopeefpdhmohguvgepshhm\n\tthhpohhuthdprhgtphhtthhopegsrghrnhgrsggrshdrphhotgiivgesihguvggrshhonh\n\tgsohgrrhgurdgtohhmpdhrtghpthhtohepfhhlohhsshesjhgvthhmrdhmvgdprhgtphht\n\tthhopehlihgstggrmhgvrhgrqdguvghvvghlsehlihhsthhsrdhlihgstggrmhgvrhgrrd\n\thorhhg","X-ME-Proxy":"<xmx:X-3_aX8xkWJprT77CPOrimUfHbTKXfoY_q2p40U2mVWerVlHsns4Zg>\n\t<xmx:X-3_abewKBZ9caR4KyY-iEZK_4JhlvvTMFvpXCWXm-PLAanQ9rlQfA>\n\t<xmx:X-3_aYEjLQOJSzdaEMRwa-i5gbHpouLNFLjvKV3Kiu3y3qmtbl7Prg>\n\t<xmx:X-3_aReFm4sgj49pJfHN3Vk4YZrMkat1fcc7jZpdm-9LL9g4VYFbrA>\n\t<xmx:X-3_aRRxBGnyiSBUQHYGD66a0T3MjR3QKnZjKLjoJ6tI15HWbkelFdHE>","Feedback-ID":"i9dde48b3:Fastmail","X-Mailer":"MessagingEngine.com Webmail Interface","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","From":"Javier Tia <floss@jetm.me>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Date":"Sat, 09 May 2026 20:23:09 -0600","Subject":"Re: [PATCH] clangd: add compilation database configuration","Cc":"libcamera-devel@lists.libcamera.org","In-Reply-To":"<bedcf598-78a3-494e-af60-52d327a1c69e@ideasonboard.com>","References":"<YZZrHVXrCbQtD-IO4d56mngTt5e0vcw4K1IAjtEk94nDqFzhcqLzQSpLu-fLG8-Ks8q_TA5siG1KUwUoP9xzzw==@protonmail.internalid>\n\t<20260509210758.F3F7F1EA006C@mailuser.phl.internal>\n\t<bedcf598-78a3-494e-af60-52d327a1c69e@ideasonboard.com>","Message-Id":"<20260510022847.1E5C51EA006C@mailuser.phl.internal>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]