From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7339847101007790080 X-Forwarded-Encrypted: i=2; AJvYcCVvWJUR9agjAJzibUeTZCAv02jwD3IGBe+uFhF4vqCN+6txe2oBkpAJCkWrHwX5QAzeuUgHZj5gCDvLjQ/a/76JwR5k9zRqFILXDKI= X-Received: by 2002:aa7:c898:0:b0:566:1794:7b2 with SMTP id p24-20020aa7c898000000b00566179407b2mr2619849eds.13.1709025063403; Tue, 27 Feb 2024 01:11:03 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6402:401e:b0:565:6f7:f774 with SMTP id d30-20020a056402401e00b0056506f7f774ls561340eda.2.-pod-prod-01-eu; Tue, 27 Feb 2024 01:11:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWsHKe2PcJrsibrisZnyFy/ev402YW+q1Gs3rQaPFqpAfW9c82Uq6e8/smh80u3yShs6yIDLSaaxYhj3QNaSlfIOTcu0j95e1RkQlQ= X-Google-Smtp-Source: AGHT+IEU0xWQgJsPh14oB5JrOnsyYn2Jwkv08UI1H8QYwKQGVqbtdCyOYydQzu+A7LoAwzcpMovc X-Received: by 2002:a17:906:c246:b0:a43:a2c3:3653 with SMTP id bl6-20020a170906c24600b00a43a2c33653mr1002900ejb.7.1709025060902; Tue, 27 Feb 2024 01:11:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709025060; cv=none; d=google.com; s=arc-20160816; b=pRGA2qLfbZAAZrGGfPDw2rMXFz87UGD8N+kLV4g047LraCPYq1cjMKUPQUT/NVdncu nPkcpmJQTJIJKqGVUvdxkvII95O+mRntDf7vxmny5COPGVJVtvelr2QSqjiTmGH8hFlv /PrP3SxbRn47KAxzxy0Lo5G0H2bMQtCvfVZjTk23VycKcwgWk1J7S/SxuiTh5i0sR11w IRP30KE7PDxGSA84LBQLJeBh46hPnZpKSwI1UUgTy4mZDqL+57oxpsL/2fkMJ1LTrO5Z OGbMflUpIQm0ofzPp8f+5bFkrL35VDFSW4vALeV4zPOvZS8wor4STsJpCuoe7ikuQbzd 5FuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id; bh=Zq+KCPz7NLZz+dIhncLGWlV0WZD7R70DrEMqO2qJIgA=; fh=ZjPjk0Tv6NIOienZPuWkm6ez+WL6tmkYxcG6aGEkSMA=; b=Uaj29tqDHftvc+CRkIPBqR4A0l/ezulcdYIGtTmvaLxDmm8C/HD9sbVj67VLeAEUZq 99ia9H9Dnpfg8ONeJxod8T9KhJEuT4/+1nTyKyFCEd0kYQPkq+1Y16c6r8pVJKSOgBvn 4EuRVSkaAQvc2SLq9zBxa0Saf5MVNGVLZmcFQAoJq9cIv2LHWwaU9YjYcD0X8qoeruFe K6bb1pjR0ZGMH6+gnUD/Nj/rgMm9cgGFBhQyT9IaUZZEkLJGWZ0gzgi8VnwlNyfnDu/4 2dFD+MMoohxDP+WN4XH4w+D3O3dDYUI5p2SHGxZXbJs3XJZQP0PJMXv/IIXB3oB2lZk9 FN0g==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id ne5-20020a1709077b8500b00a3e5ad28aeasi74187ejc.2.2024.02.27.01.11.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 01:11:00 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from [127.0.0.1] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 41R9AwDX029912 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 10:10:59 +0100 Message-ID: Subject: Re: [PATCH] dpkg: use find to create symlinks to downloaded .deb files vs ln -sf wildcard From: Uladzimir Bely To: "cedric.hombourger@siemens.com" , "isar-users@googlegroups.com" Date: Tue, 27 Feb 2024 12:10:58 +0300 In-Reply-To: References: <20240226095517.66032-1-cedric.hombourger@siemens.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (by Flathub.org) MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: qb+Q1dX5ANG5 On Mon, 2024-02-26 at 10:08 +0000, 'cedric.hombourger@siemens.com' via isar-users wrote: > On Mon, 2024-02-26 at 10:55 +0100, Cedric Hombourger wrote: > > If no .deb files were downloaded from remote feeds, use of "ln -sf > > *.deb" will > > create a dangling symlink named "*.deb" in the target directory and > > will be a > > broken link and make the cp command used in the finished-build- > > commands fail. > > Use "find -exec ln -t -sf {} +" to create symlinks > > instead of > > "ln -sf wildcard". For consistency and optimization, the find > > command > > used to > > copy newly downloaded .deb files from the sbuild env back to the > > build env is > > also changed to use the "{} +" -exec flavor (instead of "{} ;" > > which > > spawns > > one cp command for each single match). The issue of a dangling > > symlink named > > "*.deb" was found while building against file:// sources and no > > remote feeds. >=20 > Please consider this patch for 0.10. Currently doing some integration > tests against Isar's HEAD. This issue with the broken symlink named > "*.deb" is causing offline builds of our product to fail. Our hope is > for our next release to be based on a pristine 0.10 Isar release and > we > will therefore strive to provide timely feedback and/or patches to > the > various -rcX tags until 0.10 >=20 Hello. The patch itself is worth applying and we'll pass it through CI right now. Just a question - how exactly did you get empty download dir when the package is built? Was sbuild-chroot taken from sstate cache, while the package was not previously built or the recipe was changed. This information may be useful for the future testcase of this situation. > >=20 > > Signed-off-by: Cedric Hombourger > > --- > > =C2=A0meta/classes/dpkg.bbclass | 4 ++-- > > =C2=A01 file changed, 2 insertions(+), 2 deletions(-) > >=20 > > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass > > index 0578977d..3fa9f604 100644 > > --- a/meta/classes/dpkg.bbclass > > +++ b/meta/classes/dpkg.bbclass > > @@ -120,10 +120,10 @@ dpkg_runbuild() { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --chroot-setup-command= s=3D"echo \"APT::Get::allow-downgrades > > 1;\" > /etc/apt/apt.conf.d/50isar-apt" \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --chroot-setup-command= s=3D"rm -f /var/log/dpkg.log" \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --chroot-setup-command= s=3D"mkdir -p ${deb_dir}" \ > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --chroot-setup-commands=3D"= ln -sf ${ext_deb_dir}/*.deb -t > > ${deb_dir}/" \ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --chroot-setup-commands=3D"= find ${ext_deb_dir} -maxdepth 1 - > > name '*.deb' -exec ln -t ${deb_dir}/ -sf {} +" \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --chroot-setup-command= s=3D"apt-get update -o > > Dir::Etc::SourceList=3D\"sources.list.d/isar-apt.list\" -o > > Dir::Etc::SourceParts=3D\"-\" -o APT::Get::List-Cleanup=3D\"0\"" \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --finished-build-comma= nds=3D"rm -f ${deb_dir}/sbuild-build- > > depends-main-dummy_*.deb" \ > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --finished-build-commands= =3D"find ${deb_dir} -maxdepth 1 - > > type > > f -name '*.deb' -print -exec cp ${CP_FLAGS} -t ${ext_deb_dir}/ {} > > \;" > > \ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --finished-build-commands= =3D"find ${deb_dir} -maxdepth 1 - > > type > > f -name '*.deb' -print -exec cp ${CP_FLAGS} -t ${ext_deb_dir}/ {} > > +" > > \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --finished-build-comma= nds=3D"cp /var/log/dpkg.log > > ${ext_root}/dpkg_partial.log" \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --debbuildopts=3D"--so= urce-option=3D-I" \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --build-dir=3D${WORKDI= R} --dist=3D"isar" ${DSC_FILE} >=20