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

Josh Boyer jwboyer at fedoraproject.org
Mon Aug 3 14:10:08 UTC 2015


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.

> ======
> Syntax
> ======
> As we don't have any guidelines/syntax for VCS tag I'd propose:
> NOTE: Don't allow builds without optional mark in fedora
> - scm:git:git://github.com/foo/bar.git#commit
> #commit is optional for RPM itself, if it doesn't exist -- we will get
> package with version 0.0.1-1.DATEgitCOMMIT%{?dist}. Or something like
> this.
>
> I've inspired by syntax from Peter's erlang package in Fedora[3].
>
> =====
> Notes
> =====
> When I'm talking about git -- the same could be done for hg/cvs/svn/etc.

Even if koji did allow outside network access, I'm not sure we would
want to allow this for CVS.  It doesn't have the concept of tree-wide
commits and is generally terrible.

Ideally you'd want your VCS to specify an immutable commit, like a git
sha1 hash.  That way if you build foo-1.1 based on commit 1234567 in
August and someone builds the exact same package in January, they are
using the same source.  If you're using branch names or HEADs, then
those are movable and may result in different packages.

josh


More information about the Rpm-ecosystem mailing list