我正在尝试构建this Perl模块:
git clone git@github.com:jrockway/anyevent-subprocess.git
cd anyevent-subprocess
dzil authordeps --missing | cpanm
dzil build
但是该构建因错误而中止:
[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.
dist.ini
文件如下所示:
name = AnyEvent-Subprocess
[@JROCKWAY]
[Prereqs]
Moose = 1.15
Event::Join = 0.05
JSON = 2
[Prereqs/Test]
EV = 4.0
为什么会出现此错误?
答案 0 :(得分:1)
根据Dist::Zilla::Plugin::Prereqs:
如果名称是阶段和关系的CamelCase串联 (或只是一种关系),它将隐式设置那些参数。如果 您使用自定义名称,但未指定关系,并且 您未指定
-phase
或-relationship
,则会引发错误No -phase or -relationship specified
。这是为了防止打字错误 使得名称不会被忽视而毫无意义。
dist.ini
没有为[Prereqs/Test]
插件指定阶段或关系,名称Test
也不是阶段和关系的驼峰式连接(如CPAN::Meta),因此dzil build
引发错误,警告名称Test
毫无意义。
解决方案:
在名称中添加关系,例如Requires
:
[Prereqs/TestRequires]
EV = 4.0