snapcraft icon indicating copy to clipboard operation
snapcraft copied to clipboard

Remote-build can fail if `--platform` or `--build-for` are passed

Open mr-cal opened this issue 1 year ago • 2 comments

Bug Description

  1. If --platform or --build-for are passed and the target is not in the build plan, snapcraft will fail
  2. Snapcraft accepts --platform for 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

mr-cal avatar Jun 27 '24 13:06 mr-cal

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:

  1. Ensure --platform or --build-for are only allowed when there are no platform or architecture definitions
  2. Error if --platform is used for core22 snaps

mr-cal avatar Jul 01 '24 15:07 mr-cal