Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy aarch64 artifacts to rootfs fails #14

Open
tinu73 opened this issue Sep 17, 2024 · 5 comments
Open

deploy aarch64 artifacts to rootfs fails #14

tinu73 opened this issue Sep 17, 2024 · 5 comments

Comments

@tinu73
Copy link

tinu73 commented Sep 17, 2024

Hi Jeremy,

Your solution to compile a dotnet c# application from source with a bitbake recipe works very well. But working with aarch64 and adding the dotnet-hello-world application to the image, it fails because of DNF check during rootfs generation. This is also described here: Dependency for binary package. However this is not an issue with x86_64.

Ok, there is an "ugly" workaround hack for this, to add the recipe artifacts after rootfs generation to the rootfs, but actually i just wanted to call out if you have already dealed with this and if you know a better solution?

Your answer is very much appreciated.

@unitexe
Copy link

unitexe commented Jan 20, 2025

Curious about this one as well...

  • Distro: poky
  • Machine: qemuarm64
  • Image: core-image-base

I am getting this build error during do_rootfs task when including the bundled dotnet-hello-world application (dotnet 5) in the image. Same thing happens when I try using a dotnet8 hello world application.

ERROR: core-image-base-1.0-r0 do_rootfs: Could not invoke dnf. Command '/build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0/rootfs/etc/yum.repos.d --installroot=/build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0/rootfs --setopt=logdir=/build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0/temp --repofrompath=oe-repo,/build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0/oe-rootfs-repo --nogpgcheck install dotnet-hello-world lttng-ust lttng-ust-dev packagegroup-base-extended packagegroup-core-boot psplash run-postinsts locale-base-c locale-base-en-us locale-base-en-gb' returned 1:
DNF version: 4.19.0
cachedir: /build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0/rootfs/var/cache/dnf
Added oe-repo repo from /build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0/oe-rootfs-repo
User-Agent: falling back to 'libdnf': could not detect OS or basearch
repo: using cache for: oe-repo
oe-repo: using metadata from Sun 19 Jan 2025 11:28:28 PM UTC.
Last metadata expiration check: 0:00:01 ago on Sun 19 Jan 2025 11:28:30 PM UTC.
--> Starting dependency resolution
--> Finished dependency resolution
Error: 
 Problem: conflicting requests
  - nothing provides liblttng-ust.so.0()(64bit) needed by dotnet-hello-world-git-r0.cortexa57 from oe-repo
(try to add '--skip-broken' to skip uninstallable packages)

ERROR: Logfile of failure stored in: /build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0/temp/log.do_rootfs.2014832
ERROR: Task (/build/../work/layers/poky/meta/recipes-core/images/core-image-base.bb:do_rootfs) failed with exit code '1'

@unitexe
Copy link

unitexe commented Jan 20, 2025

Was able to craft another hack that is maybe (?) little better than adding packages after rootfs generation. I don't totally understand what is going on here but...

Create a .bbappend for dotnet-hello-world recipe and add the following to it:

DEPENDS:append = " patchelf-native"

do_configure:append() {
    # Hack to fix liblttng-ust dependency issues
    # Hack based on https://github.com/RDunkley/meta-dotnet-core/commit/f55cb200787d7bb33cbf471b86977fc64b9a43cd
    # Must be removed if the liblttng-ust library issue is fixed
    # Path determined by searching for libcoreclrtraceptprovider.so in build directory after experiencing failed do_rootfs
    # Put this in do_configure:append because the last step in do_configure in dotnet is to do dotnet restore, this needs to happen after
    patchelf --remove-needed liblttng-ust.so.0 ${WORKDIR}/.nuget/packages/microsoft.netcore.app.runtime.linux-arm64/8.0.7/runtimes/linux-arm64/native/libcoreclrtraceptprovider.so
}

# Without this there is runtime error: "Couldn't find a valid ICU package installed on the system"
RDEPENDS:${PN}:append = " icu"

@jeremy-prater
Copy link
Owner

I am slightly confused, we deploy C# targeting aarch64 (imx8) daily. Your host build machine is x86_64 and you're targeting aarch64?

@unitexe
Copy link

unitexe commented Jan 20, 2025

Yup, my host build machine is x86_64 and I am targeting qemuarm64 machine in this example.

Edit:

Build Configuration:
BB_VERSION           = "2.8.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-poky-linux"
MACHINE              = "qemuarm64"
DISTRO               = "poky"
DISTRO_VERSION       = "5.0.6"
TUNE_FEATURES        = "aarch64 crc cortexa57"
TARGET_FPU           = ""
meta-dotnet          = "trunk:98d5ce191d23388076298a5e4148a426cd939be8"
meta-unit-apps       = "main:706f5a11a1e29e9b80dd5e284c21997adbd92595"
meta                 
meta-poky            
meta-yocto-bsp       = "scarthgap:7117d115eab7351ecf21388ec720a3bb5f4a9b30"

@unitexe
Copy link

unitexe commented Jan 20, 2025

I have an imx8 board laying around, I will see if I can get dotnet-hello-world recipe to work with it without using bbappend above and report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants