Snapcraft 7 refuses to build core18 snap?

Building Nextcloud (a base: core18 snap) appears to be failing, I assume due to the v7 release:

Sorry, an error occurred in Snapcraft:
module 'snapcraft' has no attribute 'sources'
Traceback (most recent call last):
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/snapcraft/", line 188, in run
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/craft_cli/", line 406, in run
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/snapcraft/commands/", line 82, in run, parsed_args)
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/snapcraft/parts/", line 135, in run
    yaml_data = process_yaml(snap_project.project_file)
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/snapcraft/parts/", line 86, in process_yaml
    yaml_data = yaml_utils.load(yaml_file)
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/snapcraft/parts/", line 92, in load
    raise errors.LegacyFallback("base is not core22")
snapcraft.errors.LegacyFallback: base is not core22

Did I miss something? Did v7 remove support for non-core22-based snaps, or is that a red herring?

Ah, red herring indeed-- it’s actually the fact that one of my local plugins uses snapcraft.sources. I’ll have to figure out what the alternative is in this new release.

The fix might be as simple as a search and replace from snapcraft to snapcraft_legacy in your custom plugin.

Thanks Kyle, I think we can treat this as regression indeed. You can update the import path or stick to 6 in the meantime.

1 Like

Thank you, @sergiusens. I don’t expect you to maintain APIs forever, but have these been deprecated? Should I be looking to move?

I rely on Nextcloud snap for both work and personal use. For me it is the single most important snap. Please lets help keep it running smoothly.

1 Like