Håkon Hægland
Håkon Hægland

Reputation: 40748

"No -phase or -relationship specified" error when running dzil build

I am trying to build this Perl module:

git clone [email protected]:jrockway/anyevent-subprocess.git
cd anyevent-subprocess
dzil authordeps --missing | cpanm
dzil build

But the build aborts with an error:

[Test] No -phase or -relationship specified
[Test] No -phase or -relationship specified at /home/hakon/perlbrew/perls/perl-5.30.0/lib/site_perl/5.30.0/Dist/Zilla/Plugin/Prereqs.pm line 162.

The dist.ini file looks like this:

name = AnyEvent-Subprocess
[@JROCKWAY]
[Prereqs]
Moose = 1.15
Event::Join = 0.05
JSON = 2

[Prereqs/Test]
EV = 4.0

Why am I getting this error?

Upvotes: 0

Views: 36

Answers (1)

Håkon Hægland
Håkon Hægland

Reputation: 40748

According to Dist::Zilla::Plugin::Prereqs:

If the name is the CamelCase concatenation of a phase and relationship (or just a relationship), it will set those parameters implicitly. If you use a custom name, but it does not specify the relationship, and you didn't specify either -phase or -relationship, it throws the error No -phase or -relationship specified. This is to prevent a typo that makes the name meaningless from slipping by unnoticed.

The dist.ini does not specify a phase or a relationship for the [Prereqs/Test] plugin, also the name Test is not a camel case concatenation of a phase and a relationship (as defined in CPAN::Meta), hence dzil build throws an error to warn that the name Test is meaningless.

Solution:

Add a relationship to the name, e.g. Requires:

[Prereqs/TestRequires]
EV = 4.0

Upvotes: 1

Related Questions