← Back to issue list

remote-build broken with shallow clones

View original Github issue

Metadata

Project
snapcraft
Number
#4479
Type
issue
State
closed
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

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
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.
qwen3.6-35b-a3b-mtp-q6 Fixed via PR #4498. The remote-build command failed to locate snapcraft.yaml with shallow or full git clones. The pull request corrected the git reference handling, resolving the issue.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#4498 fix(remote): fallback to legacy snapcraft if under shallow git clone snapcraft merged Merged a fix falling back to legacy remote builds for shallow git clones, which cannot be pushed by design. Supports only core20 and core22 bases. Approved by two reviewers, passed CI, and modified 8 files.
77%