← Back to issue list

"snapcraft init" doesn't generate a valid template

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1575581
Type
issue
State
closed
Author
~seb128
Labels
verification-done
Created
Updated
Closed

Current evaluation

Fixed by PR ubuntu-core/snapcraft#528 and released in Snapcraft 2.10 for Xenial; verification confirmed `snapcraft init` followed by `snapcraft` produced a valid snap.

Resolution: closed resolved

Reason: The missing template content was fixed by PR ubuntu-core/snapcraft#528 and released in Snapcraft 2.10, then verified in 2.10.1 on an up-to-date Xenial system.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Using snapcraft 2.8.4 in xenial Getting a source and doing "snapcraft init", editing the snapcraft.yaml to file the info required and doig "snapcraft build" leads to an error "'parts' is a required property" ... if that's required the default template should include it or at least a comment saying "you need to add a parts section, see documentation on ..." [Impact] * It's hard for a user to get started. * The init template will contain more info, and will be snapcraft-able. [Test Case] * Run snapcraft init * Run snapcraft * Verify that you get a valid snap. [Regression Potential] * The only risk would be that the error message is worse than before. We added a test to check that there is no error message anymore.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by PR ubuntu-core/snapcraft#528 and released in Snapcraft 2.10 for Xenial; verification confirmed `snapcraft init` followed by `snapcraft` produced a valid snap.
stealth/space-bunny-alpha — closed resolved Fixed by ubuntu-core/snapcraft PR #528 and released in snapcraft 2.10; Xenial verification confirmed that snapcraft init followed by snapcraft produced a valid snap.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR snapcraft#528 (commit 9fef57189), which added placeholder metadata plus a default part to the 'snapcraft init' template. Shipped in snapcraft 2.10 (xenial-proposed) and released in 2.10.1; verified by ~elopio (LP: #1575581).
stealth/space-bunny-alpha — closed resolved Merged canonical/snapcraft#528 (9fef57189) added placeholder metadata and a default part to the init template, making snapcraft init generate a valid snapcraft.yaml and resolving LP #1575581.
qwen/qwen3.6-35b-a3b — — Fixed by updating the snapcraft init template to include the required parts section and a documentation comment. The fix was verified, closed, and validated with a regression test ensuring the generated template builds successfully.
qwen/qwen3.6-35b-a3b — — Fixed by updating the snapcraft init template to include the required parts section, ensuring generated snaps build successfully. Verified and closed.

Update history

Date Change
created

Related work

  • Likely Fixed By: ubuntu-core/snapcraft#528 (confidence 100%)

    The linked pull request was cited as the fix, and the packaged change was verified successfully.

Related issues

Issue Project State Summary Similarity
#1990550 snapcraft init creates boilerplate which opaquely fails to build by default snapcraft (launchpad) closed Resolved by changing `snapcraft init` boilerplate from core20 to core22; the reporter confirmed the fix on 2023-06-01.
72%
#1536860 'snapcraft init' template contains vendor snapcraft (launchpad) closed Closed as fixed: linked ubuntu-core/snapcraft PR #251 (canonical/snapcraft#251), merged as commit ffc8b0526, removing the obsolete 'vendor' entry from the 'snapcraft init' template and noting the icon is optional.
72%
#1604326 snapcraft init doesn't fail if there is a .snapcraft.yaml file snapcraft (launchpad) closed Fixed by merged snapcraft#669 (commit 2cd727259): snapcraft init now detects an existing .snapcraft.yaml and fails instead of creating snapcraft.yaml.
72%
#1803776 snapcraft init missing a base snapcraft (launchpad) closed Fixed by merged snapcore/snapcraft PR #2411, making snapcraft init generate projects with a base and link the relevant syntax documentation.
72%
#1567041 snapcraft init creates icon entry snapcraft (launchpad) closed Fixed by merged ubuntu-core/snapcraft#433 (commit af86cddce): snapcraft init no longer generates an icon entry.
71%
#1604504 'snapcraft init' examples are not style compliant snapcraft (launchpad) closed Fix released: snapcraft init now generates snapcraft.yaml with two-space indentation. PR snapcore/snapcraft#682 addressed the style bug; additional fields and links were deferred.
71%