#730 guidelines for gitlab source tag are wrong
Closed: fixed Opened by loveshack.

$ grep Source0 ../SPECS/guile-git.spec
Source0: https://gitlab.com/guile-git/%{name}/repository/archive.tar.gz?ref=%{commit}#/%{name}-%{shortcommit}.tar.gz
The recipe for the spec setup using a Source tag for a gitlab snapshot in the Packaging:Source guidelines is wrong.
https://fedoraproject.org/wiki/Packaging:SourceURL#Commit_Revision says to use
%autosetup -n %{name}.git
but that's not what the tarball contains:

$ spectool -g -S ../SPECS/guile-git.spec
Getting https://gitlab.com/guile-git/guile-git/repository/archive.tar.gz?ref=eaa5ed2583136119189842c24835fadc7dd2ab8d#/guile-git-eaa5ed2.tar.gz to ./guile-git-eaa5ed2.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 89324 100 89324 0 0 102k 0 --:--:-- --:--:-- --:--:-- 102k
[vagrant@localhost SOURCES]$ tar ft guile-git-eaa5ed2.tar.gz | head -1
guile-git-eaa5ed2583136119189842c24835fadc7dd2ab8d-eaa5ed2583136119189842c24835fadc7dd2ab8d/

What it is creating is obviously strange.

I couldn't immediately find any doc for this at gitlab.com (but I couldn't find the equivalent at github either). It might be worth pointing to where they document this.

Incidentally, I had trouble finding the info on the wiki. I think I used to be able to find this easily by a search on the main packaging guidelines page, though I can't remember what I looked for.


xref https://gitlab.com/gitlab-org/gitlab-ce/issues/38830

So these services like to change around their internals and occasionally that breaks.

What we need is for someone to tell us what these services want for us to use. Alternately, the separate effort to replace this all with some macro magic could move forward to the point where the guidelines themselves don't need to be explicit.

Metadata Update from @tibbs:
- Issue tagged with: draftneeded

I've been using this for tags on gitlab, since the hackery with # is no longer needed:

URL:            https://gitlab.com/OWNER/PROJECT
Source0:        %{url}/-/archive/TAG/%{name}-%{version}.tar.gz
(...)
%prep
%autosetup                        # if PROJECT == %{name}
%autosetup -n PROJECT-%{version}  # otherwise

For commits, this works:

URL:            https://gitlab.com/OWNER/PROJECT
Source0:        %{url}/-/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
(...)
%prep
%autosetup -n %{name}-%{commit}  # if PROJECT == %{name}
%autosetup -n PROJECT-%{commit}  # otherwise

The guidelines should be updated to reflect this change to how GitLab URLs work.

@decathorpe could you just fix it? ;)

Sure, I'll just fix it later today if that's alright ;)

Metadata Update from @decathorpe:
- Issue assigned to decathorpe

I've gone ahead and fixed the Source URL and %setup invocations for the new way GitLab produces tarballs:

https://fedoraproject.org/w/index.php?title=Packaging%3ASourceURL&type=revision&diff=523477&oldid=523390

I don't know anything about git submodules, so that section might still have to be updated as well.

Metadata Update from @decathorpe:
- Issue untagged with: draftneeded
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

After discussing it at today's FPC meeting, we decided to completely remove the section about the handling of git submodules, since it's a niche use-case and the section can be brought back in an up-to-date version if there's a need for "best practice" examples.

Metadata