Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 24283
Status: resolved
Priority: 0/
Queue: version

People
Owner: Nobody in particular
Requestors: cg2v [...] andrew.cmu.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.69



Subject: makemaker build doesn't work on solaris w/cc
Date: Mon, 8 Jan 2007 18:26:05 -0500 (EST)
To: bug-version [...] rt.cpan.org
From: Chaskiel Grundman <cg2v [...] andrew.cmu.edu>
CPAN.pm: Going to build J/JP/JPEACOCK/version-0.68.tar.gz Testing if you have a C compiler ld: fatal: file test.o: unknown file type ld: fatal: File processing errors. No output written to test.o I cannot determine if you have a C compiler so I will install a perl-only implementation You can force installation of the XS version with perl Makefile.PL --xs Checking if your kit is complete... Looks good Writing Makefile for version cp lib/version.pm blib/lib/version.pm cp lib/version.pod blib/lib/version.pod cp vperl/vpp.pm blib/lib/version/vpp.pm Running Mkbootstrap for version () chmod 644 version.bs rm -f blib/arch/auto/version/version.so /opt/SUNWspro/bin/cc -G -L/opt/SUNWspro/prod/lib -L/usr/contributed/lib -L/usr/local/lib version.o -o blib/arch/auto/version/version.so \ \ ld: fatal: file version.o: open failed: No such file or directory ld: fatal: File processing errors. No output written to blib/arch/auto/version/version.so gmake: *** [blib/arch/auto/version/version.so] Error 1 There seem to be two problems. One is that _check_for_compiler_manually uses $Config{obj_ext} instead of $Config{exe_ext} (or that a '-c' is missing from the $cc command line) The other is that no_cc() does not seem to do the right thing. if I 'perl Makefile.PL --perl_only', then the bogus version.so stuff doesn't happen. This seems to be because write_makefile() is called while test.c still exists. The following patch seems to fix both problems (I tested each independently) --- version-0.68y/Makefile.PL Mon Jan 8 18:18:57 2007 +++ version-0.68/Makefile.PL Mon Jan 8 18:21:52 2007 @@ -28,7 +28,7 @@ check_for_compiler() or no_cc(); - map { unlink $_ if -f $_ } ('test.c',"test$Config{obj_ext}"); + map { unlink $_ if -f $_ } ('test.c',"test$Config{exe_ext}"); } @@ -101,8 +101,6 @@ EOF - write_makefile(); - exit; } sub check_for_compiler @@ -146,7 +144,7 @@ $cc .= ' -c'; # prevent it from calling the linker } - system( "$cc -o test$Config{obj_ext} test.c" ) and return 0; + system( "$cc -o test$Config{exe_ext} test.c" ) and return 0; return 1; }
Subject: Re: [rt.cpan.org #24283] makemaker build doesn't work on solaris w/cc
Date: Mon, 08 Jan 2007 19:14:41 -0500
To: bug-version [...] rt.cpan.org
From: John Peacock <jpeacock [...] rowman.com>
cg2v@andrew.cmu.edu via RT wrote: Show quoted text
> There seem to be two problems. > > One is that _check_for_compiler_manually uses $Config{obj_ext} instead of > $Config{exe_ext} (or that a '-c' is missing from the $cc command line)
Well, I consider the problem to be that I didn't ask the compiler to automatically call the linker, but I seem to be in the minority on that count. I don't need to link anything, merely to compile it. Show quoted text
> The other is that no_cc() does not seem to do the right thing. if I 'perl > Makefile.PL --perl_only', then the bogus version.so stuff doesn't happen. > This seems to be because write_makefile() is called while test.c still > exists.
If I fix the first problem (not needing to link anything at all), then this code will again work as designed. Can you give this a trial: === Makefile.PL ================================================================== --- Makefile.PL (revision 243) +++ Makefile.PL (local) @@ -142,11 +142,8 @@ close F or return 0; my $cc = $Config{cc}; - if ( $cc =~ /cl(\.exe)?$/ ) { # stupid stupid MSVC compiler - $cc .= ' -c'; # prevent it from calling the linker - } - system( "$cc -o test$Config{obj_ext} test.c" ) and return 0; + system( "$cc -c -o test$Config{obj_ext} test.c" ) and return 0; return 1; } (i.e. just force the -c to always be passed)? John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Blvd Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747
Subject: Re: [rt.cpan.org #24283] makemaker build doesn't work on solaris w/cc
Date: Mon, 8 Jan 2007 21:02:54 -0500 (EST)
To: John Peacock via RT <bug-version [...] rt.cpan.org>
From: Chaskiel M Grundman <cg2v [...] andrew.cmu.edu>
On Mon, 8 Jan 2007, John Peacock via RT wrote: Show quoted text
> If I fix the first problem (not needing to link anything at all), then > this code > will again work as designed. Can you give this a trial:
The patch does indeed solve the problem I was having. However, if $Config{cc} is missing for some reason, it still fails. If you actually care about that situation, you should still apply the second hunk of my patch. air /tmp/version-0.68 > perl58 Makefile.PL Testing if you have a C compiler I cannot determine if you have a C compiler so I will install a perl-only implementation You can force installation of the XS version with perl Makefile.PL --xs Checking if your kit is complete... Looks good Writing Makefile for version air /tmp/version-0.68 > make cp lib/version.pm blib/lib/version.pm cp lib/version.pod blib/lib/version.pod cp vperl/vpp.pm blib/lib/version/vpp.pm Running Mkbootstrap for version () chmod 644 version.bs rm -f blib/arch/auto/version/version.so /opt/SUNWspro/bin/cc -G -L/opt/SUNWspro/prod/lib -L/usr/contributed/lib -L/usr/local/lib version.o -o blib/arch/auto/version/version.so \ \ sh: /opt/SUNWspro/bin/cc: not found *** Error code 1 make: Fatal error: Command failed for target `blib/arch/auto/version/version.so'
Subject: Re: [rt.cpan.org #24283] makemaker build doesn't work on solaris w/cc
Date: Tue, 09 Jan 2007 09:24:35 -0500
To: bug-version [...] rt.cpan.org
From: John Peacock <jpeacock [...] rowman.com>
cg2v@andrew.cmu.edu via RT wrote: Show quoted text
> However, if $Config{cc} is missing for some reason, it still fails. If > you actually care about that situation, you should still apply the second > hunk of my patch.
I think your files were in an indeterminate state. On a freshly untarred folder, the code won't try to build the C library unless the check for a compiler succeeded. I create a new Makefile.PL inside ./vutil iff a compiler was found. In your case, you took away the compiler after that Makefile.PL had been created, so EU::MM helpfully tried to run it anyways. I'll add code to nuke that file at the top of the main Makefile.PL regardless of the result of _check_c_compile, just to be on the safe side. Thanks for your help... John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
Subject: Re: [rt.cpan.org #24283] makemaker build doesn't work on solaris w/cc
Date: Tue, 9 Jan 2007 17:25:39 -0500 (EST)
To: John Peacock via RT <bug-version [...] rt.cpan.org>
From: Chaskiel Grundman <cg2v [...] andrew.cmu.edu>
Show quoted text
> I think your files were in an indeterminate state. On a freshly > untarred folder, the code won't try to build the C library unless the > check for a compiler succeeded. I create a new Makefile.PL inside > ./vutil iff a compiler was found.
No, really, the problem is that makemaker sees test.c and gets confused. air /tmp/version-0.68 > make distclean rm -rf vutil/Makefile.PL ./blib Makefile.aperl blib/arch/auto/version/extralibs.all perlmain.c mon.out core core.*perl.*.? *perl.core so_locations pm_to_blib *.o *.a perl.exe version.bs version.bso version.def version.exp mv Makefile Makefile.old > /dev/null 2>&1 rm -rf blib/lib/auto/version blib/arch/auto/version rm -f blib/arch/auto/version/version.so blib/arch/auto/version/version.bs rm -f blib/arch/auto/version/version.a rm -f blib/lib/version.pm blib/lib/version/vpp.pm rm -f blib/lib/version.pod rm -rf Makefile Makefile.old /usr/local/bin/perl -I/usr/local/lib/perl5/5.6.1 -I/usr/local/lib/perl5/5.6.1 -MExtUtils::Manifest=fullcheck \ -e fullcheck Not in MANIFEST: test.c air /tmp/version-0.68 > perl Makefile.PL Testing if you have a C compiler /usr/ucb/cc: language optional software package not installed I cannot determine if you have a C compiler so I will install a perl-only implementation You can force installation of the XS version with perl Makefile.PL --xs Checking if your kit is complete... Looks good Writing Makefile for version cg2v has logged on pts/2 from dhcp-57-63. air /tmp/version-0.68 > make cp lib/version.pm blib/lib/version.pm cp lib/version.pod blib/lib/version.pod cp vperl/vpp.pm blib/lib/version/vpp.pm Running Mkbootstrap for version () chmod 644 version.bs rm -f blib/arch/auto/version/version.so LD_RUN_PATH="" cc -G -L/usr/contributed/lib -L/usr/local/lib -L/opt/SUNWspro/WS6U1/lib version.o -o blib/arch/auto/version/version.so /usr/ucb/cc: language optional software package not installed *** Error code 1 make: Fatal error: Command failed for target `blib/arch/auto/version/version.so' air /tmp/version-0.68 > ls vutil/ lib ppport.h vutil.c vutil.h vxs.xs
Subject: Re: [rt.cpan.org #24283] makemaker build doesn't work on solaris w/cc
Date: Tue, 09 Jan 2007 20:50:03 -0500
To: bug-version [...] rt.cpan.org
From: John Peacock <jpeacock [...] rowman.com>
cg2v@andrew.cmu.edu via RT wrote: Show quoted text
> No, really, the problem is that makemaker sees test.c and gets confused.
But I delete test.c right after the compile (whether it succeeds or not). Your proposed diff: - map { unlink $_ if -f $_ } ('test.c',"test$Config{obj_ext}"); + map { unlink $_ if -f $_ } ('test.c',"test$Config{exe_ext}"); only changed the obj_ext to exe_ext. I can't explain why the unlink is failing for you. Can I ask you to wash/rinse/repeat? Blow the whole directory away, untar it fresh, uninstall the cc, and run 'perl Makefile.PL' then show me the contents of the top level directory (better yet 'ls -R')... John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Blvd Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747
Subject: Re: [rt.cpan.org #24283] makemaker build doesn't work on solaris w/cc
Date: Tue, 9 Jan 2007 22:51:48 -0500 (EST)
To: John Peacock via RT <bug-version [...] rt.cpan.org>
From: Chaskiel Grundman <cg2v [...] andrew.cmu.edu>
The unlink isn't failing. no_cc calls write_makefile before the unlink occurs. That's why I wanted you to apply the second hunk of my patch, which removes the write_makefile(); exit; from no_cc();
Subject: Re: [rt.cpan.org #24283] makemaker build doesn't work on solaris w/cc
Date: Wed, 10 Jan 2007 07:49:53 -0500
To: bug-version [...] rt.cpan.org
From: John Peacock <jpeacock [...] rowman.com>
cg2v@andrew.cmu.edu via RT wrote: Show quoted text
> The unlink isn't failing. no_cc calls write_makefile before the unlink > occurs. That's why I wanted you to apply the second hunk of my patch, > which removes the write_makefile(); exit; from no_cc();
OK! Thanks for typing slowly, I got it that time. ;-) I restructured the code so that _check_for_compiler_manually cleans up after itself, which is what ExtUtils::CBuilder does as well. Actually, I cleaned up all of the codepaths, since some of the logic predates the current structure (so no_cc no longer needs to short-circuit the makefile). I tested it with and without a C compiler and with and without EU::CBuilder. Thanks for helping me improve the program. Expect 0.69 to hit CPAN later today... John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Blvd Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747
Duh. Fixed in 0.69