Re: Broken Cygwin?
On 29 May 2014 02:55, Karen Etheridge wrote: > Devel::CheckLib can be employed within Makefile.PL to check for the > existence of required libraries or headers, before attempting to install > the distribution. (There's also a Dist::Zilla plugin to mangle your > Makefile.PL/Build.PL for you.) Thank you for your helpful response. I apologize for repeating myself, but as I said above, libcrypt.h is required by Perl, not by my module. My module doesn't directly need libcrypt.h. It isn't practical for me to add tests for every library required by Perl to Makefile.PL. Also this error seems to indicate that Perl itself is not working correctly on the testing machine. If you look at the part of my module which creates the problem: https://metacpan.org/source/BKB/Encode-Detective-0.06/Detective.xs#L38 you can see it only gets as far as including two essential header files. Everything else is just comments, then it includes two vital header files, then the compilation dies with the error mentioned in the test report: http://www.cpantesters.org/cpan/report/28d3abb8-e5ca-11e3-b252-b7fca94d63a3 I am most probably wrong of course, but I suspect the testing machine is in error here, which is why I brought the issue up.
Re: Broken Cygwin?
On 05/28/2014 11:11 AM, Reini Urban wrote: On 05/27/2014 11:03 PM, Ben Bullock wrote: This test report: http://www.cpantesters.org/cpan/report/28d3abb8-e5ca-11e3-b252-b7fca94d63a3 in particular this problem: -- In file included from /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/op.h:653:0, from /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/perl.h:3450, from Detective.xs:38: /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/reentr.h:109:26: fatal error: crypt.h: No such file or directory # include ^ compilation terminated. Makefile:335: recipe for target 'Detective.o' failed make: *** [Detective.o] Error 1 --- looks like a broken test machine to me, I don't think this is fixable at my end. What do you think? It is fixable. You just need to install libcrypt-dev and probably more -dev packages then. There's only libcrypt0 in the dependencies, and this is only needed to run perl, but not to create external XS packages. Oh, sorry. You are right, I mixed it up. You are correct in returning UNKNOWN and his machine needs to be fixed. He will not be able do compile any XS modules.
Re: Broken Cygwin?
On Wed, May 28, 2014 at 11:11:22AM -0500, Reini Urban wrote: > >looks like a broken test machine to me, I don't think this is fixable at my > >end. > > > >What do you think? > > It is fixable. > You just need to install libcrypt-dev and probably more -dev packages then. > > There's only libcrypt0 in the dependencies, and this is only needed > to run perl, but not to create external XS packages. Devel::CheckLib can be employed within Makefile.PL to check for the existence of required libraries or headers, before attempting to install the distribution. (There's also a Dist::Zilla plugin to mangle your Makefile.PL/Build.PL for you.)
Re: Broken Cygwin?
On 05/27/2014 11:03 PM, Ben Bullock wrote: This test report: http://www.cpantesters.org/cpan/report/28d3abb8-e5ca-11e3-b252-b7fca94d63a3 in particular this problem: -- In file included from /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/op.h:653:0, from /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/perl.h:3450, from Detective.xs:38: /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/reentr.h:109:26: fatal error: crypt.h: No such file or directory # include ^ compilation terminated. Makefile:335: recipe for target 'Detective.o' failed make: *** [Detective.o] Error 1 --- looks like a broken test machine to me, I don't think this is fixable at my end. What do you think? It is fixable. You just need to install libcrypt-dev and probably more -dev packages then. There's only libcrypt0 in the dependencies, and this is only needed to run perl, but not to create external XS packages. -- Reini Working towards a true Modern Perl. Slim, functional, unbloated, compile-time optimizable
Re: Broken Cygwin?
Rob, If it helps, I don't have x86_64 cygwin, but line 109 of my cygwin/lib/perl5/5.14/i686-cygwin-threads-64int/CORE/reentr.h is: ... #ifdef I_CRYPT # ifdef I_CRYPT # include # endif ... That's a great idea - thanks so much for sharing. I would think that would be a good solution. Regards, -Nigel smime.p7s Description: S/MIME Cryptographic Signature
Re: Broken Cygwin?
-Original Message- From: Ben Bullock /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/reentr.h:109:26: fatal error: crypt.h: No such file or directory # include ^ compilation terminated. If it helps, I don't have x86_64 cygwin, but line 109 of my cygwin/lib/perl5/5.14/i686-cygwin-threads-64int/CORE/reentr.h is: # include It's wrapped in an #ifdef: #ifdef I_CRYPT # ifdef I_CRYPT # include # endif For me, I_CRYPT is defined and crypt.h is located in: cygwin/usr/include I can run this Inline::C script: # use strict; use warnings; use Inline C => Config => DIRECTORY => './_Inline'; use Inline C => <<'EOC'; void foo() { #ifdef I_CRYPT # include printf("I_CRYPT defined\n"); #else printf("I_CRYPT not defined\n"); #endif } EOC foo(); and it outputs: I_CRYPT defined Cheers, Rob
Re: Broken Cygwin?
On Wed, May 28, 2014 at 9:16 AM, Ben Bullock wrote: > If you look at the error message, the line #include is > included by the Perl header op.h, which is included by the Perl header > perl.h. These files are part of perl. I don't have a line #include > in my module: Perl comes withs its own headers, but that doesn't mean any dependencies are installed. If Perl is installed from an operating system package and not compiled, then I can see how one could have Perl and its headers and not any of its dependencies, which is rather weird, but maybe that's how Cygwin does it. You could do a compilation test of perl.h in your Makefile.PL, but I don't think people do that much. Or you could ignore the report. You might also ask Cygwin experts on the perl5-porters mailing list or #p5p on irc.perl.org and see if they have any suggestions. David
Re: Broken Cygwin?
On 28 May 2014 22:22, Nigel Horne wrote: > That doesn't address the main point: I have not customized anything. Sometimes Cygwin just gets rusty though. > Have you tried to reproduce the problem? No, but I tried installing on my Cygwin here: - Cygwin environment on Windows [ben@grapefruit] {22:06 35} ~ 501 $ cpanm Encode::Detective ! ! Can't write to /usr/lib/perl5/site_perl/5.14 and /usr/local/bin: Installing modules to /cygdrive/c/Users/ben/perl5 ! To turn off this warning, you have to do one of the following: ! - run me as a root or with --sudo option (to install to /usr/lib/perl5/site_perl/5.14 and /usr/local/bin) ! - Configure local::lib your existing local::lib in this shell to set PERL_MM_OPT etc. ! - Install local::lib by running the following commands ! ! cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) ! --> Working on Encode::Detective Fetching http://www.cpan.org/authors/id/B/BK/BKB/Encode-Detective-0.06.tar.gz ... OK Configuring Encode-Detective-0.06 ... OK Building and testing Encode-Detective-0.06 ...OK Successfully installed Encode-Detective-0.06 1 distribution installed [ben@grapefruit] {22:08 28} ~ 502 $ locate crypt.h [ben@grapefruit] {22:09 05} ~ 503 $ more /usr/include/crypt.h /* encrypt.h - API to 56 bit DES encryption via calls encrypt(3), setkey(3) and crypt(3) Copyright (C) 1991 Jochen Obalek As seen above, it looks OK but this is not the same as your setup so I cannot say I have fully tried to reproduce the problem. The text at the top "Cygwin environment on Windows" is printed by my .bashrc. I know that Cygwin is prone to developing problems if it's not updated regularly by re-running "setup.exe". I think I last ran it a week or two ago. > That would help a lot to find out > a fix. I'm very happy to find a fix. The only thing I can think of is that the Cygwin is getting rusty and needs to have setup.exe run again. Because the error doesn't seem to have much to do with my module, I decided to raise the issue with you. However it may actually be my module which is at fault, for example ppport.h may be a wrong version or something.
Re: Broken Cygwin?
On 28/05/2014 09:16, Ben Bullock wrote: On 28 May 2014 21:52, Nigel Horne wrote: This is a standard installation. Please define 'broken'. If #include causes a fatal error like the above it looks broken to me. What do you think? That doesn't address the main point: I have not customized anything. Have you tried to reproduce the problem? That would help a lot to find out a fix. -Nigel smime.p7s Description: S/MIME Cryptographic Signature
Re: Broken Cygwin?
On 28 May 2014 21:52, Nigel Horne wrote: > > This is a standard installation. Please define 'broken'. If #include causes a fatal error like the above it looks broken to me. What do you think? > Your correct behaviour is to return UNKNOWN if crypt.h isn't installed. If you look at the error message, the line #include is included by the Perl header op.h, which is included by the Perl header perl.h. These files are part of perl. I don't have a line #include in my module: [ben@mikan] {22:12 24} Encode-Detective 510 $ ack "crypt.h" * [ben@mikan] {22:12 32} Encode-Detective 511 $ grep "crypt.h" */* [ben@mikan] {22:12 43} Encode-Detective 512 $ grep "crypt.h" * [ben@mikan] {22:12 44} Encode-Detective 513 $ grep "crypt.h" */*/* [ben@mikan] {22:12 48} Encode-Detective 514 $ grep "crypt.h" */*/*/* grep: */*/*/*: No such file or directory [ben@mikan] {22:12 49} Encode-Detective 515 $ The error starts from line 38 of "Detective.xs" where it just has #include "perl.h" I can't not include that.
Re: Broken Cygwin?
On 28/05/2014 00:03, Ben Bullock wrote: This test report: http://www.cpantesters.org/cpan/report/28d3abb8-e5ca-11e3-b252-b7fca94d63a3 in particular this problem: -- In file included from /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/op.h:653:0, from /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/perl.h:3450, from Detective.xs:38: /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/reentr.h:109:26: fatal error: crypt.h: No such file or directory # include ^ compilation terminated. Makefile:335: recipe for target 'Detective.o' failed make: *** [Detective.o] Error 1 --- looks like a broken test machine to me, I don't think this is fixable at my end. This is a standard installation. Please define 'broken'. Your correct behaviour is to return UNKNOWN if crypt.h isn't installed. What do you think? -Nigel smime.p7s Description: S/MIME Cryptographic Signature