All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Yash.Shinde@windriver.com, openembedded-core@lists.openembedded.org
Cc: Randy.MacLeod@windriver.com, Sundeep.Kokkonda@windriver.com
Subject: Re: [OE-core] [PATCH] rust: Fix multiple rlib conflict when building with rust and libstd-rs
Date: Fri, 07 Feb 2025 07:54:04 +0000	[thread overview]
Message-ID: <f852cc146fcdd173f016d4542568908203a0be18.camel@linuxfoundation.org> (raw)
In-Reply-To: <20250206100419.2539364-1-Yash.Shinde@windriver.com>

On Thu, 2025-02-06 at 02:04 -0800, Yash Shinde via lists.openembedded.org wrote:
> From: Yash Shinde <Yash.Shinde@windriver.com>
> 
> When building an image with IMAGE_INSTALL:append = ' rust libstd-rs',
> a conflict arises due to multiple candidates for the rlib
> dependency `std`. This results in the following error:
> 
> error[E0464]: multiple candidates for `rlib` dependency `std` found
>   |
>   = note: candidate #1: /usr/lib/rustlib/x86_64-poky-linux-gnu/lib/libstd-20c3de2d9292cd03.rlib
>   = note: candidate #2: /usr/lib/rustlib/x86_64-poky-linux-gnu/lib/libstd.so
> 
> The issue seems to be from an extra copy of the rlib as both the recipes
> generate the same rlibs, causing conflicts when using std lib to compile
> rust programs in the image.
> 
> Remove the redundant rlib copy ensuring only the necessary rlib is
> present and prevent the conflict.
> 
> Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
> ---
>  meta/recipes-devtools/rust/rust_1.81.0.bb | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meta/recipes-devtools/rust/rust_1.81.0.bb b/meta/recipes-devtools/rust/rust_1.81.0.bb
> index 288b0fbb44..70c2f3fbf8 100644
> --- a/meta/recipes-devtools/rust/rust_1.81.0.bb
> +++ b/meta/recipes-devtools/rust/rust_1.81.0.bb
> @@ -272,6 +272,7 @@ rust_do_install:class-nativesdk() {
>      rm ${D}${libdir}/rustlib/install.log
>      rm ${D}${libdir}/rustlib/manifest*
>      rm ${D}${libdir}/rustlib/${RUST_HOST_SYS}/lib/libstd*.so
> +    rm ${D}${libdir}/rustlib/${RUST_HOST_SYS}/lib/libstd-*.rlib
>  
>      ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d
>      mkdir "${ENV_SETUP_DIR}"
> @@ -310,6 +311,7 @@ rust_do_install:class-target() {
>      rm ${D}${libdir}/rustlib/install.log
>      rm ${D}${libdir}/rustlib/manifest*
>      rm ${D}${libdir}/rustlib/${RUST_HOST_SYS}/lib/libstd*.so
> +    rm ${D}${libdir}/rustlib/${RUST_HOST_SYS}/lib/libstd-*.rlib
>  }
>  
>  addtask do_update_snapshot after do_patch

This seems to cause build failures, e.g:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/19/builds/962/steps/11/logs/stdio

"error[E0463]: can't find crate for `std`"

Cheers,

Richard


      reply	other threads:[~2025-02-07  7:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 10:04 [PATCH] rust: Fix multiple rlib conflict when building with rust and libstd-rs Yash.Shinde
2025-02-07  7:54 ` Richard Purdie [this message]

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=f852cc146fcdd173f016d4542568908203a0be18.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=Randy.MacLeod@windriver.com \
    --cc=Sundeep.Kokkonda@windriver.com \
    --cc=Yash.Shinde@windriver.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.