← Back to issue list

Packing with CRAFT_BUILD_ON can fail when installing registered snaps

View original Github issue

Metadata

Project
craft-application
Number
#1059
Type
issue
State
open
Author
tigarmo
Labels
Status: Triaged
Created
2026-04-10 17:28:42+00:00
Updated
2026-04-10 17:29:05+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description An example is this: an `amd64` host, `CRAFT_BUILD_ON=armhf` to pack an armhf package, and an application plugin that registers `astral-uv` as a snap to be installed in the instance. What happens then is that the application tries to inject at least `core24` (astral-uv's base) from the host, which fails because of the different architecture. I say "at least" because possibly the application would also try to inject the host astral-uv snap too, but it fails before that. ### To Reproduce . ### part yaml ```shell ``` ### Relevant log output ```shell 2026-04-09 16:51:15.765 2026-04-09 16:51:15.764 * Command standard error output: b'error: cannot install snap file: snap "core24" supported architectures (arm64)\n are incompatible with this system (armhf)\n' 2026-04-09 16:51:15.771 2026-04-09 16:51:15.771 Traceback (most recent call last): 2026-04-09 16:51:15.771 2026-04-09 16:51:15.771 File "/snap/mysnap/967/lib/python3.12/site-packages/craft_providers/actions/snap_installer.py", line 401, in inject_from_host 2026-04-09 16:51:15.771 2026-04-09 16:51:15.771 executor.execute_run( 2026-04-09 16:51:15.771 2026-04-09 16:51:15.771 File "/snap/mysnap/967/lib/python3.12/site-packages/craft_providers/lxd/lxd_instance.py", line 279, in execute_run 2026-04-09 16:51:15.771 2026-04-09 16:51:15.771 return self.lxc.exec( 2026-04-09 16:51:15.772 2026-04-09 16:51:15.771 ^^^^^^^^^^^^^^ 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 File "/snap/mysnap/967/lib/python3.12/site-packages/craft_providers/lxd/lxc.py", line 536, in exec 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 return runner(final_cmd, timeout=timeout, check=check, **kwargs) 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 File "/snap/mysnap/current/usr/lib/python3.12/subprocess.py", line 571, in run 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 raise CalledProcessError(retcode, process.args, 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 subprocess.CalledProcessError: Command '['lxc', '--project', 'mysnap', 'exec', 'local:mysnap-myproject-arm64-262639', '--', 'env', 'CRAFT_MANAGED_MODE=1', 'mysnap_DEBUG=False', 'mysnap_BUILD_ON=armhf', 'mysnap_LXD_REMOTE=local', 'mysnap_LAUNCHPAD_INSTANCE=production', 'https_proxy=http://10.145.198.242:8888', 'HTTPS_PROXY=http://10.145.198.242:8888', 'http_proxy=http://10.145.198.242:8888', 'HTTP_PROXY=http://10.145.198.242:8888', 'DEBIAN_FRONTEND=noninteractive', 'DEBCONF_NONINTERACTIVE_SEEN=true', 'DEBIAN_PRIORITY=critical', 'snap', 'install', '/tmp/core24.snap']' returned non-zero exit status 1. 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 The above exception was the direct cause of the following exception: 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 Traceback (most recent call last): 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 File "/snap/mysnapt/967/lib/python3.12/site-packages/craft_providers/base.py", line 696, in _install_snaps 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 snap_installer.inject_from_host( 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 File "/snap/mysnapt/967/lib/python3.12/site-packages/craft_providers/actions/snap_installer.py", line 365, in inject_from_host 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 inject_from_host(executor=executor, snap_name=host_snap_base, classic=False) 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 File "/snap/mysnapt/967/lib/python3.12/site-packages/craft_providers/actions/snap_installer.py", line 410, in inject_from_host 2026-04-09 16:51:15.772 2026-04-09 16:51:15.772 raise SnapInstallationError( 2026-04-09 16:51:15.773 2026-04-09 16:51:15.772 craft_providers.actions.snap_installer.SnapInstallationError: failed to install snap 'core24' ```

Evaluation history

No evaluation history available.