Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: Dev

[PATCH vcs-snapshot] Use ${WORKDIR}/${P} rather than ${S} to support ${S} overrides.

 

 

Gentoo dev RSS feed   Index | Next | Previous | View Threaded


mgorny at gentoo

Jun 4, 2012, 2:59 AM

Post #1 of 8 (138 views)
Permalink
[PATCH vcs-snapshot] Use ${WORKDIR}/${P} rather than ${S} to support ${S} overrides.

One could set S to work on a subtree of the tarball rather than
the whole tarball. Considering that, it's probably better to use
${WORKDIR}/${P} rather than ${S}.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=419479
---
gx86/eclass/vcs-snapshot.eclass | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gx86/eclass/vcs-snapshot.eclass b/gx86/eclass/vcs-snapshot.eclass
index 6748360..23cd696 100644
--- a/gx86/eclass/vcs-snapshot.eclass
+++ b/gx86/eclass/vcs-snapshot.eclass
@@ -9,7 +9,8 @@
# @DESCRIPTION:
# This eclass provides a convenience src_unpack() which does support
# working with snapshots generated by various VCS-es. It unpacks those
-# to ${S} rather than the original directory containing commit id.
+# to ${WORKDIR}/${P} rather than the original directory containing
+# commit id.
#
# Note that this eclass handles only unpacking. You need to specify
# SRC_URI yourself, and call any autoreconfiguration as necessary.
@@ -41,5 +42,5 @@ vcs-snapshot_src_unpack() {

# github, bitbucket: username-projectname-hash
# gitweb: projectname-tagname-hash
- mv *-*-[0-9a-f]*[0-9a-f]/ "${S}" || die
+ mv *-*-[0-9a-f]*[0-9a-f]/ "${WORKDIR}"/${P} || die
}
--
1.7.10.2


hasufell at gentoo

Jun 4, 2012, 7:20 AM

Post #2 of 8 (133 views)
Permalink
Re: [PATCH vcs-snapshot] Use ${WORKDIR}/${P} rather than ${S} to support ${S} overrides. [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/04/2012 11:59 AM, Michał Górny wrote:
> One could set S to work on a subtree of the tarball rather than the
> whole tarball. Considering that, it's probably better to use
> ${WORKDIR}/${P} rather than ${S}.
>
> Fixes: https://bugs.gentoo.org/show_bug.cgi?id=419479 ---
> gx86/eclass/vcs-snapshot.eclass | 5 +++-- 1 file changed, 3
> insertions(+), 2 deletions(-)
>
> diff --git a/gx86/eclass/vcs-snapshot.eclass
> b/gx86/eclass/vcs-snapshot.eclass index 6748360..23cd696 100644 ---
> a/gx86/eclass/vcs-snapshot.eclass +++
> b/gx86/eclass/vcs-snapshot.eclass @@ -9,7 +9,8 @@ # @DESCRIPTION: #
> This eclass provides a convenience src_unpack() which does support
> # working with snapshots generated by various VCS-es. It unpacks
> those -# to ${S} rather than the original directory containing
> commit id. +# to ${WORKDIR}/${P} rather than the original directory
> containing +# commit id. # # Note that this eclass handles only
> unpacking. You need to specify # SRC_URI yourself, and call any
> autoreconfiguration as necessary. @@ -41,5 +42,5 @@
> vcs-snapshot_src_unpack() {
>
> # github, bitbucket: username-projectname-hash # gitweb:
> projectname-tagname-hash - mv *-*-[0-9a-f]*[0-9a-f]/ "${S}" || die
> + mv *-*-[0-9a-f]*[0-9a-f]/ "${WORKDIR}"/${P} || die }

Currently that eclass does not support multiple snapshot sources/tarballs.

I would suggest to fix that. My proposal currently breaks 6 ebuilds
which do not follow the newly described standard.

This way you could merge data and source snapshots from vcs.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPzMQSAAoJEFpvPKfnPDWzJdMH/AuhgbDeVdnJViP+zZNjsq4B
C2FlaPCpl3HHTrMi7HhbFmbOnZeLA3VLaffdvaPvZU0O1RxhOQPNfp4t8/E2iuHF
q9vVwQFQe19izFa7EgapD2EOUVUeaNMGoX0K2qRgtfLeBwnLWsnagMYZkV2+5skA
84vnyRYtaDEx6Z+M0UipwFnubrgmItbvX7F3XZ3omCdlSjXaRDO0sc2hqMFjeZ5P
ESGfbWxFX59ztmxBni0iSJE3NdSiYr1mjuW6eFZazIq9T6cinByXfMJgbdz7N14e
8HaSxMTc6PVWUTVbmpj3POWnZ+KCHbFze39rO5HzY4ZPMIL4xTxXAppg2FnyhF4=
=KUJi
-----END PGP SIGNATURE-----
Attachments: vcs-snapshot.eclass.diff (1.83 KB)
  vcs-snapshot.eclass (2.10 KB)


mgorny at gentoo

Jun 4, 2012, 8:50 AM

Post #3 of 8 (134 views)
Permalink
Re: [PATCH vcs-snapshot] Use ${WORKDIR}/${P} rather than ${S} to support ${S} overrides. [In reply to]

On Mon, 04 Jun 2012 16:20:02 +0200
hasufell <hasufell [at] gentoo> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 06/04/2012 11:59 AM, Michał Górny wrote:
> > One could set S to work on a subtree of the tarball rather than the
> > whole tarball. Considering that, it's probably better to use
> > ${WORKDIR}/${P} rather than ${S}.
> >
> > Fixes: https://bugs.gentoo.org/show_bug.cgi?id=419479 ---
> > gx86/eclass/vcs-snapshot.eclass | 5 +++-- 1 file changed, 3
> > insertions(+), 2 deletions(-)
> >
> > diff --git a/gx86/eclass/vcs-snapshot.eclass
> > b/gx86/eclass/vcs-snapshot.eclass index 6748360..23cd696 100644 ---
> > a/gx86/eclass/vcs-snapshot.eclass +++
> > b/gx86/eclass/vcs-snapshot.eclass @@ -9,7 +9,8 @@ # @DESCRIPTION: #
> > This eclass provides a convenience src_unpack() which does support
> > # working with snapshots generated by various VCS-es. It unpacks
> > those -# to ${S} rather than the original directory containing
> > commit id. +# to ${WORKDIR}/${P} rather than the original directory
> > containing +# commit id. # # Note that this eclass handles only
> > unpacking. You need to specify # SRC_URI yourself, and call any
> > autoreconfiguration as necessary. @@ -41,5 +42,5 @@
> > vcs-snapshot_src_unpack() {
> >
> > # github, bitbucket: username-projectname-hash # gitweb:
> > projectname-tagname-hash - mv *-*-[0-9a-f]*[0-9a-f]/ "${S}"
> > || die
> > + mv *-*-[0-9a-f]*[0-9a-f]/ "${WORKDIR}"/${P} || die }
>
> Currently that eclass does not support multiple snapshot
> sources/tarballs.

Use case?

--
Best regards,
Michał Górny
Attachments: signature.asc (0.31 KB)


hasufell at gentoo

Jun 4, 2012, 12:26 PM

Post #4 of 8 (133 views)
Permalink
Re: [PATCH vcs-snapshot] Use ${WORKDIR}/${P} rather than ${S} to support ${S} overrides. [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/04/2012 05:50 PM, Michał Górny wrote:
> On Mon, 04 Jun 2012 16:20:02 +0200 hasufell <hasufell [at] gentoo>
> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>
>> On 06/04/2012 11:59 AM, Michał Górny wrote:
>>> One could set S to work on a subtree of the tarball rather than
>>> the whole tarball. Considering that, it's probably better to
>>> use ${WORKDIR}/${P} rather than ${S}.
>>>
>>> Fixes: https://bugs.gentoo.org/show_bug.cgi?id=419479 ---
>>> gx86/eclass/vcs-snapshot.eclass | 5 +++-- 1 file changed, 3
>>> insertions(+), 2 deletions(-)
>>>
>>> diff --git a/gx86/eclass/vcs-snapshot.eclass
>>> b/gx86/eclass/vcs-snapshot.eclass index 6748360..23cd696 100644
>>> --- a/gx86/eclass/vcs-snapshot.eclass +++
>>> b/gx86/eclass/vcs-snapshot.eclass @@ -9,7 +9,8 @@ #
>>> @DESCRIPTION: # This eclass provides a convenience src_unpack()
>>> which does support # working with snapshots generated by
>>> various VCS-es. It unpacks those -# to ${S} rather than the
>>> original directory containing commit id. +# to ${WORKDIR}/${P}
>>> rather than the original directory containing +# commit id. # #
>>> Note that this eclass handles only unpacking. You need to
>>> specify # SRC_URI yourself, and call any autoreconfiguration as
>>> necessary. @@ -41,5 +42,5 @@ vcs-snapshot_src_unpack() {
>>>
>>> # github, bitbucket: username-projectname-hash # gitweb:
>>> projectname-tagname-hash - mv *-*-[0-9a-f]*[0-9a-f]/ "${S}" ||
>>> die + mv *-*-[0-9a-f]*[0-9a-f]/ "${WORKDIR}"/${P} || die }
>>
>> Currently that eclass does not support multiple snapshot
>> sources/tarballs.
>
> Use case?
>

ANY case where I need more than one tarball/source. There are just not
many because this eclass is widely unknown.

But minetest in sunrise for example which has two different repos, one
for the engine, one for the data. It's currently split in two, but I
guess I will merge those soon.

Lately there was an ebuild proposal in sunrise too which had that
issue, see here https://gist.github.com/2829184

It would also enable me to use gtk-youtube-viewer and youtube-viewer
in one ebuild with vcs-snapshot eclass while adding a gtk useflag
(currently split too).
Otherwise I will have to fix it on my own again.

I am pretty sure it will get more in the future when people start to
use this eclass or it will just prevent them from using it.

I find the logic very clear:

SRC="https://my/github/shit -> ${P}.tar.gz"
results in ${WORKDIR}/${P}
and
SRC="https://my/github/shit -> ${P}-src.tar.gz"
results in ${WORKDIR}/${P}-src
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPzQvIAAoJEFpvPKfnPDWzOikH/0R35jeWyWj1j7RNxQ9Rbpt6
JPSBmNx2ZOdFDF8jIqbOERwFwSe87mLitOrZafCxNL4eNZmhP4lXTcVny574CxuS
DE6k5n7k265eYzZm4A/1CjdKp4ptTzpGVil4/iVObFaz3B7tS5PCvqzySWc/ZO/7
040x2d4g94nqkcMM130ua970pbgO7MWZsVsBH3mnLE4AGCZY4vtRlH9dMOHbcAgG
46Vuu9/m4BfGadfGqNVTZz7KbxDBt5h3vOHZZe6JEf3smMr9GiK/gcIc4l97faN7
B601V8kIBWQhPENgeh+SZsMpx24E8DIMvLA7ltMLF8/WLULQBxzW3xR4/CxoNOk=
=aaKu
-----END PGP SIGNATURE-----


mgorny at gentoo

Jun 4, 2012, 1:06 PM

Post #5 of 8 (144 views)
Permalink
Re: [PATCH vcs-snapshot] Use ${WORKDIR}/${P} rather than ${S} to support ${S} overrides. [In reply to]

On Mon, 04 Jun 2012 21:26:00 +0200
hasufell <hasufell [at] gentoo> wrote:

> But minetest in sunrise for example which has two different repos, one
> for the engine, one for the data. It's currently split in two, but I
> guess I will merge those soon.

Why? Is there a good reason to merge two repos into one ebuild? Does
upstream guarantee that the releases will always be synced? Does it
benefit users?

> Lately there was an ebuild proposal in sunrise too which had that
> issue, see here https://gist.github.com/2829184

That's a more likely case. But still such a change would involve
changing an established API heavily which I really dislike.

> It would also enable me to use gtk-youtube-viewer and youtube-viewer
> in one ebuild with vcs-snapshot eclass while adding a gtk useflag
> (currently split too).
> Otherwise I will have to fix it on my own again.

Once again: does it benefit user? Or just does it imply that starting
or stopping to use gtk part requires user to rebuild the whole thing?

> I find the logic very clear:
>
> SRC="https://my/github/shit -> ${P}.tar.gz"
> results in ${WORKDIR}/${P}
> and
> SRC="https://my/github/shit -> ${P}-src.tar.gz"
> results in ${WORKDIR}/${P}-src

I really don't mind the logic. I'm just aware that it is a little late
to introduce such a destructive change, especially that you yourself
mentioned that it will break existing ebuilds.

I will be happy to implement it if you can get more approval for that
change. Or else we should consider jumping with the eclass to -r1 while
it isn't widespread too much.

--
Best regards,
Michał Górny
Attachments: signature.asc (0.31 KB)


hasufell at gentoo

Jun 4, 2012, 1:47 PM

Post #6 of 8 (142 views)
Permalink
Re: [PATCH vcs-snapshot] Use ${WORKDIR}/${P} rather than ${S} to support ${S} overrides. [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/04/2012 10:06 PM, Michał Górny wrote:
> On Mon, 04 Jun 2012 21:26:00 +0200 hasufell <hasufell [at] gentoo>
> wrote:
>
>> But minetest in sunrise for example which has two different
>> repos, one for the engine, one for the data. It's currently split
>> in two, but I guess I will merge those soon.
>
> Why? Is there a good reason to merge two repos into one ebuild?
> Does upstream guarantee that the releases will always be synced?
> Does it benefit users?

In this case yes. They are released with the exact same tags as you
can see in those ebuilds.

>
>> It would also enable me to use gtk-youtube-viewer and
>> youtube-viewer in one ebuild with vcs-snapshot eclass while
>> adding a gtk useflag (currently split too). Otherwise I will have
>> to fix it on my own again.
>
> Once again: does it benefit user? Or just does it imply that
> starting or stopping to use gtk part requires user to rebuild the
> whole thing?

Eclasses do not benefit any user. They benefit developers. I would
simply do similar stuff on my own in the ebuild instead of using
vcs-snapshot eclass then.

>
>> I find the logic very clear:
>>
>> SRC="https://my/github/shit -> ${P}.tar.gz" results in
>> ${WORKDIR}/${P} and SRC="https://my/github/shit ->
>> ${P}-src.tar.gz" results in ${WORKDIR}/${P}-src
>
> I really don't mind the logic. I'm just aware that it is a little
> late to introduce such a destructive change, especially that you
> yourself mentioned that it will break existing ebuilds.

So? We fix it.

>
> I will be happy to implement it if you can get more approval for
> that change. Or else we should consider jumping with the eclass to
> -r1 while it isn't widespread too much.
>

I don't see the point in bumping it, because it's not widespread.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPzR7lAAoJEFpvPKfnPDWz5W8H/0Je1mE/Vo7X+46TpuZZyi/3
RJaJMYETeQbbhPM6ACIXtHk629fGCz9Oda7J0YG4LMCYTbxU5MNElZSjbV4aThYD
MkSoQlSw/RIBuSEaffWRkAtbmNovHzd+nUyK8cHJTYXffi4CmClPXPPTqGAaRbC/
yJf6JBEfMLK/6ps10eMwf7D/m5ZJUYIPJ1m7DmlUqjpr8R8v2bVbjqB//M9ig7KO
yl/W5qzlBa2UAw/Gjgi0ITdDKs5sem7J8+PbVZKED5K0sD10YxZKMImCymJSlFkR
gzqZi99qdAs8uhZ1K6h8ozkBLglxkT54IZ8Kn3LWwiQ0/I2xRNgX8Ugt1EQnrQM=
=X+fU
-----END PGP SIGNATURE-----


mgorny at gentoo

Jun 5, 2012, 12:11 AM

Post #7 of 8 (137 views)
Permalink
Re: [PATCH vcs-snapshot] Use ${WORKDIR}/${P} rather than ${S} to support ${S} overrides. [In reply to]

On Mon, 04 Jun 2012 22:47:33 +0200
hasufell <hasufell [at] gentoo> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 06/04/2012 10:06 PM, Michał Górny wrote:
> > On Mon, 04 Jun 2012 21:26:00 +0200 hasufell <hasufell [at] gentoo>
> > wrote:
> >
> >> But minetest in sunrise for example which has two different
> >> repos, one for the engine, one for the data. It's currently split
> >> in two, but I guess I will merge those soon.
> >
> > Why? Is there a good reason to merge two repos into one ebuild?
> > Does upstream guarantee that the releases will always be synced?
> > Does it benefit users?
>
> In this case yes. They are released with the exact same tags as you
> can see in those ebuilds.

But could there be a case where fixing a build in the engine wouldn't
require data being rereleased? Or having the tag pointing to the same
commit it was pointing to previously?

If upstream splits a package, and supports building/installing the two
parts separately, we should do that as well.

> >> It would also enable me to use gtk-youtube-viewer and
> >> youtube-viewer in one ebuild with vcs-snapshot eclass while
> >> adding a gtk useflag (currently split too). Otherwise I will have
> >> to fix it on my own again.
> >
> > Once again: does it benefit user? Or just does it imply that
> > starting or stopping to use gtk part requires user to rebuild the
> > whole thing?
>
> Eclasses do not benefit any user. They benefit developers. I would
> simply do similar stuff on my own in the ebuild instead of using
> vcs-snapshot eclass then.

Does splitting the package benefit user? Gentoo has a long history of
overusing USE flags out of laziness. If upstream explicitly allows
building GTK+ part separately of core, we shouldn't merge that. We
should rather be grateful they don't force us to end up like Fedora,
splitting build tree into smaller packages.

> > I really don't mind the logic. I'm just aware that it is a little
> > late to introduce such a destructive change, especially that you
> > yourself mentioned that it will break existing ebuilds.
>
> So? We fix it.

As I see the purpose of vcs-snapshot, it is more likely to be used in
various overlays than in the gx86 tree. I don't believe you are able to
fix *all* the occurrences.

And while we're at it, changing eclass APIs doesn't benefit users nor
developers. It can cause breakages which will hurt users, and forces
developers to do more work when they don't have time to.

> > I will be happy to implement it if you can get more approval for
> > that change. Or else we should consider jumping with the eclass to
> > -r1 while it isn't widespread too much.
>
> I don't see the point in bumping it, because it's not widespread.

There are still more packages that it breaks than those which it would
actually benefit. But I like the idea of using filename for the
location. Could you look up PMS for me to see if it's guaranteed that
it will be preserved in $A?

--
Best regards,
Michał Górny
Attachments: signature.asc (0.31 KB)


hasufell at gentoo

Jun 5, 2012, 5:26 AM

Post #8 of 8 (131 views)
Permalink
Re: [PATCH vcs-snapshot] Use ${WORKDIR}/${P} rather than ${S} to support ${S} overrides. [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>

> But could there be a case where fixing a build in the engine
> wouldn't require data being rereleased? Or having the tag pointing
> to the same commit it was pointing to previously?
>
> If upstream splits a package, and supports building/installing the
> two parts separately, we should do that as well.

No. That is convenience for the minetest developer to have those
split. There is not much sense to have it split unless you don't want
to use the game and it adds further maintenance time for me.

It is also crucial to have the same version for both repos, cause
mixing engine and game-versions may lead to unexpected behavior. But I
don't understand how that discussion is related to this topic.

>
> Does splitting the package benefit user? Gentoo has a long history
> of overusing USE flags out of laziness. If upstream explicitly
> allows building GTK+ part separately of core, we shouldn't merge
> that. We should rather be grateful they don't force us to end up
> like Fedora, splitting build tree into smaller packages.

Please have a look at those packages. It makes perfectly sense to
introduce a gtk useflag since they use almost the same perl
core-script, but it is not necessary.
This way I could conditionally install one version, since upstream
syncs this core-script between both variants.

>
> As I see the purpose of vcs-snapshot, it is more likely to be used
> in various overlays than in the gx86 tree. I don't believe you are
> able to fix *all* the occurrences.

Alright, that may be true. I will have a look if it's possible to
enhance this without causing breakage for existing packages.

We may as well have this discussion later. As for your current
suggestion you have my ++
However the description stuff inside the eclass might need adjustment too.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPzfrbAAoJEFpvPKfnPDWzgAQH/1PdtK2RVRy8M43hW/s2v+wh
hRT3FZdEyFYmjMcOyNbzWlu0Y4DnFfbJIYbVWKrr892NQB4o+o4kaEpHmB0wX/gI
Igu1ojGkntpfH9NFFXvZDTSwcCLV6ZAtnfq/CAfl5Y100Xdnz64D3nhvse/kXUFH
6KYwUX7llsGGKFT3BU/w8i+PXecHDKNrqY48H3XnzTYxk92D6jMkXcSk6PXqVYJQ
C1Ug5mjWSBd4ZIPl3CIxxkVXQMFYOgRmM38/vztMNaAt7ypXVJL1sdmR4VHr7k2S
WnBtw+eKwTuYJb/M/vHfANhudIOtNOfvCQPZA9nmU5qKpgJ2/iyZAYnhN/WfAd4=
=965z
-----END PGP SIGNATURE-----

Gentoo dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.