Skip Menu |

This queue is for tickets about the Tree-DAG_Node CPAN distribution.

Report information
The Basics
Id: 112568
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Tree-DAG_Node

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.27
Fixed in: (no value)



Subject: should not depend on Test::Pod

I can't see any evidence that Test::Pod is used for anything as far as users are concerned since :

 

1.15  Fri Sep  6 11:10:00 2013
        - Replace Path::Tiny with File::Spec, because the former's list of dependencies is soooo long.
                Changed files: t/read.tree.t, Build.PL and Makefile.PL.
                See: RT#88435 for an explanation.
        - Move t/pod.t to xt/author/pod.t.

 

Its thus not really justified to be in the "runtime requires" graph.

 

I would myself even go futher and move much more of those "runtime" dependencies into "Test" dependencies.

 

- File::Spec is only used in t/
- File::Temp is only used in t/
- Test::More, is of course, only used in t/

 

V 1.28 with an updated Makefile.PL is now on CPAN. Thanx for the suggestion.

I suspect I was partially unclear.

 

Its great you've made some dependencies test-only now.

 

But from the look of it, Test::Pod shouldn't be there at all.

As far as I can see, no tests that run at install time use Test::Pod , and indeed, no test _should_.

 

( Users don't get any benefit from testing that the pod is sane, only potential spurious bugs that prevent code installation, at best, and its a bit of a sore point, because somebody changed Test::Pod at some point such that it deemed legal POD to fail tests )

Subject: Re: [rt.cpan.org #112568] should not depend on Test::Pod
Date: Tue, 1 Mar 2016 11:40:11 +1100
To: bug-Tree-DAG_Node [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Kent Test::Pod is used in xt/authors/pod.t, so it's there for me. On 01/03/16 11:29, Kent Fredric via RT wrote: Show quoted text
> Queue: Tree-DAG_Node > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=112568 > > > I suspect I was partially unclear. > > Its great you've made some dependencies test-only now. > > But from the look of it, Test::Pod shouldn't be there at all. > > As far as I can see, no tests that run at install time use Test::Pod , and > indeed, no test _should_. > > ( Users don't get any benefit from testing that the pod is sane, only potential > spurious bugs that prevent code installation, at best, and its a bit of a sore > point, because somebody changed Test::Pod at some point such that it deemed > legal POD to fail tests ) >
-- Ron Savage - savage.net.au

On 2016-03-01 13:40:33, ron@savage.net.au wrote:
> Test::Pod is used in xt/authors/pod.t, so it's there for me.
>

Is xt/* run during installation time for end users?

 

Because if not, then it seems that xt/* would be better characterised as "part of the development phase".

 

And development-phase-only dependencies have no place in the install time dependency graph.

Subject: Re: [rt.cpan.org #112568] should not depend on Test::Pod
Date: Tue, 1 Mar 2016 12:00:44 +1100
To: bug-Tree-DAG_Node [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Kent On 01/03/16 11:44, Kent Fredric via RT wrote: Show quoted text
> Queue: Tree-DAG_Node > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=112568 > > > On 2016-03-01 13:40:33, ron@savage.net.au wrote:
>> Test::Pod is used in xt/authors/pod.t, so it's there for me. >>
> > Is xt/* run during installation time for end users?
No. That's the whole point of having an xt/ dir :-). Show quoted text
> Because if not, then it seems that xt/* would be better characterised as "part > of the development phase".
It is already, in my mind. Is there some view you're looking at? If so, please advise. I just went to MetaCPAN and tried clicking on the Dependency Graph link on the lower far right, but nothing happened. Show quoted text
> And development-phase-only dependencies have no place in the install time > dependency graph.
Sure. That desired outcome will result from having pod.t in xt/author/. -- Ron Savage - savage.net.au

On 2016-03-01 14:00:57, ron@savage.net.au wrote:
> Hi Kent

>
> It is already, in my mind. Is there some view you're looking at? If
> so,
> please advise. I just went to MetaCPAN and tried clicking on the
> Dependency Graph link on the lower far right, but nothing happened.
>


https://metacpan.org/source/RSAVAGE/Tree-DAG_Node-1.28/META.json#L45

It is no longer in "Runtime requires", sure, but it is still in "Test requires"

Test requires is a child of "the install phase"

Where this dependency should be in $prereqs->{develop}->{requires}, not $prereqs->{test}->{requires}

Because xt/* may be tests, but they're not "install time tests".

They're "develop time tests"

So you presently have "Required for development" dependencies inside "Required to test and install"

 

Subject: Re: [rt.cpan.org #112568] should not depend on Test::Pod
Date: Tue, 1 Mar 2016 12:19:17 +1100
To: bug-Tree-DAG_Node [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Kent On 01/03/16 12:05, Kent Fredric via RT wrote: Show quoted text
> Queue: Tree-DAG_Node > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=112568 > > > On 2016-03-01 14:00:57, ron@savage.net.au wrote:
>> Hi Kent
>
>> >> It is already, in my mind. Is there some view you're looking at? If >> so, >> please advise. I just went to MetaCPAN and tried clicking on the >> Dependency Graph link on the lower far right, but nothing happened. >>
> > > https://metacpan.org/source/RSAVAGE/Tree-DAG_Node-1.28/META.json#L45
I see, although I no longer get the line #s. I tried various tricks earlier by selecting Source/Browse raw/not, but nothing displayed them. Sigh. Show quoted text
> It is no longer in "Runtime requires", sure, but it is still in "Test requires" > > Test requires is a child of "the install phase" > > Where this dependency should be in $prereqs->{develop}->{requires}, not > $prereqs->{test}->{requires}
I take it you're referring to this para under META_MERGE: " Where prereqs are concerned, if META_MERGE is used, prerequisites are merged with their counterpart WriteMakefile() argument (PREREQ_PM is merged into {prereqs}{runtime}{requires}, BUILD_REQUIRES into {prereqs}{build}{requires}, CONFIGURE_REQUIRES into {prereqs}{configure}{requires}, and TEST_REQUIRES into {prereqs}{test}{requires}). When prereqs are specified with META_ADD, the only prerequisites added to the file come from the metadata, not WriteMakefile() arguments. " Since there is no such thing AFAICT as "$prereqs->{develop}->{requires}", I assume you're referring to {prereqs}{build}{requires}. Now, this is progress! It means I can transfer Test::Pod from TEST_REQUIRES to BUILD_REQUIRES, right? Does this satisfy your requirement? If so, I can release another version ASAP, but is it worth it? Let me know. It also means I course I'll have to patch all my other Makefiles! But that can be done as and when they're released. And it's clearly a Good Idea, so I'll do it. Show quoted text
> Because xt/* may be tests, but they're not "install time tests". > > They're "develop time tests" > > So you presently have "Required for development" dependencies inside "Required > to test and install" >
-- Ron Savage - savage.net.au

On 2016-03-01 14:19:33, ron@savage.net.au wrote:
> Hi Kent
>
> I see, although I no longer get the line #s. I tried various tricks
> earlier by selecting Source/Browse raw/not, but nothing displayed
> them.
> Sigh.

Line numbers sadly require JavaScript enabled to render.


>
> > It is no longer in "Runtime requires", sure, but it is still in "Test
> > requires"
> >
> > Test requires is a child of "the install phase"
> >
> > Where this dependency should be in $prereqs->{develop}->{requires},
> > not
> > $prereqs->{test}->{requires}
>
> I take it you're referring to this para under META_MERGE:
> "
> Where prereqs are concerned, if META_MERGE is used, prerequisites are
> merged with their counterpart WriteMakefile() argument (PREREQ_PM is
> merged into {prereqs}{runtime}{requires}, BUILD_REQUIRES into
> {prereqs}{build}{requires}, CONFIGURE_REQUIRES into
> {prereqs}{configure}{requires}, and TEST_REQUIRES into
> {prereqs}{test}{requires}). When prereqs are specified with META_ADD,
> the only prerequisites added to the file come from the metadata, not
> WriteMakefile() arguments.
> "
> Since there is no such thing AFAICT as
> "$prereqs->{develop}->{requires}", I assume you're referring to
> {prereqs}{build}{requires}.
>
> Now, this is progress! It means I can transfer Test::Pod from
> TEST_REQUIRES to BUILD_REQUIRES, right?

Noooo!

 

BUILD_ is *worse* than TEST_

 

The point is Test::Pod should *not* be in PREREQ_PM, TEST_REQUIRES, CONFIGURE_REQUIRES or BUILD_REQUIRES.

All those phases *require* Test::Pod to be installed by the end user in order to test and build the dist.

"Development" requirements are /outside/ the standard ExtUtils::MakeMaker dependency phases, because ExtUtils::MakeMaker should not be worrying about development dependencies at install time.

The only right way to add development-only requirements using ExtUtils::MakeMaker is with custom code generating the "META_MERGE" key.

BUILD_REQUIRES however is worse than TEST_REQUIRES, and is an unfortunate historical blight, because before TEST_REQUIRES existed, people
used BUILD_REQUIRES for the same purpose.

BUILD_REQUIRES is subsequently defined as follows:
- After CONFIGURE_REQUIRES, so you don't need to satisfy them **before** running Makefile.PL
- Required for *ALL* installers, whether or not they're going to run tests (!!!!)


Subsequently, "BUILD_REQUIRES" should be used for things that Makefile.PL doesn't need,  but are otherwise required to do:

`make && make install`

You do NOT want this in 99% of cases.
 

https://metacpan.org/pod/CPAN::Meta::Spec#Phases

build

The build phase is when the distribution's source code is compiled (if necessary) and otherwise made ready for installation

develop

The develop phase's prereqs are libraries needed to work on the distribution's source code as its author does. These tools might be needed to build a release tarball, to run author-only tests, or to perform other tasks related to developing new versions of the distribution.

 

Either of the attached patches should do the right thing with regards to development requirements.

 

The first is preferred because its the simplest and there's no scope for introducing additional bugs in the "EUMM merges dependencies together" stuff.

The second however is the only one that will add development requirements to META.json

I'm just not 100% sure that the second one is "safe"

 

Subject: a.patch
--- Makefile.PL.3 2016-03-01 14:41:14.147052412 +1300 +++ Makefile.PL.1 2016-03-01 14:39:20.713057559 +1300 @@ -38,7 +38,6 @@ 'File::Spec' => 3.40, 'File::Temp' => 0.19, 'Test::More' => 1.001014, - 'Test::Pod' => 1.48, }, VERSION_FROM => 'lib/Tree/DAG_Node.pm', );
Subject: b.patch
--- Makefile.PL.3 2016-03-01 14:41:14.147052412 +1300 +++ Makefile.PL.2 2016-03-01 14:40:09.053055429 +1300 @@ -38,7 +38,6 @@ 'File::Spec' => 3.40, 'File::Temp' => 0.19, 'Test::More' => 1.001014, - 'Test::Pod' => 1.48, }, VERSION_FROM => 'lib/Tree/DAG_Node.pm', ); @@ -67,6 +66,13 @@ web => 'https://github.com/ronsavage/Tree-DAG_Node', }, }, + prereqs => { + develop => { + requires => { + 'Test::Pod' => 1.48 + } + } + } }; }
Subject: Re: [rt.cpan.org #112568] should not depend on Test::Pod
Date: Tue, 1 Mar 2016 13:08:30 +1100
To: bug-Tree-DAG_Node [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Kent On 01/03/16 12:28, Kent Fredric via RT wrote: Show quoted text
> Queue: Tree-DAG_Node > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=112568 > > > On 2016-03-01 14:19:33, ron@savage.net.au wrote:
>> Hi Kent >> >> I see, although I no longer get the line #s. I tried various tricks >> earlier by selecting Source/Browse raw/not, but nothing displayed >> them. >> Sigh.
> > Line numbers sadly require JavaScript enabled to render.
I have JS enabled. That was so obvious I did not even think of it. So, there must be some other explanation. Wait...Aggghhh. I get the line #s with FF but not with Chrome. Sigh. Another problem to investigate :-((. -- Ron Savage - savage.net.au
Subject: Re: [rt.cpan.org #112568] should not depend on Test::Pod
Date: Tue, 1 Mar 2016 13:11:30 +1100
To: bug-Tree-DAG_Node [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Kent On 01/03/16 12:44, Kent Fredric via RT wrote: Show quoted text
> Queue: Tree-DAG_Node > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=112568 > > > Either of the attached patches should do the right thing with regards to > development requirements. > > The first is preferred because its the simplest and there's no scope for > introducing additional bugs in the "EUMM merges dependencies together" stuff. > > The second however is the only one that will add development requirements to > META.json > > I'm just not 100% sure that the second one is "safe"
Understand, finally (I hope). I'm on the CPAN testers mailing list. I'll ask them for guidance before proceeding. Thanx! -- Ron Savage - savage.net.au
Subject: Re: [rt.cpan.org #112568] should not depend on Test::Pod
Date: Tue, 1 Mar 2016 13:35:58 +1100
To: bug-Tree-DAG_Node [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Kent Karen Etheridge has replied: " I see nothing unsafe about either patch, so long as the meta-spec is specified as version 2. Can you clarify your concerns? Perhaps reading the section in prerequisite phases in the meta spec might clarify things a bit: https://metacpan.org/pod/CPAN::Meta::Spec#PREREQUISITES (PS. I found the discussion in https://rt.cpan.org/Ticket/Display.html?id=112568) " Clearly, prereqs/develop/requires is safe, so I'll use it. $many x $thanx; -- Ron Savage - savage.net.au
V 1.29 is on CPAN, and presumably resolves the original issue of relegating Test::Pod so that it is only needed during development.
On 2016-03-01 15:53:11, RSAVAGE wrote:
Show quoted text
> V 1.29 is on CPAN, and presumably resolves the original issue of
> relegating Test::Pod so that it is only needed during development.

Thanks =)