[RFC] RPM VCS tag. Building from VCS tag/branch/commit

Vít Ondruch vondruch at redhat.com
Mon Aug 3 15:47:47 UTC 2015


Dne 3.8.2015 v 16:10 Josh Boyer napsal(a):
> On Mon, Aug 3, 2015 at 9:50 AM, Igor Gnatenko
> <ignatenkobrain at fedoraproject.org> wrote:
>> Hi folks,
>>
>> Since 2010 we have defined VCS tag in RPM, but we're not using it
>> actually. No guidelines for it, nothing other. Just tag.
>>
>> ============
>> Introduction
>> ============
>> Currently we are using "Source0" for "%setup" and related macroes. All
>> mesa builds in Fedora are done from git (master and other stable
>> branches) + some patches. Kernel also built on top of upstream git
>> tree (tags or master) + patches (from ML, backported or fedora
>> specific). Many of packages comes from github built from git tags.
> The kernel isn't built from git.  It's built from tarballs and patches.
>
>> =======
>> Problem
>> =======
>> Now we need to have fork of upstream repo, commit our patches, rebase
>> on top of needed branch/tag, do git format-patch, add those patches to
>> fedora repo and to spec file. If we're building from git -- git should
>> have webUI for downloading snapshot or we should make tarballs via
>> script. Apply patches if needed and etc. It all takes time and
>> knowledge.
>>
>> In case if we want to build package from git we should follow naming
>> guidelines[0], and the same. Do archive, patches, etc.
>>
>> ========
>> Proposal
>> ========
>> With having something like below we can simplify maintaining RPMs.
>> VCS: git://github.com/foo/bar.git#commit_or_tag
>> which will add all do we need in naming and archiving instead of
>> Source0: https://github.com/foo/bar/archive/commit_or_tag/%{name}-%{shortcommit}.tar.gz
>> and some RPM macro playing around commits and in case of
>> non-github/bitbucket/etc. to have shell scripts like my[1].
>>
>> Probably we'd want to add some logic for picking up patches from that
>> repo. For example, I had to backport 10+ patches from upstream in
>> beignet[2]. Here I don't have ideas - allow commit sha in PatchX tags
>> if VCS defined? Have new tags?
>>
>> Sure, usage of VCS tag is optional. You still can use Source0 instead of VCS.
>>
>> rpm-side: if VCS specified -- clone, checkout, make git archive and
>> use generated archive as source to use/unpack
>>
>> dist-git-side: we wil upload rpm-generated source
> I'm not really sure I'm following your proposal at all.  If it is to
> allow the Fedora buildsystem to clone a specified repo during RPM
> build for a package, I don't believe that will work.  Koji doesn't
> allow outside network access during builds.

Actually, I can see this more useful for fedpkg. E.g.:

VCS: git://github.com/foo/bar.git#%{shortcommit}
Source0: %{name}-%{shortcommit}.tar.gz


Later, you could call:

$ fedpkg sources

or something similar (sources is actually in use, not sure if that could
cover this scenario or we would need different command), which would
prepare the archive for you. From here, you can continue as you always did.


Vít


More information about the devel mailing list