Git source pull crashes if git not installed
Metadata
Current evaluation
Resolved by bundling Git with Snapcraft, removing the need for a system Git executable; the issue was closed after a maintainer confirmed the bundle.
Resolution: closed resolved
Reason: Closing maintainer @~mr-confirmed that Snapcraft now bundles Git. The current snap configuration exposes a bundled craft.git wrapper, confirming Git-source pulls no longer require host Git.
Evaluated by: mr-cal-bot
No scores available.
Issue body
If a part uses a git source and git is not installed on the system, FileNotFoundError is raised. This situation should be handled in a more graceful way.
Steps to reproduce: remove (or rename) the git executable from the system, and build a snap with a part that uses `source-type: git`.
```
Pulling gotty
Sorry, an error occurred in Snapcraft:
Traceback (most recent call last):
(...)
File "/home/claudio/snapcraft/cmatsuoka/snapcraft/internal/pluginhandler/__init__.py", line 460, in _do_pull
self.source_handler.pull()
File "/home/claudio/snapcraft/cmatsuoka/snapcraft/internal/sources/_git.py", line 184, in pull
self._clone_new()
File "/home/claudio/snapcraft/cmatsuoka/snapcraft/internal/sources/_git.py", line 172, in _clone_new
self._run(command + [self.source, self.source_dir], **self._call_kwargs)
File "/home/claudio/snapcraft/cmatsuoka/snapcraft/internal/sources/_base.py", line 87, in _run
subprocess.check_call(command, **kwargs)
File "/usr/lib/python3.6/subprocess.py", line 286, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python3.6/subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'git': 'git'
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Resolved by bundling Git with Snapcraft, removing the need for a system Git executable; the issue was closed after a maintainer confirmed the bundle. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed after Snapcraft began bundling Git, removing the missing-system-git failure from current releases. | |
| stealth/space-bunny-alpha | — | closed resolved | Missing Git is now handled gracefully during source pulls, preventing the unhandled FileNotFoundError reported. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed after implementing graceful error handling for missing git dependencies, preventing unhandled FileNotFoundError during snap builds with git sources. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
15
Confidence:
95
Support Request:
20
|
close stale | Crash when git is missing during source pull. Unresolved for over 7 years with no maintainer interaction or labels. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
15
Confidence:
95
Support Request:
5
|
close stale | Unhandled FileNotFoundError when building a snap with a git source part and git is missing. Issue is completely inactive for over 7 years and likely irrelevant to current Snapcraft versions. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
10
Confidence:
85
Support Request:
5
|
close stale | Reports a FileNotFoundError crash during snap builds when git is missing. The issue is 7 years old, unlabelled, and has zero maintainer engagement, indicating it is stale and likely obsolete due to significant project evolution. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1516228 missing " git://" in the source crashes the snapcraft | snapcraft (launchpad) | closed | Fixed in Snapcraft 0.5/master: a bare GitHub source no longer crashes and now reports "local source is not a directory" through pull-step handling (PR #448). | |
| #1614520 parser fails when getting git sources that have merge conflicts | snapcraft (launchpad) | closed | Fixed by snapcore/snapcraft#1052, merged as commit d22880fdc, making Git pulls more resilient to history changes and merge conflicts. | |
| #1663605 Local build fails due to missing build-dependency on git | snapcraft (launchpad) | closed | Fixed by PR snapcore/snapcraft#1137 (commit 8b3cb387d), adding git as a Debian build dependency so Git source tests run in sbuild. |