canonical / canonical/craft-application

internal errors for `all` platform

Open
#692 1 comment 0 reactions 1 assignee Claimed by @lengau View on GitHub
Dominant language
Python
Stars
14
Forks
29
Avg merge
2d 3h
Merged PRs (30d)
12

Description

```yaml
name: testcraft
version: "0.1"

base: ubuntu@24.04
platforms:
all:

parts:
my-test:
plugin: nil
```

```bash
craft-application/testcraft> python3 ./__main__.py pack
testcraft internal error: 1 validation error for dict[literal['platforms'],dict[str,Platform]]
platforms.all
Input should be a valid dictionary or instance of Platform [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type
```

It's not surprising for a user to attempt to use `all` in `build-on`. Previously, Snapcraft would get to unmarshal the project and produce a user-friendly error like:
```
> snapcraft pack
Bad snapcraft.yaml content:
- 'all' cannot be used for 'build-on' (in field 'platforms')
```

Similar to #690

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.