Snapcraft on macOS cannot find plugins

I have just installed snapcraft using brew.

% brew install snapcraft
% snapcraft --version
snapcraft, version 4.4.1

Snapcraft cannot find any plugins though.

% snapcraft snap --target-arch=arm64 --destructive-mode
Setting target machine to 'arm64'
Failed to load plugin: unknown plugin: 'nil'

This happens to any plugin I set on a part.

However it is listing the plugins from my base.

% snapcraft list-plugins                               
Displaying plugins available for 'core18'
ant        catkin-tools  conda    dump     godeps  kernel  meson   plainbox-provider  ruby   waf
autotools  cmake         crystal  flutter  gradle  make    nil     python             rust 
catkin     colcon        dotnet   go       kbuild  maven   nodejs  qmake              scons

Is snapcraft on macOS robust enough to be used?

Do we need to set a path or environment variable for this to work on a macOS?

This is the debug log I collected:

Loading plugin module 'nil' with sys.path ['/Users/me/development/snaps/pi-gadget/snap/plugins', '/usr/local/Cellar/snapcraft/4.4.1/libexec/bin', '/usr/local/Cellar/python@3.9/3.9.1_1/Frameworks/Python.framework/Versions/3.9/lib/', '/usr/local/Cellar/python@3.9/3.9.1_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9', '/usr/local/Cellar/python@3.9/3.9.1_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload', '/usr/local/Cellar/snapcraft/4.4.1/libexec/lib/python3.9/site-packages']
Sorry, an error occurred in Snapcraft:
Failed to load plugin: unknown plugin: 'nil'
Traceback (most recent call last):
  File "/usr/local/Cellar/snapcraft/4.4.1/libexec/lib/python3.9/site-packages/snapcraft/plugins/", line 102, in get_plugin_for_base
    return plugin_classes[plugin_name]
KeyError: 'nil'

First, destructive mode will be guaranteed to fail on macOS because it will be compiling on macOS and not Ubuntu. On macOS you MUST use either remote-build or multipass-based builds.

Second, specifying a target architecture doesn’t work unless you’re using the same architecture as your system or you are using remote-build. This is true on macOS as it is on Linux.

Yes, you are right. I wonder why it cannot find the local plugins though.

As far as I understood, the --target-arch would set the SNAPCRAFT_ARCH_TRIPLET and allow this to be used in cross-compilation setups.

It seems I will have to hardcode the targeted architecture when I use snapcraft with multipass.