snapcraft local source is not a directory
Metadata
Current evaluation
⚠️ This summary may be outdated — the issue content or evaluation prompts have changed since this evaluation was made.
Closed without resolution or comments. Premature validation of local source directories blocking inter-plugin dependencies remains unresolved.
Suggested action: —
No scores available.
Issue body
I have a plugin that needs to copy a file after that file is created by another plugin.
The 2nd (copy the file) plugin is defined as being 'after' the plugin that creates the file.
The problem is that when a run snapcraft prime it throws an error stating that the source directory used by the 2nd plugin doesn't exist.
Well of course it doesn't exists because it is going to be created by the 1st plugin.
It would seem to me that the directory validation needs to be delayed until the plugin is run to avoid these type of issues (unless it turns out I'm missing using the plugins).
The snapcraft causing the issue is attached.
The first plugin is pi-gation-webapp - creates the directory ./stage/war
The second plugin that generates the error is pi-gation-war - uses the directory ./stage/war
The generated error is:
snapcraft prime
Traceback (most recent call last):
File "/snap/snapcraft/1035/bin/snapcraft", line 11, in <module>
load_entry_point('snapcraft==2.38', 'console_scripts', 'snapcraft')()
File "/snap/snapcraft/1035/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 565, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/snap/snapcraft/1035/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
return ep.load()
File "/snap/snapcraft/1035/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2291, in load
return self.resolve()
File "/snap/snapcraft/1035/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2297, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/cli/__main__.py", line 19, in <module>
run(prog_name='snapcraft')
File "/snap/snapcraft/1035/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/snap/snapcraft/1035/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 111, in prime
_execute('prime', parts, **kwargs)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 33, in _execute
lifecycle.execute(command, project_options, parts)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_runner.py", line 61, in execute
config = project_loader.load_config(project_options)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/internal/project_loader/__init__.py", line 25, in load_config
return Config(project_options)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/internal/project_loader/_config.py", line 131, in __init__
snapcraft_yaml=self.snapcraft_yaml_path)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/internal/project_loader/_parts_config.py", line 56, in __init__
self._process_parts()
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/internal/project_loader/_parts_config.py", line 86, in _process_parts
self.load_part(part_name, plugin_name, properties)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/internal/project_loader/_parts_config.py", line 197, in load_part
confinement=self._confinement)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 88, in __init__
self._part_properties)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 124, in _get_source_handler
self._source, source_type=properties['source-type'])
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/internal/sources/__init__.py", line 161, in get_source_handler
source_type = _get_source_type_from_uri(source)
File "/snap/snapcraft/1035/lib/python3.6/site-packages/snapcraft/internal/sources/__init__.py", line 191, in _get_source_type_from_uri
raise ValueError('local source ({}) is not a directory'.format(source))
ValueError: local source (./stage/war/) is not a directory
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution or comments. Premature validation of local source directories blocking inter-plugin dependencies remains unresolved. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The report details a premature source directory validation error during snapcraft prime when a plugin depends on another plugin's output. No comments or fixes were applied. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution or discussion. No fix or merge details were provided, indicating the premature local source directory validation bug in snapcraft plugins was likely abandoned or marked invalid. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1660891 snapcraft-parser crashes when the origin-type is wrong | snapcraft (launchpad) | closed | Closed without comments or resolution. The parser crashed with a CalledProcessError when origin-type was incorrectly set to git for a local directory. Issue appears abandoned or fixed upstream. | |
| #1515132 Snapcraft crashes after defining a local source for a golang project | snapcraft (launchpad) | closed | Closed as fixed. The Go plugin was updated to handle local source paths, resolving the IndexError crash when the source field lacks a protocol. |