1 |
Dnia 2013-08-27, o godz. 10:33:27 |
2 |
Ian Stakenvicius <axs@g.o> napisał(a): |
3 |
|
4 |
> -----BEGIN PGP SIGNED MESSAGE----- |
5 |
> Hash: SHA256 |
6 |
> |
7 |
> On 27/08/13 06:01 AM, Michał Górny wrote: |
8 |
> > Hello, all. |
9 |
> > |
10 |
> > As the next item for discussion in EAPI 6 I'd like to raise the |
11 |
> > idea of introducing src_fetch() phase for fetching live sources. |
12 |
> > |
13 |
> > First of all, I'd like to emphasize that the additional phase |
14 |
> > function will not make live ebuilds any more welcome than they are |
15 |
> > now. They will still be discouraged, and subject to masking as |
16 |
> > usual. However, the function will improve the experience of users |
17 |
> > using them. |
18 |
> > |
19 |
> > The major goal is to add a src_fetch() phase that could be called |
20 |
> > earlier during the ebuild process (e.g. within a parallel fetching |
21 |
> > process) or in a 'emerge --fetchonly' or similar call. |
22 |
> > |
23 |
> > I will sum up the issues that came up already. However, feel free |
24 |
> > to point out any more questions if you have some. |
25 |
> > |
26 |
> |
27 |
> 0. Why src_fetch() instead of pkg_fetch() ? Technically this would |
28 |
> be running based on the package and may not even need to touch ${S} if |
29 |
> the implementation just handles getting the sources to a state where a |
30 |
> src_unpack() can copy them over. Being a pkg_* would also keep it out |
31 |
> of the standbox (as i believe convention is that all src_* are |
32 |
> supposed to be sandboxed, correct??) |
33 |
|
34 |
I don't see why a binary package would need to fetch from VCS :). |
35 |
|
36 |
Aside that, sandbox and other portage features can be controlled per |
37 |
EAPI and per phase. |
38 |
|
39 |
> > 1. How should we state fetch dependencies? |
40 |
> > |
41 |
> > Most of live ebuilds would need a dependency on the VCS they're |
42 |
> > using. Currently, those dependencies are part of DEPEND. However, |
43 |
> > if src_fetch() is done early or out-of-process, it will no longer |
44 |
> > be good enough for us. |
45 |
> > |
46 |
> > I see two major directions here: |
47 |
> > |
48 |
> > a) explicitly stating fetch dependencies (as FDEPEND or using |
49 |
> > magical USE flag thingie in DEPEND). Then, those dependencies would |
50 |
> > be pulled in earlier than other DEPENDs and installed before |
51 |
> > src_fetch() is called. |
52 |
> > |
53 |
> > I think this will require more work on Zac's side. Also, should we |
54 |
> > then install VCS-es during 'emerge --fetchonly'? |
55 |
> > |
56 |
> |
57 |
> This could be handled via support from the PM, too. IE, if you want |
58 |
> to be able to install git-based live ebuilds either install git by |
59 |
> hand or have USE="git" enabled on portage/paludis/etc. |
60 |
|
61 |
And the boundary between package manager and repo becomes blurry once |
62 |
again. Please don't make eclasses for new VCS require update to portage |
63 |
and vice versa. |
64 |
|
65 |
> Either way, it does make sense to have the fetcher (and by extension, |
66 |
> possibly also the unarchiver??) as a separate dependency type instead |
67 |
> of being in DEPEND, since these would technically be packages that the |
68 |
> PM itself needs now to do its thing rather than the software package. |
69 |
|
70 |
What does having unpacker there technically give you? The only reason |
71 |
for fetcher would be because fetch would be done much earlier than |
72 |
unpack. Do you expect portage to unpack something and then go merge |
73 |
remaining build-time deps? ;f |
74 |
|
75 |
> > 2. Should src_unpack() be disallowed from fetching VCS sources? |
76 |
> > |
77 |
> > If we introduce src_fetch() in EAPI 6, then we should probably |
78 |
> > expect all the live eclasses to use that rather than src_unpack() |
79 |
> > for fetching. If we agree on this, we can extend portage's |
80 |
> > network-sandbox to this phase, and likely filesystem sandbox as |
81 |
> > well. |
82 |
> > |
83 |
> |
84 |
> The portage network-sandbox feature is going to have to act in an |
85 |
> EAPI-specific way -- ie, there's still plenty of EAPI5 and lower |
86 |
> ebuilds that will inherit say, git-2.eclass and therefore that eclass |
87 |
> will still need to support doing its bits in src_unpack. |
88 |
|
89 |
Yep, there's no problem with implementing that. |
90 |
|
91 |
> > 3. Is everyone ok with splitting VCS fetch into fetch+unpack? |
92 |
> > |
93 |
> > That is, the new design would be like: |
94 |
> > |
95 |
> > - src_fetch() fetches the updates from remote server to DISTDIR, |
96 |
> > |
97 |
> > - src_unpack() does the checkout from DISTDIR to S. |
98 |
> > |
99 |
> > I suspect that some live ebuilds may prefer different kind of |
100 |
> > operation but this split seems quite reasonable. |
101 |
> |
102 |
> This implementation makes a lot of sense to me. In terms of the |
103 |
> specific implementation, I assume both src_fetch and src_unpack be |
104 |
> imeplemented in i.e. git-2.eclass? Or would there be an accompanying |
105 |
> change to the default src_unpack behaviour to, say, '[[ -z $A ]] && cp |
106 |
> - -r ${VCSDIR} ${S}' for EAPI6 ? |
107 |
|
108 |
It will be implemented completely in eclass. There's no reason to make |
109 |
EAPI more complex, especially that we can't really assume what VCS will |
110 |
do. And not every live ebuild will actually use VCS. |
111 |
|
112 |
-- |
113 |
Best regards, |
114 |
Michał Górny |