Bug 1729216

Summary: failed to build from dist-git using "git" protocol
Product: [Internal] Red Hat Internal Copr Reporter: Martin Pavlásek <mpavlase>
Component: backendAssignee: Copr Team <copr-team>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: praiskup
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-11 16:25:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Pavlásek 2019-07-11 15:29:19 UTC
Description of problem:
I couldn't build a package with dist-git source using 'git' protocol. As workaround I tried to switch to "https" protocol and it works.

Failed:
git://pkgs.devel.redhat.com/rpms/python-django-mptt

Working:
http://pkgs.devel.redhat.com/cgit/rpms/python-django-mptt


Discovered by this build:
https://copr.devel.redhat.com/coprs/eng-program-dev/pp-testing/build/38763/

Version-Release number of selected component (if applicable):


How reproducible:
1/1

Fragment from build log:

Generated rpkg config:
[rpkg]
preprocess_spec = True
# auto-packing is deprecated:
auto_pack = True

[git]
lookaside = git://pkgs.devel.redhat.com/repo/pkgs/%(ns1)s/%(name)s/%(filename)s/%(hashtype)s/%(hash)s/%(filename)s
anongiturl = git://pkgs.devel.redhat.com/%(module)s

Writing config into /tmp/tmpsoikufo_/.config/rpkg.conf
Running: rpkg srpm --outdir /var/lib/copr-rpmbuild/results3kv0lz7m --spec /tmp/tmpsoikufo_/python-django-mptt

cmd: ['rpkg', 'srpm', '--outdir', '/var/lib/copr-rpmbuild/results3kv0lz7m', '--spec', '/tmp/tmpsoikufo_/python-django-mptt']
cwd: /tmp/tmpsoikufo_/python-django-mptt
rc: 0
stdout: Downloading django-mptt-0.9.0.tar.gz from lookaside cache at pkgs.devel.redhat.com
stderr: (1, 'Protocol "git" not supported or disabled in libcurl')



Expected results:


Additional info:

Comment 1 Pavel Raiskup 2019-07-12 08:56:13 UTC
Ok, I though this is trivial to configure - but it's not.  Red Hat dist-git isn't
clean enough to support only one lookaside cache download pattern.  We have the
old one for e.g. RHEL 7, using md5:

    %(name)s/%(filename)s/%(hash)s/%(filename)s
    
and the new one for e.g. RHEL 8, using:

    %(name)s/%(filename)s/%(hashtype)s/%(hash)s/%(filename)s

I can configure only one of those, not both without additional ugly patching.
Which one do you think is more valid for your use-case?

In Fedora dist-git - when they were migrating to new format -
all the old sources were hard-linked to support even the newer pattern.  So
while staying compatible with old pattern, everyone can use calmly the new
pattern.

I for some time plan to implement better approach for dist-git builds, but
I'm still not there -- https://pagure.io/copr/copr/issue/529

Couldn't you work-around this problem by the approach from the following bug?
https://bugzilla.redhat.com/show_bug.cgi?id=1652669

Comment 2 Martin Pavlásek 2019-07-12 12:53:53 UTC
For our purpose I'm currently interested in RHEL7, but I'm fine with workaround, that you pointed me.

Comment 3 Pavel Raiskup 2020-12-11 16:25:08 UTC
This is now fixed.  But we also have the direct dist-git support which
makes things much easier:
https://docs.pagure.org/copr.copr/release-notes/2020-11-13.html#simplified-builds-from-distgit