mishandled private git+ssh repo url

Bug #2008502 reported by Ondrej Kubik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Confirmed
High
Unassigned

Bug Description

when using a private git repository from Launchpad, snapcraft fails to fetch the repo content as it tries to convert url to the local path

name: test-snap
base: core22
parts:
  private-repo:
    plugin: dump
    source: git+ssh://git.launchpad.net/~my-team/me/+git/my-project
    source-type: git
    source-branch: main
    source-depth: 1
    prime:
      - -*

This example will result in the following error:
Failed to pull source: command ['git', 'clone', '--recursive', '--branch', 'upstream', '--depth', '1', 'file:///home/ubuntu/test-snap/git+ssh://git.launchpad.net/~my-team/me/+git/my-project', PosixPath('/home/ubuntu/host/test-snap/parts/private-repo/src')] exited with code 128.

snapcraft 7.2.8.post26+git15d684d5

Revision history for this message
Ondrej Kubik (ondrak) wrote :

Mind that "git+ssh://git.launchpad.net.." is what launchpad provides as url to be used for the private repositories.

So it is a bit unfortunate that Launchpad and snapcraft do not agree on a valid git URL format.

It is also a regression in behaviour from base: core20

Changed in snapcraft:
importance: Undecided → High
Revision history for this message
Claudio Matsuoka (cmatsuoka) wrote :

We need to update craft-parts in the kernel-plugin branch.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Can you try 7.3?

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

if this was the kernel branch, it has been rebased to 7.3 too (7.3.post1+git5d158298)

Changed in snapcraft:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Snapcraft because there has been no activity for 60 days.]

Changed in snapcraft:
status: Incomplete → Expired
Revision history for this message
Callahan Kovacs (mr-cal) wrote (last edit ):

See https://forum.snapcraft.io/t/core22-fails-for-git-urls/34565/8?u=mr_cal, where @cjwatson mentions that `git://` protocol is not supported by launchpad-buildd.

Perhaps snapcraft should provide a validation warning or linter warning that the `git://` protocol may not work when building on Launchpad?

Revision history for this message
Callahan Kovacs (mr-cal) wrote :

I'm marking this as confirmed but clarifying the scope of the bug.

The bug is that the `git://` protocol is supported by snapcraft and may work locally but will fail on Launchpad with an unhelpful error.

Changed in snapcraft:
status: Expired → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.