remote-build broken with shallow clones
Metadata
Current evaluation
Fixed in Snapcraft 8.0.1 by PR #4498 (commit 1e285148e), which falls back to the legacy remote builder for shallow Git clones on core20/core22.
Resolution: closed resolved
Reason: The shallow-clone remote-build failure was resolved by merged PR #4498 in commit 1e285148e. Snapcraft 8.0.1 release notes identify #4479 as fixed.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
Remote-build in snapcraft 8 doesn't work with shallow clones.
### To Reproduce
git clone https://github.com/telegramdesktop/tdesktop --depth=1
cd tdesktop
snapcraft remote-build
### Environment
n/a
### snapcraft.yaml
```shell
n/a
```
### Relevant log output
```shell
2023-12-05 08:58:34.873 Starting Snapcraft 8.0.0.post2+git662af4c0
2023-12-05 08:58:34.874 snapcraft remote-build is experimental and is subject to change - use with caution.
2023-12-05 08:58:34.874 Emitter: Pausing control of the terminal
2023-12-05 08:58:37.625 Emitter: Resuming control of the terminal
2023-12-05 08:58:37.683 Got base 'core22' from 'snap/snapcraft.yaml'
2023-12-05 08:58:37.683 Running new remote-build because environment variable 'SNAPCRAFT_REMOTE_BUILD_STRATEGY' is 'disable-fallback'
2023-12-05 08:58:37.683 Setting up launchpad environment
2023-12-05 08:58:37.706 Using project name 'telegram-desktop' from 'snap/snapcraft.yaml'
2023-12-05 08:58:37.947 Setting up launchpad environment.
2023-12-05 08:58:47.145 Looking for existing build
2023-12-05 08:58:47.291 No existing build found
2023-12-05 08:58:47.292 If interrupted, resume with: 'snapcraft remote-build --recover --build-idsnapcraft-telegram-desktop-7de9b03b32e10917bf39ab9b4cf15ad7'
2023-12-05 08:58:47.292 Starting build
2023-12-05 08:58:48.770 Cached project at /home/developer/.cache/snapcraft/remote-build/snapcraft-telegram-desktop-7de9b03b32e10917bf39ab9b4cf15ad7/repo
2023-12-05 08:58:48.912 creating git repo: name=snapcraft-telegram-desktop-7de9b03b32e10917bf39ab9b4cf15ad7, owner=/~mr-cal, target=/~mr-cal
2023-12-05 08:58:49.711 Sending build data to Launchpad: https://mr-cal:<token>@git.launchpad.net/~mr-cal/+git/snapcraft-telegram-desktop-7de9b03b32e10917bf39ab9b4cf15ad7/
2023-12-05 08:58:49.713 Resolved reference 'refs/heads/dev' for name 'HEAD'
2023-12-05 08:58:49.713 Pushing 'HEAD' to remote 'https://mr-cal:<token>@git.launchpad.net/~mr-cal/+git/snapcraft-telegram-desktop-7de9b03b32e10917bf39ab9b4cf15ad7/' with refspec 'refs/heads/dev:refs/heads/main'.
2023-12-05 08:58:58.136 Registering snap job on Launchpad...
2023-12-05 08:58:58.136 url=https://launchpad.net//~mr-cal/+snap/snapcraft-telegram-desktop-7de9b03b32e10917bf39ab9b4cf15ad7
2023-12-05 08:58:58.716 Issuing build request on Launchpad...
2023-12-05 08:58:59.512 Waiting on Launchpad build request...
2023-12-05 08:58:59.513 status=Pending error=None
2023-12-05 08:59:00.868 Removing snap job from Launchpad...
2023-12-05 08:59:01.458 Deleting source repository from Launchpad...
2023-12-05 08:59:02.002 remote-build error: Cannot find snapcraft.yaml in https://mr-cal@git.launchpad.net/~mr-cal/+git/snapcraft-telegram-desktop-7de9b03b32e10917bf39ab9b4cf15ad7/ main
2023-12-05 08:59:02.002 Full execution log: '/home/developer/.local/state/snapcraft/log/snapcraft-20231205-085834.873090.log'
```
### Additional context
_No response_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed in Snapcraft 8.0.1 by PR #4498 (commit 1e285148e), which falls back to the legacy remote builder for shallow Git clones on core20/core22. | |
| stealth/space-bunny-alpha | — | closed resolved | Remote-build now falls back to the legacy implementation for shallow Git clones on core20/core22; fixed by merged PR canonical/snapcraft#4498 (commit 1e285148e). | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in #4498 (commit 1e285148e), adding shallow-clone detection and a legacy remote-build fallback for core20/core22. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed via PR #4498. Snapcraft remote-build failed with shallow clones due to incorrect git reference resolution. The update corrects the push and branch mapping logic, restoring compatibility with shallow and standard repositories. | |
| qwen/qwen3.6-35b-a3b | — | — | Remote-build failed with shallow clones due to snapcraft.yaml detection issues. The bug was fixed via pull request #4498 and the issue closed. | |
| qwen/qwen3.6-35b-a3b | — | — | remote-build failed with shallow clones due to a missing snapcraft.yaml on Launchpad. The bug was fixed and the issue closed via pull request #4498. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Remote-build failed with shallow and full clones due to snapcraft.yaml detection issues. The bug was fixed and the issue closed via pull request #4498. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/snapcraft#4498
(confidence 100%)
Merged fix adding legacy remote-builder fallback for shallow Git repositories.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4498 fix(remote): fallback to legacy snapcraft if under shallow git clone | snapcraft | merged | Merged as 1e285148e: remote builds under shallow Git clones fall back to legacy Snapcraft on core20/core22; unsupported bases and devel report an error. | |
| #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. | |
| #5676 remote build: remove legacy remote builder | snapcraft | closed | Fixed in merged PR #5994 (commit b08f1a66e) for Snapcraft 9.0 by removing the legacy remote builder, selection logic, strategy env var, and legacy credential support. | |
| #4895 fix(remotebuild): require core20 snaps to use the legacy remote builder | snapcraft | merged | Merged in #4895 (d9c8781a1), requiring core20 remote builds to use the legacy builder because the new builder could not parse core20 snapcraft.yaml files; fixes #4886. | |
| #4144 remote build: legacy builder cannot parse core22 snapcraft.yaml syntax | snapcraft | closed | Marked won't fix: legacy-builder schema support was descoped in favor of the new remote builder, which accepts build-for; legacy support was removed by PR #5994 in Snapcraft 9. | |
| #2720 remote build: switch from core to core18 | snapcraft | merged | Merged PR #2720 switched remote builds from core to core18, aligning them with Snapcraft edge; landed as commit d2b36b2f4. | |
| #2006445 remote-build is not copying files from root of repository | snapcraft (launchpad) | closed | Closed as no longer reproducible with Snapcraft 9's new remote builder; the legacy builder was removed in snapcraft#5994, with no targeted copy fix recorded. | |
| #4365 remote-build: legacy builder complains about the wrong part name | snapcraft | closed | Core22 snaps hit a bogus schema error in the legacy remote-build fallback. Closed as "won't fix" by mr-cal on 2026-01-27; the legacy remote builder was removed in #5994 and #6010 for Snapcraft 9. | |
| #300 Remote-build: use craft-application for core22 | craft-application | closed | Core22 remote builds moved to craft-application in merged Snapcraft PR #4724 (commit 9905f2831), removing the legacy core22 build path. | |
| #1973199 Temporary repo for snapcraft remote-build has no git tags | snapcraft (launchpad) | closed | Fixed in Snapcraft 8.0.0's new remote builder; PR #4482 added tag pushing in commit 21f6ad788, preserving Git-tag-based versioning. |