On 08/26/2018 01:08 AM, Michał Górny wrote:
> On Sun, 2018-08-26 at 00:58 -0700, Zac Medico wrote:
>> On 08/26/2018 12:39 AM, Michał Górny wrote:
>>> On Sun, 2018-08-26 at 00:28 -0700, Zac Medico 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 <birc...@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?
>>>
>>> Except for Portage once again silently letting developers pass with non-
>>> PMS behavior, and making other PMs fail with the ebuilds?
>>
>> Is it really sane for other PMs to behave that way though?
>>
>> In PMS it says src_test "may be disabled by user too, using a
>> PM-specific mechanism", which doesn't explicitly rule out behavior based
>> on USE settings.
> 
> It doesn't rule out disabling based on the phase of the moon either, or
> my mood which is degrading badly with this discussion.

Well, using package.use for this doesn't really make sense within the
context of ebuilds that don't have IUSE=test, which is an argument for
people to use package.env as a consistent means to selectively disable
unit tests.
-- 
Thanks,
Zac

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to