Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

win32api::commport install fails

by ccherri (Novice)
on Oct 31, 2012 at 23:31 UTC ( #1001760=perlquestion: print w/ replies, xml ) Need Help??
ccherri has asked for the wisdom of the Perl Monks concerning the following question:

Hello again,

I have now written thousands of line of perl and have been having a great time. Having delivered several products, I am now attempted a ground up build based on strawberry since my previous build was an inherited activestate version.

That said, I have strawberry installed, path updated, etc. I want to install Win32API::CommPort using cpanm and it consistently fails. Tried install Win32API::SerialPort first, same result. I tested com1 it works. I put a loopback on pins 2-3, still fails.

terminal shows

c:\strawberry>cpanm Win32::SerialPort

--> Working on Win32::SerialPort

Fetching http://www.cpan.org/authors/id/B/BB/BBIRTH/Win32-SerialPort-0.22.tar.gz ... OK

Configuring Win32-SerialPort-0.22 ... OK

Building and testing Win32-SerialPort-0.22 ... FAIL

! Installing Win32::SerialPort failed. See \.cpanm\build.log for details.

from the log file it get...

Test Summary Report

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

t/test1.t (Wstat: 1280 Tests: 309 Failed: 5)

Failed tests: 53, 57, 61, 210, 219

Non-zero exit status: 5

t/test2.t (Wstat: 768 Tests: 146 Failed: 3)

Failed tests: 5-7

Non-zero exit status: 3

t/test3.t (Wstat: 768 Tests: 264 Failed: 3)

Failed tests: 40, 44, 48

Non-zero exit status: 3

t/test4.t (Wstat: 3072 Tests: 518 Failed: 12)

Failed tests: 5-7, 83-85, 232-234, 294-296

Non-zero exit status: 12

Files=7, Tests=1808, 59 wallclock secs ( 0.22 usr + 0.08 sys = 0.30 CPU)

Result: FAIL

Failed 4/7 test programs. 23/1808 subtests failed.

dmake.exe: Error code 255, while making

'test_dynamic'

-> FAIL Installing Win32API::CommPort failed. See \.cpanm

\build.log for details.

I made great use of the serial ports on my activestate install, but am really interested in getting this going on strawberry. Also, I installed Win32::API just fine.

Any hints???

Comment on win32api::commport install fails
Re: win32api::commport install fails
by Anonymous Monk on Nov 01, 2012 at 00:59 UTC

    Any hints???

    Increase verbosity? Look at the logfile? Run one test? Read one test? ...

Re: win32api::commport install fails
by bulk88 (Priest) on Nov 01, 2012 at 03:53 UTC
    My results from installing Win32API::CommPort on Strawberry 5.12.3.
    cpan[1]> install Win32API::CommPort Going to read 'C:\Documents and Settings\Owner\.cpan\Metadata' Database was generated on Tue, 16 Oct 2012 03:31:03 GMT Fetching with LWP: http://cpan.netnitco.net/authors/01mailrc.txt.gz Going to read 'C:\Documents and Settings\Owner\.cpan\sources\authors\0 +1mailrc.tx t.gz' ...................................................................... +......DONE Fetching with LWP: http://cpan.netnitco.net/modules/02packages.details.txt.gz Going to read 'C:\Documents and Settings\Owner\.cpan\sources\modules\0 +2packages. details.txt.gz' Database was generated on Thu, 01 Nov 2012 03:43:03 GMT .............. New CPAN.pm version (v1.9800) available. [Currently running version is v1.9600] You might want to try install CPAN reload cpan to both upgrade CPAN.pm and run the new version without leaving the current session. ..............................................................DONE Fetching with LWP: http://cpan.netnitco.net/modules/03modlist.data.gz Going to read 'C:\Documents and Settings\Owner\.cpan\sources\modules\0 +3modlist.d ata.gz' ...................................................................... +......DONE Going to write C:\Documents and Settings\Owner\.cpan\Metadata Running install for module 'Win32API::CommPort' Running make for B/BB/BBIRTH/Win32-SerialPort-0.22.tar.gz Fetching with LWP: http://cpan.netnitco.net/authors/id/B/BB/BBIRTH/Win32-SerialPort-0.22. +tar.gz Fetching with LWP: http://cpan.netnitco.net/authors/id/B/BB/BBIRTH/CHECKSUMS Checksum for C:\Documents and Settings\Owner\.cpan\sources\authors\id\ +B\BB\BBIRT H\Win32-SerialPort-0.22.tar.gz ok Scanning cache C:\Documents and Settings\Owner\.cpan\build for sizes ...................................................................... +......DONE CPAN.pm: Going to build B/BB/BBIRTH/Win32-SerialPort-0.22.tar.gz found result=0, file=COM1 Win32::SerialPort and Win32API::CommPort VERSION 0.22 A 'Makefile' created for those with 'make' or CPAN.pm users. It will test using PORT = COM1. To test using a different PORT, run again specifying: 'perl Makefile.PL TESTPORT=<PORT>' The normal 'Mantra' would then apply: make make test make install For those without 'make' or an equivalent like 'nmake' or 'dmake' ther +e are perl-only scripts which do the same things: Test with: perl nomake_test Install with: perl nomake_install Test with nothing connected to COM1. PORT is not verified present and accessible until tests run. Timeout tests can take up to 30 seconds per test. Creating new t/DefaultPort.pm Creating new nomake_test Creating new nomake_install Checking if your kit is complete... Looks good Writing Makefile for Win32::SerialPort Could not read metadata file. Falling back to other methods to determi +ne prerequ isites Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved. syntax error at -e line 1, near "'755') " Missing right curly or square bracket at -e line 1, at end of line Execution of -e aborted due to compilation errors. NMAKE : fatal error U1077: 'C:\sperl\perl\bin\perl.exe' : return code +'0xff' Stop. BBIRTH/Win32-SerialPort-0.22.tar.gz C:/PROGRA~1/MICROS~2.NET/Vc7/bin/nmake.exe -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: BBIRTH/Win32-SerialPort-0.22.tar.gz : make NO cpan[2]>
    update: this output is from a broken cpan shell installation, please ignore

      The only error there (relatively hidden in the middle of the wall of output) is:

      syntax error at -e line 1, near "'755') " Missing right curly or square bracket at -e line 1, at end of line

      In context, that appears to be a problem with the parsing of the generated Makefile. It looks like nmake was run but the Makefile wasn't generated in a manner compatible with nmake. And given that it said to run "make ..." several places, that doesn't surprise me.

      If I had gotten that output and wanted to get the module installed, my next step would be to follow this nugget of the instructions nestled in that wall of output:

      For those without 'make' or an equivalent like 'nmake' or 'dmake' ther +e are perl-only scripts which do the same things: Test with: perl nomake_test Install with: perl nomake_install

      - tye        

        Whoops. cpan is having a conflict between the ActivePerl and Strawberry configs since they are sharing the same folder in my home dir.
Re: win32api::commport install fails
by BrowserUk (Pope) on Nov 01, 2012 at 08:35 UTC

    What do you mean that this:

    t/test1.t (Wstat: 1280 Tests: 309 Failed: 5) Failed tests: 53, 57, 61, 210, 219 Non-zero exit status: 5 t/test2.t (Wstat: 768 Tests: 146 Failed: 3) Failed tests: 5-7 Non-zero exit status: 3 t/test3.t (Wstat: 768 Tests: 264 Failed: 3) Failed tests: 40, 44, 48 Non-zero exit status: 3 t/test4.t (Wstat: 3072 Tests: 518 Failed: 12) Failed tests: 5-7, 83-85, 232-234, 294-296 Non-zero exit status: 12 Files=7, Tests=1808, 59 wallclock secs ( 0.22 usr + 0.08 sys = 0.30 CP +U) Result: FAIL Failed 4/7 test programs. 23/1808 subtests failed. dmake.exe: Error code 255, while making 'test_dynamic' -> FAIL Installing Win32API::CommPort failed. See \.cpanm \build.log for details.

    doesn't tell anything more useful than if it said: It's F***ED!".

    They'll have you know, that the Perl Test::*straight jacket suite is state-of-the-art(*).

    (*Ie, It copied Java's, so it must be good; Right?!)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

      Yes, prove sucks. A lot. I recall it not sucking this bad. The "summary" output is way too verbose and yet almost everything in the summary is useless (and much of it is just purely incorrect). Meanwhile, it is doing a great job of hiding from the user what would be less output but that would be extremely informative.

      What's worse, the current implementation of prove is like some doctoral thesis on how to over-engineer software using rampant application of inheritance, factories, and "pure" layers of abstraction (that appear to have no use other than adding layers of abstraction). And this makes it extremely time-consuming to find the bit of code that is at fault each time I go to make a tiny improvement to it.

      Trying to follow the flow of prove's code, you repeatedly get the impression that extreme effort was exerted for the sole purpose of making it difficult to follow the code flow.

      You get to a promising-sounding class only to find it has no code that does anything real at all. It just contains a method called 'run' that does nothing other than call a method called 'next' on something else. So you go to find where that something was created so you can know the class name so you can go read the code for that class to see what the 'next' method does. But the code that creates that "something else" is a factory where the class name used is derived via complex means hidden under several layers of abstraction.

      After spending a significant amount of time trying to navigate those several layers of abstraction, you finally come up with another promising-sounding class name. So you go read the code for it and you even find a 'next' method. Unfortunately, all it does is dereference a code reference that was created by some other code. Now you don't even have a method name to aid your next search step.

      Now I've spent an hour or two trying to just find what is surely a very simple couple of lines of Perl code that I'm sure I could fix in a matter of minutes because the specific problem I'm trying to address is a very simple problem, but I don't get three hours of uninterrupted time at work hardly ever so I have to go to a meeting or help somebody with some issue and after that, the dozens of layers of pure abstraction have mostly fallen out of my head and I'm nearly starting over from the beginning if I want to look for the needle of functional, practical code in the haystack of dozens of pure abstraction layers.

      I think I'll next just install an old version of 'prove' and see if the output is tons more useful (like I remember). If not, at least I can tell from the much shorter list of modules that are included (and the fact that these modules have practical-sounding names rather than names that sound like theoretical abstraction layers) that I'll be able to make fixes without needing hours and hours of time to fill my head with dozens of pure layers of abstraction.

      (At least none of the layers are (yet) hiding behind a truly enormous pile of code like if they started using Moose... *shudder*)

      - tye        

        and "pure" layers of abstraction (that appear to have no use other than adding layers of abstraction).

        When abstraction becomes distraction, it has failed.

        the current implementation of prove is like some doctoral thesis on how to over-engineer software

        Putting the woe in O'Woe (Order of Worshipful Over Engineers).

        (At least none of the layers are (yet) hiding behind a truly enormous pile of code like if they started using Moose... *shudder*)

        The OO in s-l-o-o-w!


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        RIP Neil Armstrong

Re: win32api::commport install fails
by Khen1950fx (Canon) on Nov 01, 2012 at 11:26 UTC
    Test your dependencies. You might think that you have them all, but the chances are good that you don't. It's a common problem. Here's a little cpan shell script to get you started. After you ckeck the dependencies, then try reinstalling Win32API::CommPort.
    #!perl use strict; use autodie; use warnings; use CPAN; CPAN::Shell->install(qw( Task::DualLived IO::Pty Test::Pod Devel::Symdump Pod::Coverage Sub::Exporter Data::OptList Params::Util Pod::Eventual IO::String Mixin::Linewise::Readers Pod::Coverage::TrustPod Test::Pod::Coverage Parse::CPAN::Meta AppConfig Template::Config Unicode::Japanese YAML YAML::Syck YAML::XS YAML::Tiny Test::YAML::Valid Test::CPAN::Meta Email::Address Config::Tiny PPIx::Regexp String::Format Perl::Tidy Pod::Wordlist Pod::Spell Class::Data::Inheritable Devel::StackTrace Exception::Class Readonly PPIx::Utilities::Statement Test::Deep B::Keywords Perl::Critic Perl::Critic::Utils IPC::Run3 Probe:Perl Test::Script File::Find::Rule::Perl List::MoreUtils Task::Weaken Class::Inspector Hook::LexWrap Test::SubCalls Clone Test::Tester Test::NoWarnings Test::Object File::Remove PPI Text::Glob Number::Compare File::Find::Rule Perl::MinimumVersion Test::MinimumVersion IPC::Run Digest::SHA::PurePerl Digest::SHA256 Test::Manifest Crypt::Rijndael Crypt::Blowfish Crypt::Blowfish_PP Crypt::CBC Crypt::CAST5 Crypt::DES Crypt::RIPEMD160 Tie::EncryptedHash Class::Loader Convert::ASCII::Armour Data::Buffer Digest::MD2 Math::Pari Crypt::Random Crypt::Primes Digest::SHA1 Crypt::DES_EDE3 Crypt::DSA Crypt::RSA Convert::ASN1 Convert::PEM GnuPG File::HomeDir Data::Buffer File::Which Crypt::OpenPGP Module::Signature Test::Signature Term::ReadKey Device::Port Win32::Process));

      Test your dependencies.....

      IGNORE

        I always IGNORE anonymonks, but thanks for the warning anyway.
Re: win32api::commport install fails
by bulk88 (Priest) on Nov 01, 2012 at 19:18 UTC
    Fixed my cpan shell setup (compared to Re: win32api::commport install fails).
    cpan> install Win32API::CommPort Fetching with LWP: http://cpan.strawberryperl.com/authors/01mailrc.txt.gz Fetching with LWP: http://cpan.strawberryperl.com/modules/02packages.details.txt.gz Fetching with LWP: http://cpan.strawberryperl.com/modules/03modlist.data.gz Database was generated on Mon, 12 Mar 2012 05:39:42 GMT Updating database file ... Gathering information from index files ... Obtaining current state of database ... Populating database tables ... Done! Running install for module 'Win32API::CommPort' Running make for B/BB/BBIRTH/Win32-SerialPort-0.22.tar.gz Fetching with LWP: http://cpan.strawberryperl.com/authors/id/B/BB/BBIRTH/Win32-SerialPort +-0.22.tar. gz Fetching with LWP: http://cpan.strawberryperl.com/authors/id/B/BB/BBIRTH/CHECKSUMS Checksum for C:\sperl\cpan\sources\authors\id\B\BB\BBIRTH\Win32-Serial +Port-0.22. tar.gz ok Scanning cache C:\sperl\cpan\build for sizes ...................................................................... +......DONE CPAN.pm: Going to build B/BB/BBIRTH/Win32-SerialPort-0.22.tar.gz found result=0, file=COM1 Win32::SerialPort and Win32API::CommPort VERSION 0.22 A 'Makefile' created for those with 'make' or CPAN.pm users. It will test using PORT = COM1. To test using a different PORT, run again specifying: 'perl Makefile.PL TESTPORT=<PORT>' The normal 'Mantra' would then apply: make make test make install For those without 'make' or an equivalent like 'nmake' or 'dmake' ther +e are perl-only scripts which do the same things: Test with: perl nomake_test Install with: perl nomake_install Test with nothing connected to COM1. PORT is not verified present and accessible until tests run. Timeout tests can take up to 30 seconds per test. Creating new t/DefaultPort.pm Creating new nomake_test Creating new nomake_install Checking if your kit is complete... Looks good Writing Makefile for Win32::SerialPort Could not read metadata file. Falling back to other methods to determi +ne prerequ isites cp lib/Win32/SerialPort.pm blib\lib\Win32\SerialPort.pm cp lib/Win32API/CommPort.pm blib\lib\Win32API\CommPort.pm BBIRTH/Win32-SerialPort-0.22.tar.gz C:\sperl\c\bin\dmake.EXE -- OK Running make test C:\sperl\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harnes +s(0, 'blib \lib', 'blib\arch')" t/*.t t/test1.t .. ok t/test2.t .. ok t/test3.t .. ok t/test4.t .. ok t/test5.t .. ok t/test6.t .. 1/? SetCommState failed at t/test6.t line 306 t/test6.t .. ok t/test7.t .. ok All tests successful. Files=7, Tests=1808, 61 wallclock secs ( 0.24 usr + 0.06 sys = 0.30 +CPU) Result: PASS BBIRTH/Win32-SerialPort-0.22.tar.gz C:\sperl\c\bin\dmake.EXE test -- OK Running make install Prepending C:\sperl\cpan\build\Win32-SerialPort-0.22-Gz506L/blib/arch +C:\sperl\c pan\build\Win32-SerialPort-0.22-Gz506L/blib/lib to PERL5LIB for 'insta +ll' Installing C:\sperl\perl\site\lib\Win32\SerialPort.pm Installing C:\sperl\perl\site\lib\Win32API\CommPort.pm Appending installation info to C:\sperl\perl\lib/perllocal.pod BBIRTH/Win32-SerialPort-0.22.tar.gz C:\sperl\c\bin\dmake.EXE install UNINST=1 -- OK cpan> o conf $CPAN::Config options from C:\sperl\perl\lib/CPAN/Config.pm: commit [Commit changes to disk] defaults [Reload defaults from disk] help [Short help about 'o conf' usage] init [Interactive setting of all options] applypatch [] auto_commit [1] build_cache [10] build_dir [C:\sperl\cpan\build] build_dir_reuse [0] build_requires_install_policy [yes] bzip2 [] cache_metadata [0] check_sigs [0] colorize_debug undef colorize_output [0] colorize_print [bold blue on_white] colorize_warn [bold red on_white] commandnumber_in_prompt [0] commands_quote undef connect_to_internet_ok undef cpan_home [C:\sperl\cpan] curl [] dontload_hash undef dontload_list undef ftp [C:\WINDOWS\system32\ftp.EXE] ftp_passive [1] ftp_proxy [] ftpstats_period undef ftpstats_size undef getcwd [cwd] gpg [] gzip [ ] halt_on_failure undef histfile [C:\sperl\cpan\histfile] histsize [100] http_proxy [] inactivity_timeout [0] index_expire [1] inhibit_startup_message [0] keep_source_where [C:\sperl\cpan\sources] load_module_verbosity [none] lynx [] make [C:\sperl\c\bin\dmake.EXE] make_arg [] make_install_arg [UNINST=1] make_install_make_command undef makepl_arg [] mbuild_arg [] mbuild_install_arg [--uninst 1] mbuild_install_build_command undef mbuildpl_arg [] ncftp [] ncftpget [] no_proxy [] pager [C:\WINDOWS\system32\more.COM] password undef patch [C:\sperl\c\bin\patch.exe] patches_dir undef perl5lib_verbosity undef prefer_external_tar undef prefer_installer [MB] prefs_dir [C:\sperl\cpan\prefs] prerequisites_policy [follow] proxy_pass undef proxy_user undef randomize_urllist undef scan_cache [atstart] shell [C:\WINDOWS\system32\cmd.exe] show_unparsable_versions [0] show_upload_date [1] show_zero_versions [0] tar [ ] tar_verbosity [none] term_is_latin [0] term_ornaments [0] test_report [0] trust_test_report_history undef unzip [] urllist 0 [http://cpan.strawberryperl.com/] 1 [http://www.cpan.org/] use_sqlite [1] username undef version_timeout undef wait_list undef wget [] yaml_load_code [0] yaml_module [YAML] cpan>
    You said you installed a loopback device on your serial port, disconnect it and try to install again. I have a physical 9 pin serial port on COM1 with nothing attached when I have the above. Maybe the test was designed to have nothing attached during the test, just like it would be on a cpan tester's machine.
      Maybe the test was designed to have nothing attached during the test

      I believe that is why the output you quoted contains:

      Test with nothing connected to COM1.

      (:

      - tye        

      Not sure why, but it worked!

      Ran install with loopback installed and it failed, said there was a modem on com1. Removed it and tried again and it passed. I did try both ways last week with failing results. The only difference I see, beside the beers over the weekend, is running install from cpan shell, rather than cpanm from command window prompt.

      Either way, it was enough of a hint and it worked. PerlMonks comes through again. Thanks folks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1001760]
Approved by bulk88
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-07-10 00:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (197 votes), past polls