snapcraft
snapcraft copied to clipboard
Remote-build can fail if `--platform` or `--build-for` are passed
Bug Description
- If
--platformor--build-forare passed and the target is not in the build plan, snapcraft will fail - Snapcraft accepts
--platformfor remote building core22 snaps, which shouldn't be allowed
To Reproduce
snapcraft remote-build --launchpad-accept-public-upload --platform arm64 --verbosity verbose
Environment
snapcraft 8.2.12
snapcraft.yaml
name: test-snap
base: core22
version: "1.0"
summary: test snap
description: test snap
confinement: strict
parts:
my-part:
plugin: nil
Relevant log output
2024-06-27 07:38:50.651 Starting snapcraft, version 8.2.12
2024-06-27 07:38:50.651 Log verbosity level set to BRIEF
2024-06-27 07:38:50.651 Configuring application...
2024-06-27 07:38:50.651 Preparing application...
2024-06-27 07:38:50.652 Build plan: platform=arm64, build_for=None
2024-06-27 07:38:50.652 Loading project file '/tmp/bar/snapcraft.yaml'
2024-06-27 07:38:50.660 Platform 'arm64' not found in the project definition.
2024-06-27 07:38:50.660 Detailed information: Valid platforms are: amd64.
2024-06-27 07:38:50.660 Full execution log: '/home/developer/.local/state/snapcraft/log/snapcraft-20240627-073850.650481.log'
Additional context
Reported by @tomponline in https://chat.canonical.com/canonical/pl/um8c4px4qbdw9j498gzsu68itw
Thank you for reporting us your feedback!
The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3070.
This message was autogenerated
Scope of work:
- Ensure
--platformor--build-forare only allowed when there are noplatformorarchitecturedefinitions - Error if
--platformis used forcore22snaps