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/cli.py", line 188, in run
    dispatcher.run()
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/craft_cli/dispatcher.py", line 406, in run
    return self._loaded_command.run(self._parsed_command_args)
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 82, in run
    parts_lifecycle.run(self.name, parsed_args)
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 135, in run
    yaml_data = process_yaml(snap_project.project_file)
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 86, in process_yaml
    yaml_data = yaml_utils.load(yaml_file)
  File "/snap/snapcraft/7720/lib/python3.8/site-packages/snapcraft/parts/yaml_utils.py", 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