gpt4 book ai didi

perl - 无法在 Perl 5.32.0 MacOS Sierra 上安装 Test::File

转载 作者:行者123 更新时间:2023-12-03 16:01:01 41 4
gpt4 key购买 nike

我正在尝试安装 DateTime在我的 perlbrew 5.32.0 上,但对其依赖项的测试 Test::File正在失败。重要的部分如下:

t/owner.t ..................... # File [blib] belongs to 703404669 (729761796), not 703404669 (703404669)!
t/owner.t ..................... 1/?
# Failed test 'owner_is with text username'
# at t/owner.t line 99.

# Failed test 'Intentional owner_isnt failure'
# at t/owner.t line 146.
# STDOUT is:
# > ok 1 - blib doesn't belong to 703404669
# not:
# > not ok 1 - blib doesn't belong to 703404669
# as expected
# STDERR is:
# >
# >
# >
# not:
# > # File [blib] belongs to 703404669 (729761796)!
# > # Failed test 'blib doesn't belong to 703404669'
# > # at t/owner.t line 145.
我之前遇到过类似的错误,但我的 ~/.cpan 中的几乎每个包目录有一个 blib所以我不确定 cpan 在谈论哪个目录。
我的操作系统是 MacOS Sierra 10.12.6 (16G2136)
如何解决这些错误以安装 DateTime ?

最佳答案

tl;dr:您在依赖项中发现了一个错误。它仅用于测试。您可以忽略失败的测试,强制安装 Test::File,然后继续安装 DateTime。

cpan -f -i Test::File
cpan DateTime
# File [blib] belongs to 703404669 (729761796), not 703404669 (703404669)!

问题是您的用户名是一个数字,而 Test::File 似乎没有考虑到这一点。 owner_is检查文件是否归给定用户所有。它接受用户名或数字用户 ID。如果给定一个数字,它 assumes it's a numeric ID .如果 703404669 是您的用户名,它会混淆并将其用作用户 ID。您的用户 ID 确实是 729761796。703404669 != 729761796。
Test::File 可以通过使用 getpwuid 进行验证来防止这种歧义。和/或检查 getpwnam第一的。
恭喜,您在 Test::File 中发现了一个错误。 Please report it .

关于perl - 无法在 Perl 5.32.0 MacOS Sierra 上安装 Test::File,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66426472/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com