diff mbox series

[RFC] shadow: add libxcrypt-native dependency for native and nativesdk variants

Message ID 20260506194507.3786568-1-igor.opaniuk@foundries.io
State New
Headers show
Series [RFC] shadow: add libxcrypt-native dependency for native and nativesdk variants | expand

Commit Message

Igor Opaniuk May 6, 2026, 7:45 p.m. UTC
Configure fails with "crypt() not found" when building shadow-native on
hosts where libcrypt is no longer part of glibc and the libxcrypt
development files are not installed (e.g. fresh Ubuntu 24.04+, where
glibc 2.39 dropped libcrypt and libxcrypt-dev is not pulled in by
default).

virtual/crypt-native is in ASSUME_PROVIDED (meta/conf/bitbake.conf),
which is why a plain DEPENDS = "virtual/crypt" does not pull
libxcrypt-native into the native sysroot - the host is expected to
provide libcrypt. That assumption no longer holds on current
distributions.

A previous attempt to fix this by adding libxcrypt-native to DEPENDS
unconditionally (commit 65532fc751 "shadow: add libxcrypt-native
dependency") was reverted in 54eccb76eb because it incorrectly pulled
a -native recipe into the target build. Use class-specific overrides
so the target build is unaffected and only shadow-native (and
nativesdk-shadow) gain the explicit dependency on libxcrypt-native /
nativesdk-libxcrypt.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
---
 meta/recipes-extended/shadow/shadow_4.19.4.bb | 2 ++
 1 file changed, 2 insertions(+)

Comments

Yoann Congal May 6, 2026, 8:46 p.m. UTC | #1
On Wed May 6, 2026 at 9:45 PM CEST, Igor Opaniuk via lists.openembedded.org wrote:
> Configure fails with "crypt() not found" when building shadow-native on
> hosts where libcrypt is no longer part of glibc and the libxcrypt
> development files are not installed (e.g. fresh Ubuntu 24.04+, where
> glibc 2.39 dropped libcrypt and libxcrypt-dev is not pulled in by
> default).
>
> virtual/crypt-native is in ASSUME_PROVIDED (meta/conf/bitbake.conf),
> which is why a plain DEPENDS = "virtual/crypt" does not pull
> libxcrypt-native into the native sysroot - the host is expected to
> provide libcrypt. That assumption no longer holds on current
> distributions.

Note that we added libcrypt-dev as a documented host dependency here:
https://git.yoctoproject.org/yocto-docs/commit/?id=2b41d175ea1924bf401a203fb678261fefb228dc

> A previous attempt to fix this by adding libxcrypt-native to DEPENDS
> unconditionally (commit 65532fc751 "shadow: add libxcrypt-native
> dependency") was reverted in 54eccb76eb because it incorrectly pulled
> a -native recipe into the target build. Use class-specific overrides
> so the target build is unaffected and only shadow-native (and
> nativesdk-shadow) gain the explicit dependency on libxcrypt-native /
> nativesdk-libxcrypt.
>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>


> ---
>  meta/recipes-extended/shadow/shadow_4.19.4.bb | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-extended/shadow/shadow_4.19.4.bb b/meta/recipes-extended/shadow/shadow_4.19.4.bb
> index 94f155641c..cc69864a2a 100644
> --- a/meta/recipes-extended/shadow/shadow_4.19.4.bb
> +++ b/meta/recipes-extended/shadow/shadow_4.19.4.bb
> @@ -9,6 +9,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=c9a450b7be84eac23e6353efecb60b5b \
>                      "
>  
>  DEPENDS = "virtual/crypt"
> +DEPENDS:append:class-native = " libxcrypt-native"
> +DEPENDS:append:class-nativesdk = " nativesdk-libxcrypt"
>  
>  GITHUB_BASE_URI = "https://github.com/shadow-maint/shadow/releases"
>  SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.gz \
Igor Opaniuk May 7, 2026, 7:13 a.m. UTC | #2
Hi Yoann,

On Wed, May 6, 2026 at 10:46 PM Yoann Congal <yoann.congal@smile.fr> wrote:
>
> On Wed May 6, 2026 at 9:45 PM CEST, Igor Opaniuk via lists.openembedded.org wrote:
> > Configure fails with "crypt() not found" when building shadow-native on
> > hosts where libcrypt is no longer part of glibc and the libxcrypt
> > development files are not installed (e.g. fresh Ubuntu 24.04+, where
> > glibc 2.39 dropped libcrypt and libxcrypt-dev is not pulled in by
> > default).
> >
> > virtual/crypt-native is in ASSUME_PROVIDED (meta/conf/bitbake.conf),
> > which is why a plain DEPENDS = "virtual/crypt" does not pull
> > libxcrypt-native into the native sysroot - the host is expected to
> > provide libcrypt. That assumption no longer holds on current
> > distributions.
>
> Note that we added libcrypt-dev as a documented host dependency here:
> https://git.yoctoproject.org/yocto-docs/commit/?id=2b41d175ea1924bf401a203fb678261fefb228dc

Thanks, I missed that. With virtual/crypt-native in ASSUME_PROVIDED
this is consistent with how OE-core treats other
host-provided libraries. I'll drop the patch.

One small follow-up if it's worth the time:

the failure mode for users who miss the doc update is a configure
error deep in shadow-native
(checking for crypt in -lcrypt... no -> configure: error: crypt() not
found), which doesn't obviously point at
"install libcrypt-dev on the host".

Would a sanity-check addition (something along the lines of
./meta/classes-global/sanity.bbclass
testing for crypt.h / -lcrypt on the build host and emitting the same
hint as the docs) be welcome?
Happy to put a patch together if so.

Thanks for the review.


>
> > A previous attempt to fix this by adding libxcrypt-native to DEPENDS
> > unconditionally (commit 65532fc751 "shadow: add libxcrypt-native
> > dependency") was reverted in 54eccb76eb because it incorrectly pulled
> > a -native recipe into the target build. Use class-specific overrides
> > so the target build is unaffected and only shadow-native (and
> > nativesdk-shadow) gain the explicit dependency on libxcrypt-native /
> > nativesdk-libxcrypt.
> >
> > Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
>
>
> > ---
> >  meta/recipes-extended/shadow/shadow_4.19.4.bb | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/meta/recipes-extended/shadow/shadow_4.19.4.bb b/meta/recipes-extended/shadow/shadow_4.19.4.bb
> > index 94f155641c..cc69864a2a 100644
> > --- a/meta/recipes-extended/shadow/shadow_4.19.4.bb
> > +++ b/meta/recipes-extended/shadow/shadow_4.19.4.bb
> > @@ -9,6 +9,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=c9a450b7be84eac23e6353efecb60b5b \
> >                      "
> >
> >  DEPENDS = "virtual/crypt"
> > +DEPENDS:append:class-native = " libxcrypt-native"
> > +DEPENDS:append:class-nativesdk = " nativesdk-libxcrypt"
> >
> >  GITHUB_BASE_URI = "https://github.com/shadow-maint/shadow/releases"
> >  SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.gz \
>
>
> --
> Yoann Congal
> Smile ECS
>
Jose Quaresma May 7, 2026, 8:53 a.m. UTC | #3
Igor Opaniuk via lists.openembedded.org <igor.opaniuk=
foundries.io@lists.openembedded.org> escreveu (quinta, 7/05/2026 à(s)
08:13):

> Hi Yoann,
>
> On Wed, May 6, 2026 at 10:46 PM Yoann Congal <yoann.congal@smile.fr>
> wrote:
> >
> > On Wed May 6, 2026 at 9:45 PM CEST, Igor Opaniuk via
> lists.openembedded.org wrote:
> > > Configure fails with "crypt() not found" when building shadow-native on
> > > hosts where libcrypt is no longer part of glibc and the libxcrypt
> > > development files are not installed (e.g. fresh Ubuntu 24.04+, where
> > > glibc 2.39 dropped libcrypt and libxcrypt-dev is not pulled in by
> > > default).
> > >
> > > virtual/crypt-native is in ASSUME_PROVIDED (meta/conf/bitbake.conf),
> > > which is why a plain DEPENDS = "virtual/crypt" does not pull
> > > libxcrypt-native into the native sysroot - the host is expected to
> > > provide libcrypt. That assumption no longer holds on current
> > > distributions.
> >
> > Note that we added libcrypt-dev as a documented host dependency here:
> >
> https://git.yoctoproject.org/yocto-docs/commit/?id=2b41d175ea1924bf401a203fb678261fefb228dc
>
> Thanks, I missed that. With virtual/crypt-native in ASSUME_PROVIDED
> this is consistent with how OE-core treats other
> host-provided libraries. I'll drop the patch.
>
> One small follow-up if it's worth the time:
>
> the failure mode for users who miss the doc update is a configure
> error deep in shadow-native
> (checking for crypt in -lcrypt... no -> configure: error: crypt() not
> found), which doesn't obviously point at
> "install libcrypt-dev on the host".
>
> Would a sanity-check addition (something along the lines of
> ./meta/classes-global/sanity.bbclass
> testing for crypt.h / -lcrypt on the build host and emitting the same
> hint as the docs) be welcome?
>

I think that would be useful and help in interpreting the error. However,
there's nothing like that in sanity.bbclass.

Jose


> Happy to put a patch together if so.
>
> Thanks for the review.
>
>
> >
> > > A previous attempt to fix this by adding libxcrypt-native to DEPENDS
> > > unconditionally (commit 65532fc751 "shadow: add libxcrypt-native
> > > dependency") was reverted in 54eccb76eb because it incorrectly pulled
> > > a -native recipe into the target build. Use class-specific overrides
> > > so the target build is unaffected and only shadow-native (and
> > > nativesdk-shadow) gain the explicit dependency on libxcrypt-native /
> > > nativesdk-libxcrypt.
> > >
> > > Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> >
> >
> > > ---
> > >  meta/recipes-extended/shadow/shadow_4.19.4.bb | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/meta/recipes-extended/shadow/shadow_4.19.4.bb
> b/meta/recipes-extended/shadow/shadow_4.19.4.bb
> > > index 94f155641c..cc69864a2a 100644
> > > --- a/meta/recipes-extended/shadow/shadow_4.19.4.bb
> > > +++ b/meta/recipes-extended/shadow/shadow_4.19.4.bb
> > > @@ -9,6 +9,8 @@ LIC_FILES_CHKSUM =
> "file://COPYING;md5=c9a450b7be84eac23e6353efecb60b5b \
> > >                      "
> > >
> > >  DEPENDS = "virtual/crypt"
> > > +DEPENDS:append:class-native = " libxcrypt-native"
> > > +DEPENDS:append:class-nativesdk = " nativesdk-libxcrypt"
> > >
> > >  GITHUB_BASE_URI = "https://github.com/shadow-maint/shadow/releases"
> > >  SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.gz \
> >
> >
> > --
> > Yoann Congal
> > Smile ECS
> >
>
>
> --
> Best regards - Freundliche Grüsse - Meilleures salutations
>
> Igor Opaniuk
> Senior Software Engineer, Embedded & Security
> E: igor.opaniuk@foundries.io
> W: www.foundries.io
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#236565):
> https://lists.openembedded.org/g/openembedded-core/message/236565
> Mute This Topic: https://lists.openembedded.org/mt/119185904/5052612
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> quaresma.jose@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Yoann Congal May 7, 2026, 11:21 p.m. UTC | #4
Le jeu. 7 mai 2026 à 10:54, Jose Quaresma <quaresma.jose@gmail.com> a
écrit :

>
>
> Igor Opaniuk via lists.openembedded.org <igor.opaniuk=
> foundries.io@lists.openembedded.org> escreveu (quinta, 7/05/2026 à(s)
> 08:13):
>
>> Hi Yoann,
>>
>> On Wed, May 6, 2026 at 10:46 PM Yoann Congal <yoann.congal@smile.fr>
>> wrote:
>> >
>> > On Wed May 6, 2026 at 9:45 PM CEST, Igor Opaniuk via
>> lists.openembedded.org wrote:
>> > > Configure fails with "crypt() not found" when building shadow-native
>> on
>> > > hosts where libcrypt is no longer part of glibc and the libxcrypt
>> > > development files are not installed (e.g. fresh Ubuntu 24.04+, where
>> > > glibc 2.39 dropped libcrypt and libxcrypt-dev is not pulled in by
>> > > default).
>> > >
>> > > virtual/crypt-native is in ASSUME_PROVIDED (meta/conf/bitbake.conf),
>> > > which is why a plain DEPENDS = "virtual/crypt" does not pull
>> > > libxcrypt-native into the native sysroot - the host is expected to
>> > > provide libcrypt. That assumption no longer holds on current
>> > > distributions.
>> >
>> > Note that we added libcrypt-dev as a documented host dependency here:
>> >
>> https://git.yoctoproject.org/yocto-docs/commit/?id=2b41d175ea1924bf401a203fb678261fefb228dc
>>
>> Thanks, I missed that. With virtual/crypt-native in ASSUME_PROVIDED
>> this is consistent with how OE-core treats other
>> host-provided libraries. I'll drop the patch.
>>
>> One small follow-up if it's worth the time:
>>
>> the failure mode for users who miss the doc update is a configure
>> error deep in shadow-native
>> (checking for crypt in -lcrypt... no -> configure: error: crypt() not
>> found), which doesn't obviously point at
>> "install libcrypt-dev on the host".
>>
>> Would a sanity-check addition (something along the lines of
>> ./meta/classes-global/sanity.bbclass
>> testing for crypt.h / -lcrypt on the build host and emitting the same
>> hint as the docs) be welcome?
>>
>
> I think that would be useful and help in interpreting the error. However,
> there's nothing like that in sanity.bbclass.
>

I agree with the idea of a sanity check.
We do have a test for -lstdc++:
https://git.openembedded.org/openembedded-core/tree/meta/classes-global/sanity.bbclass#n835
That might be used as a starting point?

Thanks!


>
> Jose
>
>
>> Happy to put a patch together if so.
>>
>> Thanks for the review.
>>
>>
>> >
>> > > A previous attempt to fix this by adding libxcrypt-native to DEPENDS
>> > > unconditionally (commit 65532fc751 "shadow: add libxcrypt-native
>> > > dependency") was reverted in 54eccb76eb because it incorrectly pulled
>> > > a -native recipe into the target build. Use class-specific overrides
>> > > so the target build is unaffected and only shadow-native (and
>> > > nativesdk-shadow) gain the explicit dependency on libxcrypt-native /
>> > > nativesdk-libxcrypt.
>> > >
>> > > Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
>> >
>> >
>> > > ---
>> > >  meta/recipes-extended/shadow/shadow_4.19.4.bb | 2 ++
>> > >  1 file changed, 2 insertions(+)
>> > >
>> > > diff --git a/meta/recipes-extended/shadow/shadow_4.19.4.bb
>> b/meta/recipes-extended/shadow/shadow_4.19.4.bb
>> > > index 94f155641c..cc69864a2a 100644
>> > > --- a/meta/recipes-extended/shadow/shadow_4.19.4.bb
>> > > +++ b/meta/recipes-extended/shadow/shadow_4.19.4.bb
>> > > @@ -9,6 +9,8 @@ LIC_FILES_CHKSUM =
>> "file://COPYING;md5=c9a450b7be84eac23e6353efecb60b5b \
>> > >                      "
>> > >
>> > >  DEPENDS = "virtual/crypt"
>> > > +DEPENDS:append:class-native = " libxcrypt-native"
>> > > +DEPENDS:append:class-nativesdk = " nativesdk-libxcrypt"
>> > >
>> > >  GITHUB_BASE_URI = "https://github.com/shadow-maint/shadow/releases"
>> > >  SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.gz \
>> >
>> >
>> > --
>> > Yoann Congal
>> > Smile ECS
>> >
>>
>>
>> --
>> Best regards - Freundliche Grüsse - Meilleures salutations
>>
>> Igor Opaniuk
>> Senior Software Engineer, Embedded & Security
>> E: igor.opaniuk@foundries.io
>> W: www.foundries.io
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#236565):
>> https://lists.openembedded.org/g/openembedded-core/message/236565
>> Mute This Topic: https://lists.openembedded.org/mt/119185904/5052612
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
>> quaresma.jose@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>>
>
> --
> Best regards,
>
> José Quaresma
>
diff mbox series

Patch

diff --git a/meta/recipes-extended/shadow/shadow_4.19.4.bb b/meta/recipes-extended/shadow/shadow_4.19.4.bb
index 94f155641c..cc69864a2a 100644
--- a/meta/recipes-extended/shadow/shadow_4.19.4.bb
+++ b/meta/recipes-extended/shadow/shadow_4.19.4.bb
@@ -9,6 +9,8 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=c9a450b7be84eac23e6353efecb60b5b \
                     "
 
 DEPENDS = "virtual/crypt"
+DEPENDS:append:class-native = " libxcrypt-native"
+DEPENDS:append:class-nativesdk = " nativesdk-libxcrypt"
 
 GITHUB_BASE_URI = "https://github.com/shadow-maint/shadow/releases"
 SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.gz \