From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C355E64012 for ; Sun, 5 Apr 2026 05:29:52 +0000 (UTC) Subject: Re: [PATCH] bitbake: Resolve symlink duplicates in layer paths To: bitbake-devel@lists.openembedded.org From: "Zk47T" X-Originating-Location: Hanoi, VN (14.177.124.140) X-Originating-Platform: Linux Chrome 143 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Sat, 04 Apr 2026 22:29:42 -0700 References: <20260403153327.64044-1-zizuzacker@gmail.com> <112696b9cf819c10a162830a2e7759cf188ba216.camel@linuxfoundation.org> In-Reply-To: <112696b9cf819c10a162830a2e7759cf188ba216.camel@linuxfoundation.org> Message-ID: <275547.1775366982271565372@lists.openembedded.org> Content-Type: multipart/alternative; boundary="lwYwqkMnqyLK3l8SPLu1" List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 05 Apr 2026 05:29:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19322 --lwYwqkMnqyLK3l8SPLu1 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The user doesn't intentionally add the same layer twice =E2=80=94 this happ= ens when the working directory uses a symlink path (e.g., /home/pokybuild = =E2=86=92 /srv/ pokybuild ). Running bitbake-layers add-layer /srv/pokybuil= d/.../meta-mingw resolves to a different string than what's already in bbla= yers.conf (which was set via the symlink path), causing ERROR: Found duplic= ated BBFILE_COLLECTIONS. The main fix is using os.path.realpath() inste ad of os.path.abspath() in d= o_ add_layer() and canonicalise_ path() , which prevents the duplicate from= being added in the first place. Regarding the warning in cookerdata.py =E2=80=94 I can remove it if you pre= fer silent deduplication. I added it for visibility when users have manuall= y edited bblayers.conf with symlink paths. Would you prefer it to silently = resolve duplicates instead? This behavior as you shared in root ticket bugzilla https://bugzilla.yoctop= roject. org/show_bug.cgi?id=3D15591 ( https://bugzilla.yoctoproject.org/sho= w_bug.cgi?id=3D15591 ) I try to implement the fix --lwYwqkMnqyLK3l8SPLu1 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

The user doesn't intentionally ad= d the same layer twice — this happens when the working directory uses= a symlink path (e.g., /home/pokybuild=   /srv/pokybuild). = Running bitbake-layers add-layer /srv/pokybuild/...= /meta-mingw resolves to a different string = than what's already in bblayers.conf (which was set via the symlink path), = causing ERROR: Found duplicated BBFILE_COLLECTIONS<= /code>.

The main fix is using = os.path.realpath() instead of<= span> os.path.abspath() in=  do_add_layer() and=  canonicalise_path(), which prevents the du= plicate from being added in the first place.

Regarding the warning in&nb= sp;cookerdata.py — I can remove= it if you prefer silent deduplication. I added it for visibility when user= s have manually edited bblayers.conf with symlink paths. Would you prefer i= t to silently resolve duplicates instead?

 

This behavior as you shared in ro= ot ticket bugzilla https://= bugzilla.yoctoproject.org/show_bug.cgi?id=3D15591 

I try to implement the fix

--lwYwqkMnqyLK3l8SPLu1--