为什么我不能在Strawberry Perl 5.28.1上构建“ true”编译指示模块?

时间:2019-01-23 15:27:36

标签: perl cpan perl-xs

我正在从头开始重建Windows 10(64位)工作站,并且在构建一个特定的CPAN模块true时遇到了麻烦。这是一个完善的模块,它的上一次更新是在2011年!!并且我已经在Strawberry Perl的早期版本中使用了多年,直到5.26(含)。我对发生的问题感到迷惑。

我按如下方式构建模块:

C:\Strawberry\cpan\build\true-0.18-0> perl Makefile.PL
Checking if your kit is complete...
Looks good
Generating a gmake-style Makefile
Writing Makefile for true
Writing MYMETA.yml and MYMETA.json
C:\Strawberry\cpan\build\true-0.18-0> gmake
cp lib/true/VERSION.pm blib\lib\true\VERSION.pm
cp lib/true.pm blib\lib\true.pm
Running Mkbootstrap for true ()
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 "true.bs"
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- true.bs blib\arch\auto\true\true.bs 644
"C:\Strawberry\perl\bin\perl.exe" "C:\Strawberry\perl\lib\ExtUtils/xsubpp"  -typemap C:\STRAWB~1\perl\lib\ExtUtils\typemap  true.xs > true.xsc
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e mv -- true.xsc true.c
gcc -c  -IC:\Strawberry\perl\site\lib\B\Hooks\OP\Annotation\Install -IC:\Strawberry\perl\vendor\lib\B\Hooks\OP\Check\Install -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -O3 -Wall -W   -DVERSION=\"0.18\" -DXS_VERSION=\"0.18\"  "-IC:\STRAWB~1\perl\lib\CORE"   true.c
In file included from true.xs:4:0:
true.xs: In function 'true_leave':
C:\STRAWB~1\perl\lib\CORE/perl.h:174:22: warning: unused parameter 'my_perl' [-Wunused-parameter]
#  define pTHX  tTHX my_perl PERL_UNUSED_DECL
^
true.xs:25:24: note: in expansion of macro 'pTHX'
STATIC void true_leave(pTHX) {
^
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \
-e "Mksymlists('NAME'=>\"true\", 'DLBASE' => 'true', 'DL_FUNCS' => {  }, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"
g++ true.def -o blib\arch\auto\true\true.xs.dll -mdll -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" true.o   "C:\STRAWB~1\perl\lib\CORE\libperl528.a" "C:\Strawberry\perl\site\lib\auto\B\Hooks\OP\Annotation\Annotation.a" "C:\Strawberry\perl\vendor\lib\auto\B\Hooks\OP\Check\Check.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a" -Wl,--enable-auto-image-base
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 755 blib\arch\auto\true\true.xs.dll
dlltool --def true.def --output-lib blib\arch\auto\true/true.a --dllname true.xs.dll blib\arch\auto\true\true.xs.dll

我不知道有关pTHX的警告是否明显或可忽略。无论如何,它确实会生成输出文件true.xs.dll

C:\Strawberry\cpan\build\true-0.18-0> dir blib\arch\auto\true\true.xs.dll
Volume in drive C is Local SSD Disk
Volume Serial Number is B4E3-5132

Directory of C:\Strawberry\cpan\build\true-0.18-0\blib\arch\auto\true

01/23/2019  09:53            17,920 true.xs.dll
1 File(s)         17,920 bytes
0 Dir(s)  873,458,094,080 bytes free

但是文件不可用:

C:\Strawberry\cpan\build\true-0.18-0> perl -I blib\arch\auto -Iblib\arch\auto\true -I blib\lib\auto -I blib\lib\ -Mtrue
Can't load 'blib\arch\auto\true/true.xs.dll' for module true: load_file:The specified module could not be found at C:/Strawberry/perl/lib/DynaLoader.pm line 193.
at - line 0.
Compilation failed in require.
BEGIN failed--compilation aborted.

Dynaloader上的文档并没有真正的帮助,但是Dynaloader.pm中第193行附近的代码确实提供了提示:

# Many dynamic extension loading problems will appear to come from
# this section of code: XYZ failed at line 123 of DynaLoader.pm.
# Often these errors are actually occurring in the initialisation
# C code of the extension XS file. Perl reports the error as being
# in this perl code simply because this was the last perl code
# it executed.

因此,我的工作理论是最新的Perl中的“某些内容”发生了变化,导致true模块中的代码腐烂。但是我的理论有一个缺陷:至少有一个CPAN tester已经成功构建了true(尽管他们使用32位perl做到了)。

我很茫然。有人有我可以尝试的想法吗?

1 个答案:

答案 0 :(得分:0)

我不确定是否将其发布为 answer ,但这至少是分辨率。在花了一天半的时间探查源代码并尝试了各种实验之后,我放弃了,删除了64位Strawberry 5.28.1,并安装了32位Strawberry 5.28.1。然后age像冠军一样进行构建,测试和安装。

我唯一的猜测(这是一个疯狂的猜测)是,该过程的某些部分以某种方式找到了网络上的某些32位二进制文​​件并与之交互—尽管我明确没有true或其他Perl env vars set,而我的PERL5LIB中没有任何东西指向任何网络Perl内容。

但是我没有时间进一步研究这个问题,而32位Perl足以胜任我的工作。 谢谢,感谢@Corion和@ikegami的时间和评论。