[gentoo-dev] Re: Remaining PMS todo list etc
Ciaran McCreesh wrote: On Thu, 20 Mar 2008 18:02:31 -0600 Ryan Hill <[EMAIL PROTECTED]> wrote: How about just checking EUID == 0 in src_test and skip the tests (with a ewarn message) if it doesn't match your needs? I thought I remembered someone raising a stink about checking permissions being a race condition because the condition can change between the checking and performing the action. Maybe that was only about write permissions... That's in cases like if [[ -w foo ]] ; then blah foo ; fi . Checking a variable that's constant for the phase is not racy. If checking EUID is an acceptable method, it should be relatively simple to write an eclass to handle the common cases and have ebuilds use that instead of checking $FEATURES (which i do think is a bug). Does it really need an eclass for something so simple? Considering the number of ebuilds that check FEATURES, disable tests altogether, or just do nothing and fail for half our users, against the number that do it correctly... apparently yeah. The simpler we make it to use, the more people will use it. On the other hand, it might be better to just document the common cases along with some example code in the Dev Guide. I'd be happy with doing that. -- fonts, gcc-porting, by design, by neglect mips, treecleaner,for a fact or just for effect wxwidgets @ gentoo EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662 signature.asc Description: OpenPGP digital signature
Re: [gentoo-dev] Re: Remaining PMS todo list etc
On Fri, 21 Mar 2008 12:47:37 +0100 Christian Faulhammer <[EMAIL PROTECTED]> wrote: > Great, I accept that it is wrong, but can you tell me how to actually > rewrite it? Test for capabilities (read/write) on files or is there a > sane way to tell? Uh, test the condition that you actually want to test... Under what exact circumstances will tests succeed or not succeed? -- Ciaran McCreesh signature.asc Description: PGP signature
[gentoo-dev] Re: Remaining PMS todo list etc
Hi, Ciaran McCreesh <[EMAIL PROTECTED]>: > On Thu, 20 Mar 2008 08:52:40 +0100 > Christian Faulhammer <[EMAIL PROTECTED]> wrote: > > if has userpriv ${FEATURES} && ! has usersandbox ${FEATURES};then > > make check-local || die "test suite failed" > > else > > ewarn "Activate FEATURES=userpriv and deactivate \ > > FEATURES=usersandbox to run testsuite." > > fi > > > > ^ That's mlocate, mysql also tests for FEATURES. > > Yeah, and that's a strong case for why we don't want FEATURES used in > ebuilds -- the ebuild is copying package manager internal logic that > has changed in the past and may well change in the future. Great, I accept that it is wrong, but can you tell me how to actually rewrite it? Test for capabilities (read/write) on files or is there a sane way to tell? V-Li -- Christian Faulhammer, Gentoo Lisp project http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode http://www.faulhammer.org/> signature.asc Description: PGP signature
Re: [gentoo-dev] Re: Remaining PMS todo list etc
On Thu, 20 Mar 2008 18:02:31 -0600 Ryan Hill <[EMAIL PROTECTED]> wrote: > > How about just checking EUID == 0 in src_test and skip the tests > > (with a ewarn message) if it doesn't match your needs? > > I thought I remembered someone raising a stink about checking > permissions being a race condition because the condition can change > between the checking and performing the action. Maybe that was only > about write permissions... That's in cases like if [[ -w foo ]] ; then blah foo ; fi . Checking a variable that's constant for the phase is not racy. > If checking EUID is an acceptable method, > it should be relatively simple to write an eclass to handle the > common cases and have ebuilds use that instead of checking $FEATURES > (which i do think is a bug). Does it really need an eclass for something so simple? -- Ciaran McCreesh signature.asc Description: PGP signature
[gentoo-dev] Re: Remaining PMS todo list etc
Marius Mauch wrote: On Wed, 19 Mar 2008 18:32:41 -0600 Ryan Hill <[EMAIL PROTECTED]> wrote: We seriously need a PM-independent way of saying "run the testsuite", "run the testsuite with user privledges", and "run the testsuite with root privledges if you can, otherwise forget it". Also required is the ability to make test failures non-fatal on a per-package basis, though this probably has nothing to do with the PMS. How about just checking EUID == 0 in src_test and skip the tests (with a ewarn message) if it doesn't match your needs? I thought I remembered someone raising a stink about checking permissions being a race condition because the condition can change between the checking and performing the action. Maybe that was only about write permissions... If checking EUID is an acceptable method, it should be relatively simple to write an eclass to handle the common cases and have ebuilds use that instead of checking $FEATURES (which i do think is a bug). -- fonts, gcc-porting, by design, by neglect mips, treecleaner,for a fact or just for effect wxwidgets @ gentoo EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662 signature.asc Description: OpenPGP digital signature
Re: [gentoo-dev] Re: Remaining PMS todo list etc
On Thu, 20 Mar 2008 08:52:40 +0100 Christian Faulhammer <[EMAIL PROTECTED]> wrote: > if has userpriv ${FEATURES} && ! has usersandbox ${FEATURES};then > make check-local || die "test suite failed" > else > ewarn "Activate FEATURES=userpriv and deactivate \ > FEATURES=usersandbox to run testsuite." > fi > > ^ That's mlocate, mysql also tests for FEATURES. Yeah, and that's a strong case for why we don't want FEATURES used in ebuilds -- the ebuild is copying package manager internal logic that has changed in the past and may well change in the future. -- Ciaran McCreesh signature.asc Description: PGP signature
[gentoo-dev] Re: Remaining PMS todo list etc
Hi, Ciaran McCreesh <[EMAIL PROTECTED]>: > On Wed, 19 Mar 2008 18:32:41 -0600 > Ryan Hill <[EMAIL PROTECTED]> wrote: > > > * 174335: Some ebuild use FEATURES. Can we get them to stop doing > > > that, or do we have to force package managers to emulate it? > > > > We seriously need a PM-independent way of saying "run the > > testsuite", "run the testsuite with user privledges", and "run the > > testsuite with root privledges if you can, otherwise forget it". > > Also required is the ability to make test failures non-fatal on a > > per-package basis, though this probably has nothing to do with the > > PMS. > > Sounds like you need to write your own src_test for these situations. if has userpriv ${FEATURES} && ! has usersandbox ${FEATURES};then make check-local || die "test suite failed" else ewarn "Activate FEATURES=userpriv and deactivate \ FEATURES=usersandbox to run testsuite." fi ^ That's mlocate, mysql also tests for FEATURES. V-Li -- Christian Faulhammer, Gentoo Lisp project http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode http://www.faulhammer.org/> signature.asc Description: PGP signature
Re: [gentoo-dev] Re: Remaining PMS todo list etc
On Wed, 19 Mar 2008 18:32:41 -0600 Ryan Hill <[EMAIL PROTECTED]> wrote: > > * 174335: Some ebuild use FEATURES. Can we get them to stop doing > > that, or do we have to force package managers to emulate it? > > We seriously need a PM-independent way of saying "run the testsuite", > "run the testsuite with user privledges", and "run the testsuite with > root privledges if you can, otherwise forget it". Also required is > the ability to make test failures non-fatal on a per-package basis, > though this probably has nothing to do with the PMS. Sounds like you need to write your own src_test for these situations. -- Ciaran McCreesh signature.asc Description: PGP signature
Re: [gentoo-dev] Re: Remaining PMS todo list etc
On Wed, 19 Mar 2008 18:32:41 -0600 Ryan Hill <[EMAIL PROTECTED]> wrote: > Ciaran McCreesh wrote: > > There's an updated, pre-built copy of current PMS at: > > > > http://dev.gentoo.org/~spb/pms.pdf > > Thanks for keeping up with this. > > > * 174335: Some ebuild use FEATURES. Can we get them to stop doing > > that, or do we have to force package managers to emulate it? > > We seriously need a PM-independent way of saying "run the testsuite", > "run the testsuite with user privledges", and "run the testsuite with > root privledges if you can, otherwise forget it". Also required is > the ability to make test failures non-fatal on a per-package basis, > though this probably has nothing to do with the PMS. How about just checking EUID == 0 in src_test and skip the tests (with a ewarn message) if it doesn't match your needs? Marius -- Public Key at http://www.genone.de/info/gpg-key.pub In the beginning, there was nothing. And God said, 'Let there be Light.' And there was still nothing, but you could see a bit better. signature.asc Description: PGP signature
[gentoo-dev] Re: Remaining PMS todo list etc
Ciaran McCreesh wrote: There's an updated, pre-built copy of current PMS at: http://dev.gentoo.org/~spb/pms.pdf Thanks for keeping up with this. * 174335: Some ebuild use FEATURES. Can we get them to stop doing that, or do we have to force package managers to emulate it? We seriously need a PM-independent way of saying "run the testsuite", "run the testsuite with user privledges", and "run the testsuite with root privledges if you can, otherwise forget it". Also required is the ability to make test failures non-fatal on a per-package basis, though this probably has nothing to do with the PMS. -- fonts, gcc-porting, by design, by neglect mips, treecleaner,for a fact or just for effect wxwidgets @ gentoo EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662 signature.asc Description: OpenPGP digital signature