[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    Re: [gentoo-dev] [PATCH] Add section about defining "Test Dependencies"
From:       Mike Gilbert <floppym () gentoo ! org>
Date:       2018-08-26 14:10:51
Message-ID: CAJ0EP406wK0iDaZoOyaCxzHrfGfbcmMRMGt2dWq1WbA2c3MVoQ () mail ! gmail ! com
[Download RAW message or body]

On Sun, Aug 26, 2018 at 3:28 AM Zac Medico <zmedico@gentoo.org> wrote:
>
> On 08/25/2018 07:11 PM, Andrew Savchenko wrote:
> > On Sat, 25 Aug 2018 14:24:02 -0400 Mike Gilbert wrote:
> >> On Sat, Aug 25, 2018 at 1:41 AM Andrew Savchenko <bircoph@gentoo.org> wrote:
> >>>
> >>> On Fri, 24 Aug 2018 14:24:06 -0400 Mike Gilbert wrote:
> >>>> ---
> >>>>  general-concepts/dependencies/text.xml | 38 ++++++++++++++++++++++++++
> >>>>  1 file changed, 38 insertions(+)
> >>>>
> >>>> diff --git a/general-concepts/dependencies/text.xml b/general-concepts/dependencies/text.xml
> >>>> index 2f10380..64be9dc 100644
> >>>> --- a/general-concepts/dependencies/text.xml
> >>>> +++ b/general-concepts/dependencies/text.xml
> >>>> @@ -578,6 +578,44 @@ valid.
> >>>>  </body>
> >>>>  </section>
> >>>>
> >>>> +<section>
> >>>> +<title>Test Dependencies</title>
> >>>> +<body>
> >>>> +
> >>>> +<p>
> >>>> +Packages often have optional dependencies that are needed only when running
> >>>> +tests. These should be specified in DEPEND behind a USE flag. Often, the
> >>>> +'test' USE flag is used for this purpose.
> >>>> +</p>
> >>>> +
> >>>> +<p>
> >>>> +Since testing will likely fail when test dependencies are not installed, the
> >>>> +test phase should be disabled in this case. This may be accomplished via USE
> >>>> +conditionals in the RESTRICT variable.
> >>>> +</p>
> >>>> +
> >>>> +<p>
> >>>> +If other optional features must be enabled/disabled when testing, REQUIRED_USE
> >>>> +may be set to express this.
> >>>> +</p>
> >>>> +
> >>>> +<codesample lang="ebuild">
> >>>> +# Define some USE flags
> >>>> +IUSE="debug test"
> >>>> +
> >>>> +# Disable test phase when test USE flag is disabled
> >>>> +RESTRICT="!test? ( test )"
> >>>
> >>> I do not understand why we need this useless code. If test USE flag
> >>> is disabled, tests must be disabled as well. It is PM's job and
> >>> there is no need to put this obvious stuff into each ebuild with
> >>> tests and extra deps. I see no reason to support running src_test()
> >>> with USE="-test".
> >>
> >> PMS does not specify that behavior (skipping src_test with USE=-test).
> >> It is better to define the requrement explicitly rather than relying
> >> on a Portage-specific behavior.
> >
> > Then PMS should be fixed. Putting useless code in thousands
> > of ebuilds due to bureaucratic reasons is ridiculous. Having strict
> > conformance to the PMS is good, but common sense should still be
> > considered.
>
> Since PMS doesn't specify the behavior of FEATURES, I suppose we could
> make FEATURES=test imply RESTRICT="!test? ( test )". Would there be any
> drawbacks to that?

I think that's a nice idea from a usability standpoint, at least while
most ebuilds in the tree do not set it explicitly.

I still think adding an explicit RESTRICT="!test? ( test )" to ebuilds
is a good idea though. My fear is that certain people would start
rejecting patches or reverting commits as "useless changes".

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic