我正在使用module-starter
创建一个 CPAN 模块。它会自动创建一些测试
$ ls t/
00-load.t manifest.t pod-coverage.t pod.t
使用shebang #!perl -T
,因此在污点模式下运行测试。它在我的带有 Ubuntu 20.04 的笔记本电脑上运行良好(没有测试失败),但是当我在带有 Ubuntu 20.04 的 Docker 容器中运行相同的测试并且还使用该模块时Alien::GSL
,我得到了错误:
$ perl -T -I./lib t/00-load.t
not ok 1 - use My::Module;
# Failed test 'use My::Module;'
# at t/00-load.t line 10.
# Tried to use 'My::Module'.
# Error: Insecure dependency in chdir while running with -T switch at /home/hakond/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/File/Find.pm line 375.
# BEGIN failed--compilation aborted at lib/My/Module.pm line 7.
# Compilation failed in require at t/00-load.t line 10.
# BEGIN failed--compilation aborted at t/00-load.t line 10.
可以通过以下方式更简单地产生错误(在 Docker 容器中):
$ perl -T -MAlien::GSL -e1
Insecure dependency in chdir while running with -T switch at /home/hakond/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/File/Find.pm line 375.
BEGIN failed--compilation aborted.
上面的命令在我的笔记本电脑上运行良好(没有错误)。
有什么想法吗?