Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remote build: fails if --platform or --build-for are passed with no platforms or architectures defined #4881

Closed
mr-cal opened this issue Jun 27, 2024 · 2 comments · Fixed by #4994
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged

Comments

@mr-cal
Copy link
Collaborator

mr-cal commented Jun 27, 2024

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 mr-cal added the triaged label Jun 28, 2024
Copy link

Thank you for reporting us your feedback!

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

This message was autogenerated

@mr-cal
Copy link
Collaborator Author

mr-cal commented Jul 1, 2024

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 mr-cal added the bug Actual bad behavior that don't fall into maintenance or documentation label Aug 21, 2024
@mr-cal mr-cal changed the title Remote-build can fail if --platform or --build-for are passed remote build: fails if --platform or --build-for are passed with no platforms or architectures defined Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant