← Back to issue list

Cannot create a snap with base:bare in destructive mode

View original Github issue

Metadata

Project
snapcraft
Number
#4972
Type
issue
State
open
Author
nhathaway
Labels
Status: Triaged Type: Bug
Created
2024-08-15 14:03:41+00:00
Updated
2025-05-27 21:37:02+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description RuntimeError: cannot determine build-for architecture in snapcraft.yaml, if you put in: ``` ... base: bare type: app ... architectures: - build-on: [amd64, arm64] build-for: [arm64] ... ``` It complains that you should use 'platforms' for the 'bare' base and not 'architectures'. ``` Bad snapcraft.yaml content: - 'architectures' keyword is not supported for base 'bare'. Use 'platforms' keyword instead. ``` If you substitute in 'platforms' for 'architectures': ``` platforms: arm64: build-on: [amd64, arm64] build-for: arm64 ``` you get the above runtime error. Looking at /snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/models/project.py, this error message is produced under core22 which is the base for snapcraft itself. But 'platforms' is for core24 and by implication, also for base:bare. ### To Reproduce snapcraft --destructive-mode ### Environment Building in a docker environment with just everything required to run the snapcraft executable. ``` SNAP=/snap/snapcraft/current SNAP_VERSION=8.3.2 SNAP_NAME=snapcraft SNAP_ARCH=arm64 PATH=$SNAP/usr/bin:$PATH ``` ### snapcraft.yaml ```shell name: my-name base: bare type: app version: '1.0' summary: My summary description: | My description. grade: devel # must be 'stable' to release into candidate/stable channels confinement: devmode # use 'strict' once you have the right plugs and slots platforms: arm64: build-on: [amd64, arm64] build-for: arm64 #architectures: # - build-on: [amd64, arm64] # build-for: [arm64] apps: my-app: command: bin/bash parts: snapcore: # See 'snapcraft plugins' plugin: dump source: mayapp.tar.gz source-type: tar ``` ### Relevant log output ```shell Traceback (most recent call last): File "/snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/application.py", line 351, in main return app.run() File "/snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/application.py", line 179, in run return_code = super().run() File "/snap/snapcraft/12379/lib/python3.10/site-packages/craft_application/application.py", line 492, in run dispatcher = self._get_dispatcher() File "/snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/application.py", line 298, in _get_dispatcher raise errors.ClassicFallback() snapcraft.errors.ClassicFallback During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/snap/snapcraft/current/bin/snapcraft", line 8, in <module> sys.exit(main()) File "/snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/application.py", line 354, in main return cli.run() File "/snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/cli.py", line 260, in run _run_dispatcher(dispatcher, global_args) File "/snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/cli.py", line 233, in _run_dispatcher dispatcher.run() File "/snap/snapcraft/12379/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/12379/lib/python3.10/site-packages/snapcraft/commands/core22/lifecycle.py", line 266, in run super().run(parsed_args) File "/snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/commands/core22/lifecycle.py", line 139, in run parts_lifecycle.run(self.name, parsed_args) File "/snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 108, in run _run_command( File "/snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 181, in _run_command target_arch=project.get_build_for(), File "/snap/snapcraft/12379/lib/python3.10/site-packages/snapcraft/models/project.py", line 971, in get_build_for raise RuntimeError("cannot determine build-for architecture") RuntimeError: cannot determine build-for architecture ``` ### Additional context $ ls /snap/ bin/ core22/ snapcraft/

Evaluation history

No evaluation history available.