-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Investigate] support foreign architectures #104
Comments
Here's the script that Ondrej uses to configure the lxd instance (to then run Snapcraft in destructive mode inside it): https://github.com/kubiko/toolbox/blob/20/glue/bin/snapcraft-lxd-wrapper |
Looks like ubuntu-daily images for noble changed the default sources: instead of the regular file
|
Dilyn mentioned today that this snapcraft project is a good one to use when evaluating a fix: https://github.com/canonical/iot-field-kernel-snap/tree/24-riscv64-nezha |
Thank you for reporting us your feedback! The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3316.
|
What needs to get done
PR #96 restricted the calls to
dpkg --add-architecture
to only "compatible" pairs of architectures. This suits a lot of use cases, particularly those that just need to download (but not install) packages from a non-host arch.Where this breaks is effective cross-compilation; any non-trivial cross-compilation case will require dependencies in the target architecture (like dev versions of shared libraries), and the common idiom of:
does not work because the installation of libxx-dev:arch fails, because the target arch there has not been added to the system via
dpkg --add-architecture
.As #96 explains, the reason we can't just call
dpkg --add-architeture non-host-arch
is because the official archives list all archs (even those they don't have packages for) and default Apt installations do not restrict the archs in those archives. See/etc/apt/sources.list
on my machine:... so
apt update
will try to fetch the packages listing for "non-host-arch" from archive.ubuntu.com and fail.What we need to investigate/prototype is a different strategy: if a package-repo with a non-host arch is added (e.g. adding an
armhf
repo in anamd64
host), we must calldpkg --add-architecture armhf
(or whatever arch), but we must also fixthose sources listings that don't "pin" the arch. In the example above, the new line would read:
Here's a series of steps that users are currently doing in host installations to support this scenario:
... of course, that script only fixes a single file and doesn't do any verification of pre-existing architectures, so the actual commands need to be improved, but the general idea is this.
Why it needs to get done
To make the build system more robust and improve support for cross-compilation.
The text was updated successfully, but these errors were encountered: