public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Zoltan Boszormenyi" <zboszor@pr.hu>
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH 2/2] staging.bbclass: Ignore installing multiple symlinks of the same name
Date: Fri, 13 May 2022 16:02:48 +0200	[thread overview]
Message-ID: <c97c1296-81b6-5900-eadd-dc3f711e82b2@pr.hu> (raw)
In-Reply-To: <CANNYZj9-ZWBBo=+FLAECu=Eg8ZtumcuijWQ8_mU0D-hkSRZEWw@mail.gmail.com>

2022. 05. 13. 15:55 keltezéssel, Alexander Kanavin írta:
> Apologies, but special-casing this in staging class is not right
> either. The problem should be addressed at the making of
> sysroot-destdir/ step from the npm class.

npm.bbclass creates the symlink in sysroot-destdir for recipe A

But then it's the job of staging.bbclass to populate a recipe B's
recipe-sysroot and recipe-sysroot-native from recipe A.

How can this be worked around from npm.bbclass?

> 
> Alex
> 
> 
> On Fri, 13 May 2022 at 15:49, Zoltan Boszormenyi via
> lists.openembedded.org <zboszor=pr.hu@lists.openembedded.org> wrote:
>>
>> From: Zoltán Böszörményi <zboszor@gmail.com>
>>
>> Recipes using "inherit npm" install the same /usr/lib/node symlink
>> that points to node_modules. When a recipe DEPENDS on multiple
>> npm based recipe, do_prepare_recipe_sysroot() fails.
>>
>> Ignore this symlink in a way that the set of ignored symlinks
>> can be extended later if needed.
>>
>> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>> ---
>>   meta/classes/staging.bbclass | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
>> index 9fc8f4f283..f7b6056219 100644
>> --- a/meta/classes/staging.bbclass
>> +++ b/meta/classes/staging.bbclass
>> @@ -528,6 +528,7 @@ python extend_recipe_sysroot() {
>>
>>               with open(manifest, "r") as f:
>>                   manifests[dep] = manifest
>> +                ignored_dests = [ ''.join([d.getVar('nonarch_libdir'), '/node' ]) ]
>>                   for l in f:
>>                       l = l.strip()
>>                       if l.endswith("/fixmepath"):
>> @@ -545,7 +546,10 @@ python extend_recipe_sysroot() {
>>                       hashname = targetdir + dest
>>                       if not hashname.endswith("/"):
>>                           if hashname in fileset:
>> -                            bb.fatal("The file %s is installed by both %s and %s, aborting" % (dest, c, fileset[hashname]))
>> +                            if os.path.islink(hashname) and  dest in ignored_dests:
>> +                                bb.note("The symlink '%s' %s wants to install is already installed by %s, ignoring" % (dest, c, fileset[hashname]))
>> +                            else:
>> +                                bb.fatal("The file %s is installed by both %s and %s, aborting" % (dest, c, fileset[hashname]))
>>                           else:
>>                               fileset[hashname] = c
>>
>> --
>> 2.36.1
>>
>>
>>
>>
>>
>>
>> 
>>


  reply	other threads:[~2022-05-13 14:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 13:48 Fix some NPM related problems Zoltan Boszormenyi
2022-05-13 13:48 ` [PATCH 1/2] npm.bbclass: Fix file permissions before opening it for writing Zoltan Boszormenyi
2022-05-13 13:52   ` [OE-core] " Alexander Kanavin
     [not found]     ` <b47fd784-6d1d-4c89-a61a-d517210ac41a@gmail.com>
2022-05-13 14:00       ` Alexander Kanavin
2022-05-13 13:48 ` [PATCH 2/2] staging.bbclass: Ignore installing multiple symlinks of the same name Zoltan Boszormenyi
2022-05-13 13:55   ` [OE-core] " Alexander Kanavin
2022-05-13 14:02     ` Zoltan Boszormenyi [this message]
2022-05-13 14:14       ` richard.purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c97c1296-81b6-5900-eadd-dc3f711e82b2@pr.hu \
    --to=zboszor@pr.hu \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox