canonical / snapcraft

Package, distribute, and update any app for Linux and IoT.
https://snapcraft.io
GNU General Public License v3.0
1.18k stars 440 forks source link

remote-build: legacy builder complains about the wrong part name #4365

Open mr-cal opened 12 months ago

mr-cal commented 12 months ago

Bug Description

The fallback remote-build behavior gives a misleading error for core22 snaps. It complains about the wrong part name failing validation.

To Reproduce

snapcraft remote-build

Environment

n/a

snapcraft.yaml

name: checkbox-mir
summary: Checkbox tests for the Mir project
description: |
  Collection of tests to be run on devices that are part of the mir project
version: git
confinement: strict
grade: stable

base: core22

parts:
  checkbox-provider-mir:
    plugin: nil

  mir_demo_server:
    plugin: nil

Relevant log output

snapcraft remote-build is experimental and is subject to change - use with caution.
All data sent to remote builders will be publicly available. Are you sure you want to continue? [y/N]: y
Issues while validating snapcraft.yaml: The 'parts' property does not match the required schema: 'checkbox-provider-mir' is not a valid part name. Part names consist of lower-case alphanumeric characters, hyphens and plus signs. As a special case, 'plugins' is also not a valid part name.

Additional context

source: https://chat.charmhub.io/charmhub/pl/ytut7oi78id35yoa5zi4xixwta

MirkoFerrati commented 12 months ago

@mr-cal I have a similar issue but not sure if a separate bug or this one.

mirko@G14:~/gazebo_snap$ snapcraft --verbose remote-build 
Starting Snapcraft 7.5.3                                                                                                                                                                                   
Logging execution to '/home/mirko/.local/state/snapcraft/log/snapcraft-20230918-122401.042060.log'                                                                                                         
snapcraft remote-build is experimental and is subject to change - use with caution.                                                                                                                        
All data sent to remote builders will be publicly available. Are you sure you want to continue? [y/N]: y
Issues while validating snapcraft.yaml: The 'apps/gz/extensions[0]' property does not match the required schema: 'ros2-humble/ros2-launch' is not one of ['flutter-stable', 'flutter-beta', 'flutter-dev', 'flutter-master', 'gnome', 'gnome-3-28', 'gnome-3-34', 'gnome-3-38', 'kde-neon', 'ros1-noetic', 'ros2-foxy']

Logs:

mirko@G14:~/gazebo_snap$ cat /home/mirko/.local/state/snapcraft/log/snapcraft-20230918-122401.042060.log
2023-09-18 12:24:01.042 Starting Snapcraft 7.5.3
2023-09-18 12:24:01.043 snapcraft remote-build is experimental and is subject to change - use with caution.
2023-09-18 12:24:01.044 Emitter: Pausing control of the terminal
2023-09-18 12:24:02.417 Emitter: Resuming control of the terminal
2023-09-18 12:24:02.459 core22 not yet supported in new code base: re-executing into legacy for remote-build

snapcraft: https://github.com/canonical/gazebo_snap/blob/fortress/snap/snapcraft.yaml (does not work with ros2-humble, nor ros2-humble/ros2-launch)

Code says that is always runs run_legacy with remote_build so anything that uses core22 should not work. Should it?

mr-cal commented 12 months ago

@MirkoFerrati,

Yes, this is a known issue with remote-build. A valid core22 snapcraft.yaml file may fail validation when the core20 remote-build code tries to parse it.

When #4323 is complete, this should no longer be an issue.

syncronize-issues-to-jira[bot] commented 3 weeks ago

Thank you for reporting us your feedback!

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

This message was autogenerated