Richard, I'm going to check how rpm uses 'file' and will come up with a better solution. Martin, could you please tell me your use case, if convenient? I will ensure I don't break it.
Regards, Qi -----Original Message----- From: Richard Purdie <richard.pur...@linuxfoundation.org> Sent: Monday, January 16, 2023 7:14 PM To: Chen, Qi <qi.c...@windriver.com>; openembedded-core@lists.openembedded.org Subject: Re: [OE-core][PATCH] rpm: make nativesdk-rpm rdepend on nativesdk-file On Mon, 2023-01-16 at 10:39 +0000, Richard Purdie via lists.openembedded.org wrote: > On Mon, 2023-01-16 at 16:48 +0800, Chen Qi wrote: > > For now, running `file' inside SDK errors out. > > file: could not find any valid magic files! > > > > This is because nativesdk-rpm exports MAGIC. So let's make > > nativesdk-rpm depend on file for better user experiences. > > > > Signed-off-by: Chen Qi <qi.c...@windriver.com> > > --- > > meta/recipes-devtools/rpm/rpm_4.18.0.bb | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/meta/recipes-devtools/rpm/rpm_4.18.0.bb > > b/meta/recipes-devtools/rpm/rpm_4.18.0.bb > > index 8eb0ab207e..3b7d4d640a 100644 > > --- a/meta/recipes-devtools/rpm/rpm_4.18.0.bb > > +++ b/meta/recipes-devtools/rpm/rpm_4.18.0.bb > > @@ -188,6 +188,7 @@ PROVIDES += "python3-rpm" > > FILES:python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*" > > > > RDEPENDS:${PN}-build = "bash perl python3-core" > > +RDEPENDS:nativesdk-rpm += "nativesdk-file" > > Should we be adding file to ${PN}-build instead? Which rpm command > was this with? Does anywhere else in rpm have/need this dependency? To answer my question, the problem is that as well as the rpm wrappers, the code also sets MAGIC= from an environment setup file. At the very least, the RDEPENDS needs a class-nativesdk override in there as otherwise it is floating around unconditionally. I don't really like adding workarounds like this since we won't understand them at some future date. Other solutions might include: a) patching RPM to use RPM_FILEMAGIC instead of MAGIC so we can set it in a more granular way b) moving the environment setup piece for MAGIC to nativesdk-file so it is only used if file is installed in the SDK c) fixing rpm (or file?) to dynamically relocate the paths it is using Can we see if there is a better solution we can switch to please? Cheers, Richard
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#175981): https://lists.openembedded.org/g/openembedded-core/message/175981 Mute This Topic: https://lists.openembedded.org/mt/96303256/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-