Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: nelchael@g.o, Ulrich Mueller <ulm@g.o>
Subject: Re: [gentoo-dev] RFC: new feature to disable merging into stray locations
Date: Mon, 30 Apr 2012 09:45:18
Message-Id: 20120430114335.510fb26a@pomiocik.lan
In Reply to: Re: [gentoo-dev] RFC: new feature to disable merging into stray locations by Krzysztof Pawlik
1 On Mon, 30 Apr 2012 11:37:53 +0200
2 Krzysztof Pawlik <nelchael@g.o> wrote:
3
4 > On 30/04/12 11:28, Michał Górny wrote:
5 > > On Mon, 30 Apr 2012 10:23:03 +0200
6 > > Krzysztof Pawlik <nelchael@g.o> wrote:
7 > >
8 > >> On 30/04/12 10:12, Ulrich Mueller wrote:
9 > >>>>>>>> On Mon, 30 Apr 2012, Michał Górny wrote:
10 > >>>> Since lately Gentoo devs force you to replace collision-protect
11 > >>>> with protect-owned [1] and sometimes packages just spit out files
12 > >>>> randomly on the filesystem due to random errors, I thought it may
13 > >>>> be a good idea to provide a new feature limiting the locations
14 > >>>> where packages can install.
15 > >>>
16 > >>> If the eclass doesn't work with FEATURES="collision-protect" then
17 > >>> it needs to be fixed.
18 > >>
19 > >> Long story short: older eclass compiled Python byte code in live
20 > >> file system, new one does it in src_install so .pyo/.pyc gets
21 > >> properly recorded, so the package *has to overwrite* files that
22 > >> are not owned by anyone (no package owns them). I've talked to Zac
23 > >> and:
24 > >>
25 > >>>>>
26 > >> There's not much else you can do. However,
27 > >> FEATURES="protect-owned" is enabled by default, and it will work
28 > >> fine if the .pyo and .pyc files are not owned by anything. I don't
29 > >> know why people use FEATURES="collision-protect", but at least you
30 > >> can tell them that they'll still have a reasonable level of
31 > >> protection from FEATURES="protect-owned" (it protect against file
32 > >> collisions between packages).
33 > >> <<<
34 > >>
35 > >> If you want to help feel free to suggest *how* to fix it, patches
36 > >> are especially welcomed :)
37 > >
38 > > Just make it warn or something like that. Or even fail but only when
39 > > such files exist. There is no point in forcing me to disable
40 > > collision-protect when the ebuilds were migrated already.
41 >
42 > Does this work for you:
43 >
44 > $ cvs diff python-distutils-ng.eclass
45 > Index: python-distutils-ng.eclass
46 > ===================================================================
47 > RCS file: /var/cvsroot/gentoo-x86/eclass/python-distutils-ng.eclass,v
48 > retrieving revision 1.12
49 > diff -u -r1.12 python-distutils-ng.eclass
50 > --- python-distutils-ng.eclass 30 Apr 2012 08:25:31 -0000 1.12
51 > +++ python-distutils-ng.eclass 30 Apr 2012 09:36:48 -0000
52 > @@ -304,11 +304,10 @@
53 > # Phase function: pkg_pretend
54 > python-distutils-ng_pkg_pretend() {
55 > if has "collision-protect" ${FEATURES}; then
56 > - eerror "Due to previous eclass compiling Python files
57 > outside of src_install"
58 > - eerror "(and not recording resulting .pyc and .pyo
59 > files as owned by any package)"
60 > - eerror "merging this package with
61 > \"collision-protect\" in FEATURES will result"
62 > - eerror "in an error, please switch to using
63 > \"protect-owned\" instead."
64 > - die "\"collision-protect\" in FEATURES detected"
65 > + ewarn "Due to previous eclass compiling Python files
66 > outside of src_install"
67 > + ewarn "(and not recording resulting .pyc and .pyo
68 > files as owned by any package)"
69 > + ewarn "merging this package with
70 > \"collision-protect\" in FEATURES may result"
71 > + ewarn "in an error, please switch to using
72 > \"protect-owned\" instead."
73 > fi
74 > }
75 >
76 > (it's s/eerror/ewarn/ & die removal).
77
78 Yes, it will let me use the eclass at all.
79
80 > I'm still wondering how many people will read this warning when they
81 > hit collision error.
82
83 You can make it fatal if you detect collisions yourself but that's
84 repeating a lot of work.
85
86 --
87 Best regards,
88 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature