remote-build on Mac: NameError: name '_source_handler' is not defined

Bug #1876326 reported by Mathias R on 2020-05-01
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Chris Patterson

Bug Description

I'm working on Mac OS 10.13.6 and want to snap a python script. To build it for amd64 is not a problem but now I want to build it for armhf. So I tried it with remote-build:

snapcraft remote-build --build-on=armhf
All data sent to remote builders will be publicly available. Are you sure you want to continue? [y/N]: y
snapcraft remote-build is experimental and is subject to change - use with caution.
Sorry, an error occurred in Snapcraft:
name '_source_handler' is not defined
Traceback (most recent call last):
  File "/usr/local/bin/snapcraft", line 8, in <module>
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/click/", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/click/", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/click/", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/click/", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/click/", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/snapcraft/cli/", line 161, in remote_build
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/snapcraft/cli/", line 188, in _start_build
    repo_dir = wt.prepare_repository()
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/snapcraft/internal/remote_build/", line 322, in prepare_repository
    part_config = self._process_part_sources(part_name, part_config)
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/snapcraft/internal/remote_build/", line 241, in _process_part_sources
    part_config["source"] = self._pull_source(part_name, source)
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/snapcraft/internal/remote_build/", line 163, in _pull_source
    source_handler = self._get_part_source_handler(part_name, source, download_dir)
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/snapcraft/internal/remote_build/", line 93, in _get_part_source_handler
    source, source_type=source_type
  File "/usr/local/Cellar/snapcraft/3.11/libexec/lib/python3.7/site-packages/snapcraft/internal/sources/", line 170, in get_source_handler
    return _source_handler[source_type]
NameError: name '_source_handler' is not defined
We would appreciate it if you created a bug report at

Sergio Schvezov (sergiusens) wrote :

These code paths would need to be enabled for Mac

Changed in snapcraft:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Chris Patterson (cjp256)
tags: removed: python
Chris Patterson (cjp256) on 2020-05-04
Changed in snapcraft:
status: Triaged → In Progress
Chris Patterson (cjp256) wrote :

Hello Mathias, sorry about that! You may be our first user of remote-build on OSX :)

I've opened a PR which will address this issue.

I also borrowed a Macbook and gave it a quick test. Looks like it should be OK now!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers