From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7339847101007790080 X-Forwarded-Encrypted: i=2; AJvYcCX6FAQQolPSny3oy7jel+OTtvz3DLFW3KCvvf2C+19gvHS3lyPov3b+XQerb213fxWWi9DhgGCTcfBxLgA+vJ4Wff7Lll+fFdQcT+Y= X-Received: by 2002:aa7:c696:0:b0:566:ef8:93f6 with SMTP id n22-20020aa7c696000000b005660ef893f6mr2812013edq.0.1709034052102; Tue, 27 Feb 2024 03:40:52 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6402:4022:b0:563:7e67:4a84 with SMTP id d34-20020a056402402200b005637e674a84ls71993eda.1.-pod-prod-08-eu; Tue, 27 Feb 2024 03:40:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUMWgdplwxhYOcnbo58mmyaboB6Fo0tX5rzYUK0XLVn+UgW6e7gSSsa/rWCuwkoDb34L+kucbZyFqTXp5s7lxAporJv78JnzSPlAfY= X-Google-Smtp-Source: AGHT+IHGtgD2Tu+Gw4B0ehYd4fXPEF9eZ+SociSVgWW6n3ibn4qarUD6dm2wq5I7MMTxYP6j/2vR X-Received: by 2002:a05:6402:1202:b0:566:1127:4bb5 with SMTP id c2-20020a056402120200b0056611274bb5mr2707362edw.1.1709034049517; Tue, 27 Feb 2024 03:40:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709034049; cv=none; d=google.com; s=arc-20160816; b=nILs72eQgehSbbZCqK08d8oPRJ6jBxxtSGr/QyGGzxirI7oWyfxdiCzF/NhBNF3BW7 r2Y5jPZ81PVrz6piUa7rnoDQJeonwhjsqNroj/S7Umsp1Z7MKao3c/soFc+D3IuvDE/5 JaULMpI2B999Slalhy1mZfpsEyM/5JS4Kyv3lzrPy++YKDqbPsmeJQ0YRouCT+CPsJuM PfWwoJobxN/deJjFQ7Njotb2BIr9Q7QubYiP2m+mY4FHeBHXqlRxSeEUD9O1ngbZbf9o 6CI07FckqGBWrfmfi2AI2VJhVLijMYO+8YBF0sWzwHVaTQwtprbfJ661LeJq14EnOvwb +jQA== 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=MBE5u18b0hxNON0tEHdwZlRHZDbqJ8kcFs/BNmfY3Ck=; fh=ZjPjk0Tv6NIOienZPuWkm6ez+WL6tmkYxcG6aGEkSMA=; b=eJ/3Hhz6k8UjZHVHLhnk/RjlogIYPnZhbM7+HzAzRPqS9A1qx2HnnSloaqspiPWXIy B0kfo3WS4iNDjULuB2n6PPjZXrUWCX73hlkOBBTgZ67Eu5+qPoGe6+p+/0nL+4zJs8GX rKnY1J5aj1dBcJo8lDSaRgAo0S/moKkNJZ2Vy2KYbFY01aNV4eu9CVE6S1/waG0JccQa ZhXFaHrY4LnxOPbZz1qCbUa/xR1EvsA8CmN87+4HgXoz7vZogY2J75uo0Qdjx0PH4atz h3WUN/t18y/qedg0CIWdJTRbJ+FBVL/VxO1aWs1iLzip1xkiUxM/Wnn8Y1kQ1Iahp3D1 4clg==; 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 s22-20020a50d496000000b00564caddf28bsi129270edi.3.2024.02.27.03.40.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 03:40:49 -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 41RBel3o030555 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 12:40:48 +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 14:40:47 +0300 In-Reply-To: <494fd4502c156b657994cc20be133946df33e81c.camel@siemens.com> References: <20240226095517.66032-1-cedric.hombourger@siemens.com> <494fd4502c156b657994cc20be133946df33e81c.camel@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: dIuZt4VyJ0XP On Tue, 2024-02-27 at 09:46 +0000, cedric.hombourger@siemens.com wrote: > On Tue, 2024-02-27 at 12:10 +0300, Uladzimir Bely wrote: > > 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 > >=20 > > Hello. >=20 > Hello! Thanks for looking into this patch. >=20 > > The patch itself is worth applying and we'll pass it through CI > > right > > now. >=20 > Sure thing. FWIW, I used ci_build -T fast for a quick non-regression > tests and no failures were reported. Let me know if you see any > issues > with your full CI test. >=20 > >=20 > > 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. >=20 > I came across this issue while doing a clean build against our base- > apt > feeds. The generated base-apt.list file reads (there are more feeds > than just base in our case but all follow the same pattern and I am > only showing the base feed for brevity) >=20 > deb file:///base-apt/base=C2=A0bookworm build debug extra main >=20 > Here we only have (as expected) only file:// feed(s) =3D> apt will not > download anything in /var/cache/apt/archives/ >=20 Yes, I see. When URL's are local (e.g., file://), apt doesn't download anything from them and just uses debs directly. > >=20 > > This information may be useful for the future testcase of this > > situation. > >=20 > > > >=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-com= mands=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-com= mands=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-com= mands=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-com= mands=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-c= ommands=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-comman= ds=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-comman= ds=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-c= ommands=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"= --source-option=3D-I" \ > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --build-dir=3D${WO= RKDIR} --dist=3D"isar" ${DSC_FILE} > > >=20 > >=20 >=20