Can't Locate ExcUtils/MM_Win32.pm when ParlApp executable has use Archive::Extract

Posted by thloeber on 2014-05-01 08:01
Forums: PDK discussion | OS: Windows

I've created a Perl script which has a use Archive::Extract statement which runs fine with no runtime compile errors. Creating an executable for Windows 64 bit with PDK 9.3 and ActivePerl 5.18 throws these errors but does create the exe for testing.
.\Makefile.PL:
error: Can't locate .\Makefile.PL
refby: C:\Perl64\site\lib\ExtUtils\MakeMaker.pm line 234
Win32\Locale.pm:
error: Can't locate Win32\Locale.pm
refby: C:\Perl64\lib\Locale\Maketext.pm

When running the executable I get this runtime compilation error
Can't locate ExtUtils/MM_Win32.pm in @INC (you may need to install the ExtUtils
:MM_Win32 module) (@INC contains: C:/) at (eval 146) line 2, line 176.
BEGIN failed--compilation aborted at trythis.pl line 17, line 176.

ExcUtils/MM_Win32 is in the default module search path

If I remove the use Archive::Extract statement i do not get the compilation error.

This can be simply reproduce with this code snippet

use strict ;
use warnings ;
use Archive::Extract ;
exit 0 ;

Any ideas how to fix this?

billo | Sat, 2017-06-10 08:27

I get similar behavior with a different module... the output of perl -v is listed below
here is my code

use File::Fetch;

my $full_url_name="http://www.cadenhance.com/sample_part_downloads/DDR3_DRAM_IBIS_DEMO.zip";
my $ff = File::Fetch->new(uri => $full_url_name);
my $file = $ff->fetch();

exit 0;

here is the result when I run it using the installed activestate perl interperter... I get unexpected errors, but it actually does get the file from the website listed

perl perl_dev_test.pl
'lwp' said it fetched 'c:/Users/boleary/Documents/GitHub/CE_TOOLS/PERL_DEV_TEST/DDR3_DRAM_IBIS_DEMO.zip', but it was not created at perl_dev_test.pl line 28.
'httptiny' said it fetched 'c:/Users/boleary/Documents/GitHub/CE_TOOLS/PERL_DEV_TEST/DDR3_DRAM_IBIS_DEMO.zip', but it was not created at perl_dev_test.pl line 28.
Use of uninitialized value in pattern match (m//) at C:/Perl/lib/ExtUtils/MM_Win32.pm line 40.
Use of uninitialized value in pattern match (m//) at C:/Perl/lib/ExtUtils/MM_Win32.pm line 41.
Use of uninitialized value in pattern match (m//) at C:/Perl/lib/ExtUtils/MM_Win32.pm line 42.

when I create the executable with perlapp and run it,
here is what get

C:\Users\boleary\Documents\GitHub\CE_TOOLS\PERL_DEV_TEST>executable_versions\1.0.0\perl_dev_test.exe
Can't locate ExtUtils/MM_Win32.pm in @INC (you may need to install the ExtUtils::MM_Win32 module) (@INC contains:) at (eval 106) line 2.

Here is the command I use with perlApp and the output from perlapp... I had never noticed the 5 errors before since the script that runs perlApp was hiding the results from me and ostensibly the executable was always working until I tested the specific feature that used File::Fetch.

###
###  PERLAPP COMMAND:###

perlapp --lib ..\COMMON  --icon ../COMMON/images/CE_ICON_300x300.ico  --bind cadEnhanceSplash1.BMP[file=../COMMON/images/cadEnhanceSplash1.BMP,mode=666] --bind cadEnhanceSplash1.gif[file=../COMMON/ima
ges/cadEnhanceSplash1.gif,mode=666] --bind cadEnhanceSplash1.ico[file=../COMMON/images/cadEnhanceSplash1.ico,mode=666] --bind cadEnhanceSplashSmall.bmp[file=../COMMON/images/cadEnhanceSplashSmall.bmp,
mode=666] --bind cadEnhanceSplashSmall.gif[file=../COMMON/images/cadEnhanceSplashSmall.gif,mode=666] --bind CE_ICON.bmp[file=../COMMON/images/CE_ICON.bmp,mode=666] --bind CE_ICON.gif[file=../COMMON/im
ages/CE_ICON.gif,mode=666] --bind CE_ICON_300x300.bmp[file=../COMMON/images/CE_ICON_300x300.bmp,mode=666] --bind CE_ICON_300x300.gif[file=../COMMON/images/CE_ICON_300x300.gif,mode=666] --bind CE_ICON_
300x300.ico[file=../COMMON/images/CE_ICON_300x300.ico,mode=666] --bind CE_ICON_OLD_SCHOOL.bmp[file=../COMMON/images/CE_ICON_OLD_SCHOOL.bmp,mode=666] --bind CE_ICON_OLD_SCHOOL.gif[file=../COMMON/images
/CE_ICON_OLD_SCHOOL.gif,mode=666] --bind CE_LOGO_W_BAR_2048X1152.jpg[file=../COMMON/images/CE_LOGO_W_BAR_2048X1152.jpg,mode=666] --bind icon_bitmap.bmp[file=../COMMON/images/icon_bitmap.bmp,mode=666]
--bind icon_bitmap.gif[file=../COMMON/images/icon_bitmap.gif,mode=666] --bind TI_BOM_GEN_dbg.txt[file=../COMMON/images/TI_BOM_GEN_dbg.txt,mode=666] --norunlib --info "Comments=Built by and for CadEnha
nce LLC;CompanyName=CadEnhance LLC;FileDescription=executable:perl_dev_test Application;FileVersion=1.0.0;InternalName=perl_dev_test.pl  tool_version.pm ;LegalCopyright=2016;OriginalFilename=perl_dev_
test;ProductName=perl_dev_test;ProductVersion=1.0.0" --exe perl_dev_test.exe perl_dev_test.pl

###
###
###
###  PERLAPP RESULTS:###

PerlApp 9.5.1 build 300018
Copyright (C) 1998-2016 ActiveState Software Inc. All rights reserved.
Commercial license for bill oleary <boleary@cadEnhance.com>

.\Makefile.PL:
        error: Can't locate .\Makefile.PL
        refby: C:\Perl\lib\ExtUtils\MakeMaker.pm line 253
Encode\HanExtra.pm:
        error: Can't locate Encode\HanExtra.pm
        refby: C:\Perl\lib\ExtUtils\MakeMaker\Locale.pm line 117
I18N\Langinfo.pm:
        error: Can't locate I18N\Langinfo.pm
        refby: C:\Perl\lib\ExtUtils\MakeMaker\Locale.pm line 88
Log\Contextual\WarnLogger.pm:
        error: Can't locate Log\Contextual\WarnLogger.pm
        refby: C:\Perl\lib\Module\Metadata.pm line 29
Win32\Locale.pm:
        error: Can't locate Win32\Locale.pm
        refby: C:\Perl\lib\Locale\Maketext.pm

Summary: 5 errors and 0 warnings

Created 'perl_dev_test.exe'

I am not sure if you There is an actual solution listed in the https://community.activestate.com/node/7553#comment-24467
If there is a solution there I can't seem to figure it out..
Is it setting the ACTIVEPERL_CONFIG_DISABLE environment variable in a begin block in my top level perl code?

PERL -V info:

C:\Users\boleary\Documents\GitHub\CE_TOOLS\PERL_DEV_TEST\executable_versions\1.0.0>perl -v

This is perl 5, version 22, subversion 2 (v5.22.2) built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2015, Larry Wall

Binary build 2202 [300560] provided by ActiveState http://www.ActiveState.com
Built Jul 13 2016 15:47:10

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

grahams
ActiveState Staff
Mon, 2017-06-12 08:35

That's your basic solution.

You're using modules that have evolved under the assumption that the internet, CPAN, and a compiler will always be available. When you wrap some or all of those will be unavailable, and the internal hacks needed to allow PerlApp to keep dealing with these designs are no longer being maintained.

http://docs.activestate.com/activeperl/5.24/lib/ActivePerl/Config.html
Locking out the config might help you.

Rolling back any and all module updates downloaded from PPM might also help, particularly if one of those updated modules is Ext::MakeMaker

billo | Tue, 2017-06-13 14:23

Thanks Graham!

I found a different module WWW.Mechanize to do the same job...
I quickly tried playing with the configs but that didn't work.

Bill