Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.96k stars 555 forks source link

ExtUtils-CBuilder looks for the manifest file in the wrong place #12005

Closed p5pRT closed 12 years ago

p5pRT commented 12 years ago

Migrated from rt.perl.org#111798 (status was 'resolved')

Searchable as RT111798$

p5pRT commented 12 years ago

From Samuel.Ferencik@barclayscapital.com

This is a bug report for perl from sferencik@​gmail.com\, generated with the help of perlbug 1.35 running under perl v5.8.8.


ExtUtils​::CBuilder 0.280205* on Windows tries to embed a manifest into the DLL that it has just linked\, but fails to do so.

The reason is that it looks for the manifest file in the wrong place.

Callink ExtUtils​::CBuilder​::Platform​::Windows​::link() produces the following sequence of DOS commands​:

  link @​"lib\Simple.lds" -out​:"blib\arch\auto\Simple\Simple.dll"   if exist "lib\Simple.dll.manifest" mt -nologo -manifest "lib\Simple.dll.manifest" -outputresource​:"blib\arch\auto\Simple\Simple.dll";2

However\, the 'link' command puts the manifest file next to the dll\, i.e. at   blib\arch\auto\Simple\Simple.dll.manifest not at   lib\Simple.dll.manifest

ExtUtils​::CBuilder​::Platform​::Windows​::link() needs to be modified to set $spec{manifest} such that it would respect $spec{output}.

* The "if exist" line is produced by a modified version of 0.280205. See perlbug #111782.

The problem surfaced while installing Module-Build v0.40 on Windows\, in running its t/xs.t test\, which uses ExtUtils​::CBuilder to produce a dll file.

Patch included.

Thanks\, Sam

Left file​: C​:\Users\ferencis\AppData\Local\Temp\p4v\PRGDWM355382_qaperforce_1666\depot\QA\Toolbox\main.br\CPAN\ExtUtils-CBuilder\0.280205_bc2\src\lib\ExtUtils\CBuilder\Platform\Windows#1.pm Right file​: C​:\Users\ferencis\AppData\Local\Temp\p4v\PRGDWM355382_qaperforce_1666\depot\QA\Toolbox\main.br\CPAN\ExtUtils-CBuilder\0.280205\src\lib\ExtUtils\CBuilder\Platform\Windows#1.pm 182c182 \< $spec{manifest} = File​::Spec->catfile( dirname($spec{output})\,


$spec{manifest} ||= File​::Spec->catfile( $spec{builddir}\,



Flags​:   category=library   severity=medium


Site configuration information for perl v5.8.8​:

Configured by SYSTEM at Tue Aug 29 12​:39​:43 2006.

Summary of my perl5 (revision 5 version 8 subversion 8) configuration​:   Platform​:   osname=MSWin32\, osvers=5.0\, archname=MSWin32-x86-multi-thread   uname=''   config_args='undef'   hint=recommended\, useposix=true\, d_sigaction=undef   usethreads=define use5005threads=undef useithreads=define usemultiplicity=define   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef   use64bitint=undef use64bitall=undef uselongdouble=undef   usemymalloc=n\, bincompat5005=undef   Compiler​:   cc='cl'\, ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX'\,   optimize='-MD -Zi -DNDEBUG -O1'\,   cppflags='-DWIN32'   ccversion='12.00.8804'\, gccversion=''\, gccosandvers=''   intsize=4\, longsize=4\, ptrsize=4\, doublesize=8\, byteorder=1234   d_longlong=undef\, longlongsize=8\, d_longdbl=define\, longdblsize=10   ivtype='long'\, ivsize=4\, nvtype='double'\, nvsize=8\, Off_t='__int64'\, lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='link'\, ldflags ='-nologo -nodefaultlib -debug -opt​:ref\,icf -libpath​:"C​:\Program Files (x86)\Perl\lib\CORE" -machine​:x86'   libpth=\lib   libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib   perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib   libc=msvcrt.lib\, so=dll\, useshrplib=yes\, libperl=perl58.lib   gnulibc_version=''   Dynamic Linking​:   dlsrc=dl_win32.xs\, dlext=dll\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags=' '\, lddlflags='-dll -nologo -nodefaultlib -debug -opt​:ref\,icf -libpath​:"C​:\Program Files (x86)\Perl\lib\CORE" -machine​:x86'

Locally applied patches​:   ACTIVEPERL_LOCAL_PATCHES_ENTRY   Iin_load_module moved for compatibility with build 806   Avoid signal flag SA_RESTART for older versions of HP-UX   PerlEx support in CGI​::Carp   Less verbose ExtUtils​::Install and Pod​::Find   Patch for CAN-2005-0448 from Debian with modifications   Rearrange @​INC so that 'site' is searched before 'perl'   Partly reverted 24733 to preserve binary compatibility   28671 Define PERL_NO_DEV_RANDOM on Windows   28376 Add error checks after execing PL_cshname or PL_sh_path   28305 Pod​::Html should not convert \"foo\" into ``foo''   27736 Make perl_fini() run with Sun WorkShop compiler   27619 Bug in Term​::ReadKey being triggered by a bug in Term​::ReadLine   27549 Move DynaLoader.o into libperl.so   27528 win32_pclose() error exit doesn't unlock mutex   27527 win32_async_check() can loop indefinitely   27515 ignore directories when searching @​INC   27359 Fix -d​:Foo=bar syntax   27210 Fix quote typo in c2ph   27203 Allow compiling swigged C++ code   27200 Make stat() on Windows handle trailing slashes correctly   27194 Get perl_fini() running on HP-UX again   27133 Initialise lastparen in the regexp structure   27034 Avoid \"Prototype mismatch\" warnings with autouse   26970 Make Passive mode the default for Net​::FTP   26921 Avoid getprotobyname/number calls in IO​::Socket​::INET   26897\,26903 Make common IPPROTO_* constants always available   26670 Make '-s' on the shebang line parse -foo=bar switches   26536 INSTALLSCRIPT versus INSTALLDIRS   26379 Fix alarm() for Windows 2003   26087 Storable 0.1 compatibility   25861 IO​::File performace issue   25084 long groups entry could cause memory exhaustion   24699 ICMP_UNREACHABLE handling in Net​::Ping


@​INC for perl v5.8.8​:   C​:/Program Files (x86)/Perl/site/lib   C​:/Program Files (x86)/Perl/lib   .


Environment for perl v5.8.8​:   HOME (unset)   LANG (unset)   LANGUAGE (unset)   LD_LIBRARY_PATH (unset)   LOGDIR (unset)   PATH=C​:\Program Files (x86)\Perl\bin\;C​:\Windows\system32;C​:\Windows;C​:\Windows\System32\Wbem;C​:\Windows\System32\WindowsPowerShell\v1.0\;C​:\Program Files (x86)\Perforce;c​:\Program Files (x86)\vim\vim73;C​:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C​:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C​:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C​:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C​:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C​:\Program Files (x86)\Barclays Capital\P4CustomTools;C​:\Program Files\Java\jdk1.6.0_21\Bin;C​:\Program Files (x86)\Xoreax\IncrediBuild   PERL_BADLANG (unset)   SHELL (unset)

_______________________________________________

This e-mail may contain information that is confidential\, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail\, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated\, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities\, investment products or other financial product or service\, an official confirmation of any transaction\, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link​: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC\, a company registered in England (number 1026167) with its registered office at 1 Churchill Place\, London\, E14 5HP. This email may relate to or be sent from other members of the Barclays Group. _______________________________________________

p5pRT commented 12 years ago

From @steve-m-hay

Samuel.Ferencik@​barclayscapital.com (via RT) wrote on 2012-03-16​:

# New Ticket Created by Samuel.Ferencik@​barclayscapital.com # Please include the string​: [perl #111798] # in the subject line of all future correspondence about this issue. # \<URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=111798 >

This is a bug report for perl from sferencik@​gmail.com\, generated with the help of perlbug 1.35 running under perl v5.8.8.

-----------------------------------------------------------------

ExtUtils​::CBuilder 0.280205* on Windows tries to embed a manifest into the DLL that it has just linked\, but fails to do so.

The reason is that it looks for the manifest file in the wrong place.

Callink ExtUtils​::CBuilder​::Platform​::Windows​::link() produces the following sequence of DOS commands​:

link @&#8203;"lib\\Simple\.lds" \-out&#8203;:"blib\\arch\\auto\\Simple\\Simple\.dll"
if exist "lib\\Simple\.dll\.manifest" mt \-nologo \-manifest 

"lib\Simple.dll.manifest" - outputresource​:"blib\arch\auto\Simple\Simple.dll";2

However\, the 'link' command puts the manifest file next to the dll\, i.e. at blib\arch\auto\Simple\Simple.dll.manifest not at lib\Simple.dll.manifest ExtUtils​::CBuilder​::Platform​::Windows​::link() needs to be modified to set $spec{manifest} such that it would respect $spec{output}.

I will have a closer look into this later​: I'm confused from a quick look because it appears that the manifest file path already is alongside the output (DLL) file path​:

  $spec{output} ||= File​::Spec->catfile( $spec{builddir}\,   $spec{basename} . '.'.$cf->{dlext} );   $spec{manifest} ||= File​::Spec->catfile( $spec{builddir}\,   $spec{basename} . '.'.$cf->{dlext}.'.manifest');

Of course\, that's only setting it if it isn't already set\, though\, so presumably something further up the call stack has already set it wrongly...

p5pRT commented 12 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 12 years ago

From @steve-m-hay

Steve Hay wrote on 2012-03-20​:

Samuel.Ferencik@​barclayscapital.com (via RT) wrote on 2012-03-16​:

# New Ticket Created by Samuel.Ferencik@​barclayscapital.com # Please include the string​: [perl #111798] # in the subject line of all future correspondence about this issue. # \<URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=111798 >

This is a bug report for perl from sferencik@​gmail.com\, generated with the help of perlbug 1.35 running under perl v5.8.8.

-----------------------------------------------------------------

ExtUtils​::CBuilder 0.280205* on Windows tries to embed a manifest into the DLL that it has just linked\, but fails to do so.

The reason is that it looks for the manifest file in the wrong place.

Callink ExtUtils​::CBuilder​::Platform​::Windows​::link() produces the following sequence of DOS commands​:

link @&#8203;"lib\\Simple\.lds" \-out&#8203;:"blib\\arch\\auto\\Simple\\Simple\.dll"
if exist "lib\\Simple\.dll\.manifest" mt \-nologo \-manifest

"lib\Simple.dll.manifest" - outputresource​:"blib\arch\auto\Simple\Simple.dll";2

However\, the 'link' command puts the manifest file next to the dll\, i.e. at blib\arch\auto\Simple\Simple.dll.manifest not at lib\Simple.dll.manifest ExtUtils​::CBuilder​::Platform​::Windows​::link() needs to be modified to set $spec{manifest} such that it would respect $spec{output}.

I will have a closer look into this later​: I'm confused from a quick look because it appears that the manifest file path already is alongside the output (DLL) file path​:

$spec{output} ||= File​::Spec->catfile( $spec{builddir}\, $spec{basename} . '.'.$cf-

{dlext} ); $spec{manifest} ||= File​::Spec->catfile( $spec{builddir}\, $spec{basename} . '.'.$cf- {dlext}.'.manifest');

Of course\, that's only setting it if it isn't already set\, though\, so presumably something further up the call stack has already set it wrongly...

I've not found anything obvious further up that's setting manifest wrongly\, and furthermore I can't reproduce your problem with the Module-Build-0.40 tests either​: all tests succeed for me.

This was using bleadperl (a6c70abe1d) with the patch from [perl #111782]\, built on Win7 64 bit with VC++ 2010.

I see your perlbug was running under perl-5.8.8. What version of perl did you have the problem with Module-Build's tests in?

p5pRT commented 12 years ago

From sferencik@gmail.com

Hi Steve\,

My perl is the same as used to produce the perlbug - 5.8.8.

I cannot reproduce it now\, either. t/xs.t passes. It's been a while\, sorry.

I'm still convinced\, though\, that the manifest file should be picked up wherever the dll is placed\, i.e. in dirname($spec{output}).

Having said that\, I leave the decision with you.

Thanks for checking!

Regards\, Sam

p5pRT commented 12 years ago

From @steve-m-hay

Finally reproduced this with Win32-IPC\, as was reported long ago in [cpan #35943]. I've now applied a patch from that bug report to bleadperl as #a970290aa9\, which resolves this bug too. Thanks for the report.

p5pRT commented 12 years ago

From [Unknown Contact. See original ticket]

Finally reproduced this with Win32-IPC\, as was reported long ago in [cpan #35943]. I've now applied a patch from that bug report to bleadperl as #a970290aa9\, which resolves this bug too. Thanks for the report.

p5pRT commented 12 years ago

@steve-m-hay - Status changed from 'open' to 'resolved'