Local build fails due to missing build-dependency on git
Metadata
Current evaluation
Fixed by PR snapcore/snapcraft#1137 (commit 8b3cb387d), adding git as a Debian build dependency so Git source tests run in sbuild.
Resolution: closed resolved
Reason: PR #1137 added git to the package build dependencies and was merged as commit 8b3cb387d, resolving the missing git executable in local builds.
Evaluated by: mr-cal-bot
No scores available.
Issue body
I tried to build snapcraft master in a local sbuild instance, and it failed as follows:
======================================================================
ERROR: test_git_conflicts (snapcraft.tests.sources.test_git.TestGitConflicts)
snapcraft.tests.sources.test_git.TestGitConflicts.test_git_conflicts
----------------------------------------------------------------------
testtools.testresult.real._StringException: Empty attachments:
pythonlogging:''
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/snapcraft/tests/sources/test_git.py", line 229, in test_git_conflicts
self.call(['git', 'init', '--bare'])
File "/<<PKGBUILDDIR>>/snapcraft/tests/sources/test_git.py", line 184, in call
cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
File "/usr/lib/python3.5/subprocess.py", line 576, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python3.5/subprocess.py", line 557, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'git'
======================================================================
ERROR: test_git_submodules (snapcraft.tests.sources.test_git.TestGitConflicts)
snapcraft.tests.sources.test_git.TestGitConflicts.test_git_submodules
----------------------------------------------------------------------
testtools.testresult.real._StringException: Empty attachments:
pythonlogging:''
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/snapcraft/tests/sources/test_git.py", line 270, in test_git_submodules
self.call(['git', 'init', '--bare'])
File "/<<PKGBUILDDIR>>/snapcraft/tests/sources/test_git.py", line 184, in call
cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
File "/usr/lib/python3.5/subprocess.py", line 576, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python3.5/subprocess.py", line 557, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'git'
I don't know why this apparently hasn't caused problems elsewhere - perhaps git is being pulled in indirectly in some cases - but at any rate, since snapcraft is calling git directly in its test suite, it should build-depend directly on git as well.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by PR snapcore/snapcraft#1137 (commit 8b3cb387d), adding git as a Debian build dependency so Git source tests run in sbuild. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by PR snapcore/snapcraft#1137 (commit 8b3cb387d "packaging: build-depend on git."), adding git to debian/control Build-Depends so snapcraft.tests.sources.test_git can run under sbuild (LP #1663605). | |
| stealth/space-bunny-alpha | — | closed resolved | Local sbuild was fixed by merged PR #1137, adding git as a direct build dependency for source tests. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by adding git as a direct build dependency, resolving local sbuild failures where test execution failed due to missing git binaries. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without discussion. The missing git build dependency was likely added to resolve test failures, or the report was abandoned due to inactivity. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#1137
(confidence 100%)
The PR was linked in the issue comment and its commit is titled “packaging: build-depend on git.”
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1137 Build-depend on git | snapcraft | merged | Merged in canonical/snapcraft#1137 (commit 8b3cb387d), adding git as a direct build dependency so Git source tests can invoke git. | |
| #1802899 git package missing from build VM images | snapcraft (launchpad) | closed | Snapcraft began automatically adding git to build-packages for version: git, fixing builds on VMs without git; merged in snapcore/snapcraft#2403 as a5719521c. | |
| #1720202 the snapcore/snapcraft image doesn't have git installed | snapcraft (launchpad) | closed | Git was added to the Snapcraft build Dockerfile by merged PR snapcore/snapcraft#1575 (commit 8910ec250), enabling version: git. | |
| #4478 bug: remote-build broke in snapcraft 8.0 | snapcraft | closed | Fixed by PR #4482, merged as commit 6300e0ee2: remote-build pushes now use the Git CLI instead of libgit2, avoiding SSL broken-pipe failures. | |
| #4376 fix(snap): add missing build-packages for git | snapcraft | closed | Closed unmerged as superseded by PR #4393 (commit 5fbaab144), which built libgit2 from source for compatible pygit2 cross-architecture builds. | |
| #1828548 Git source pull crashes if git not installed | snapcraft (launchpad) | closed | Resolved by bundling Git with Snapcraft, removing the need for a system Git executable; the issue was closed after a maintainer confirmed the bundle. |