canonical / craft-parts

https://canonical-craft-parts.readthedocs-hosted.com
GNU Lesser General Public License v3.0
11 stars 37 forks source link

"Architecture not supported" error in a armhf container on arm64 host #655

Open Saviq opened 9 months ago

Saviq commented 9 months ago

Bug Description

Snapcraft assumes the kernel architecture is the userspace architecture.

craft_parts.errors.InvalidArchitecture: Architecture 'armv8l' is not supported.
Make sure the architecture name is correct.

To Reproduce

On e.g. a Raspberry Pi:

$ lxc launch jammy/armhf jammy-armhf
$ lxc shell jammy-armhf
$ snapcraft

### part yaml

_No response_

### Relevant log output

```shell
$ snapcraft --verbose --destructive-mode                     
Starting Snapcraft 8.0.2                                                                                                                                                               
Logging execution to '/root/.local/state/snapcraft/log/snapcraft-20240208-122038.888225.log'                                                                                          
Running on armhf for armhf                                                                                                                                                            T
raceback (most recent call last):                                                          
  File "/snap/snapcraft/10428/bin/snapcraft", line 8, in <module>     
    sys.exit(run())                                                                        
  File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/cli.py", line 258, in run
    _run_dispatcher(dispatcher, global_args)                                               
  File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/cli.py", line 230, in _run_dispatcher
    dispatcher.run()                                                                       
  File "/snap/snapcraft/10428/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 487, in run
    return self._loaded_command.run(self._parsed_command_args)        
  File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/commands/lifecycle.py", line 265, in run
    super().run(parsed_args)                                                               
  File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/commands/lifecycle.py", line 138, in run
    parts_lifecycle.run(self.name, parsed_args)                       
  File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 97, in run
    _expand_environment(                                                                   
  File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 616, in _expand_environment
    info = craft_parts.ProjectInfo(                                                        
  File "/snap/snapcraft/10428/lib/python3.10/site-packages/craft_parts/infos.py", line 97, in __init__
    self._set_machine(arch)                                                                
  File "/snap/snapcraft/10428/lib/python3.10/site-packages/craft_parts/infos.py", line 310, in _set_machine
    raise errors.InvalidArchitecture(self._host_arch)                       
craft_parts.errors.InvalidArchitecture: Architecture 'armv8l' is not supported.
Make sure the architecture name is correct.
syncronize-issues-to-jira[bot] commented 6 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2947.

This message was autogenerated