local::lib 和 Makefile.PL 的注释
我有一个 Makefile.PL,我想使用“notest”标志并使用我的 local::lib 主目录安装依赖项,但我无法掌握 Makefile.PL 选项。
我的 Makefile.PL 看起来像这样:
use inc::Module::Install;
name 'MyApp';
all_from 'lib/MyApp.pm';
requires 'Moose';
requires 'Catalyst::Runtime';
install_script glob('script/*.pl');
auto_install;
WriteAll;
我注意到将 local::lib
(已安装)放入我的 bash 会话中会打开一些标志,这些标志可能会使依赖项安装到 local::lib 中,但我不确定并且我还没有测试过它:
$ eval $(perl -Mlocal::lib)
$ perl -Mlocal::lib
export PERL_LOCAL_LIB_ROOT="$PERL_LOCAL_LIB_ROOT:/home/user/perl5";
export PERL_MB_OPT="--install_base /home/user/perl5";
export PERL_MM_OPT="INSTALL_BASE=/home/user/perl5";
export PERL5LIB="/home/user/perl5/lib/perl5/i686-linux:/home/user/perl5/lib/perl5:$PERL5LIB";
export PATH="/home/user/perl5/bin:$PATH";
但我不确定这会改变 Makefile.PL deps 行为。
I have a Makefile.PL for which I want to install dependencies with a "notest" flag and using my local::lib home dir, but I can't get a grasp on the Makefile.PL options.
My Makefile.PL looks like this:
use inc::Module::Install;
name 'MyApp';
all_from 'lib/MyApp.pm';
requires 'Moose';
requires 'Catalyst::Runtime';
install_script glob('script/*.pl');
auto_install;
WriteAll;
I've noticed that evalling local::lib
(which is already installed) into my bash session turns on some flags which will probably make dependencies install into local::lib, but I'm not sure and I've haven't tested it yet:
$ eval $(perl -Mlocal::lib)
$ perl -Mlocal::lib
export PERL_LOCAL_LIB_ROOT="$PERL_LOCAL_LIB_ROOT:/home/user/perl5";
export PERL_MB_OPT="--install_base /home/user/perl5";
export PERL_MM_OPT="INSTALL_BASE=/home/user/perl5";
export PERL5LIB="/home/user/perl5/lib/perl5/i686-linux:/home/user/perl5/lib/perl5:$PERL5LIB";
export PATH="/home/user/perl5/bin:$PATH";
But I'm not sure this will change the Makefile.PL deps behavior.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该永久应用
eval
咒语中的设置,例如将其添加到.bashrc
中。是的,设置 PERL_MM_OPT 变量会更改 ExtUtils::MakeMaker 的行为,ExtUtils::MakeMaker 是 Module::Install 的基础。请参阅ExtUtils::MakeMaker 中的INSTALL_BASE。
您无需更改
Makefile.PL
中的任何内容。一般来说,跳过测试不是由你决定的,而是由用户决定的。 cpan 客户端甚至不允许这样做,仅在测试失败后强制安装步。如果用户手动安装依赖项,则他可以完全控制每个步骤,并且您根本无法阻止他运行测试步骤。
我认为你现在需要解释一下你想通过禁止测试来实现什么目的。
You are supposed to permanently apply the settings from the
eval
incantation, e.g. adding it to the.bashrc
.Yes, setting the
PERL_MM_OPT
variables changes the behaviour of ExtUtils::MakeMaker which is the foundation of Module::Install. See INSTALL_BASE in ExtUtils::MakeMaker.You need not change anything in your
Makefile.PL
.Generally, skipping tests is not in your hand, but the user's. The cpan client does not even allow this, only forcing an installation after a failed test step. If a user installs dependencies manually, he has the full control over each step and you cannot prevent him from running the test step at all.
I think you now need to explain what you want to achieve by wanting to prohibit testing.