Hiya,

I have been doing some thinking about the problem demonstrated with the failing dragonfly tests. BinGOs also mentioned some lesser known BSDs which would suffer from the same diagnostic.

So perhaps either the source phase (perl Makefile.PL/Build.PL) or the test phase could be extended with some test to give the user a heads up, something along the lines of:

if (my $type = Module::Build::os_type($^O) ) {
    warn "Known OS type '$^O' - handled as: $type\n";
} else {
    warn "Unknown OS type '$^O' - using default handling\n";
}

There is no neat to bail out as such, but a word of warning would be quite useful to the user.

I have not investigated how the above suggestion would impact ExtUtils::CBuilder, but I expect it to work out of the box since the code seems to have been lifted out of Module::Build.

In respect to the best practice of DRY. Perhaps a new module: Perl::Ports could be released to contain the functionality and data. POD is nice, but data structures are more accessible.

Just my 5 cents,

jonasbn

On 17/04/2009, at 23.15, Jonas Brømsø Nielsen wrote:

Hi David,

I have done a lot of debugging on dragonfly and the issue proved to be pretty basic.

Module::Build and ExtUtils::CBuilder both do some lookup based on platform, the two lists are inconsistent and dragonfly is not mentioned in the list in CBuilder, so dragonfly is not regarded as a Unix system and the env command is not applied to the link commandline produced in Module::Build's t/xs.t tests (test 13 to be exact).

So updating the list does the job in ExtUtils::CBuilder does the job for dragonfly. The inconsistency does not matter, but the DRY violation is of course a bit ugly.

Code snippets below,

jonasbn

from Module::Build (in Build.pm) version 1.32:

# Okay, this is the brute-force method of finding out what kind of
# platform we're on.  I don't know of a systematic way.  These values
# came from the latest (bleadperl) perlport.pod.

my %OSTYPES = qw(
                 aix       Unix
                 bsdos     Unix
                 dgux      Unix
                 dragonfly Unix
                 dynixptx  Unix
                 freebsd   Unix
                 linux     Unix
                 haiku     Unix
                 hpux      Unix
                 irix      Unix
                 darwin    Unix
                 machten   Unix
                 midnightbsd Unix
                 mirbsd    Unix
                 next      Unix
                 openbsd   Unix
                 netbsd    Unix
                 dec_osf   Unix
                 nto       Unix
                 svr4      Unix
                 svr5      Unix
                 sco_sv    Unix
                 unicos    Unix
                 unicosmk  Unix
                 solaris   Unix
                 sunos     Unix
                 cygwin    Unix
                 os2       Unix
                 interix   Unix
                 gnu       Unix
                 gnukfreebsd Unix

                 dos       Windows
                 MSWin32   Windows

                 os390     EBCDIC
                 os400     EBCDIC
                 posix-bc  EBCDIC
                 vmesa     EBCDIC

                 MacOS     MacOS
                 VMS       VMS
                 VOS       VOS
                 riscos    RiscOS
                 amigaos   Amiga
                 mpeix     MPEiX
                );

from ExtUtils::CBuilder (CBuilder.pm) version 0.24

# Okay, this is the brute-force method of finding out what kind of
# platform we're on.  I don't know of a systematic way.  These values
# came from the latest (bleadperl) perlport.pod.

my %OSTYPES = qw(
                 aix       Unix
                 bsdos     Unix
                 dgux      Unix
                 dynixptx  Unix
                 freebsd   Unix
                 linux     Unix
                 hpux      Unix
                 irix      Unix
                 darwin    Unix
                 machten   Unix
                 next      Unix
                 openbsd   Unix
                 netbsd    Unix
                 dec_osf   Unix
                 svr4      Unix
                 svr5      Unix
                 sco_sv    Unix
                 unicos    Unix
                 unicosmk  Unix
                 solaris   Unix
                 sunos     Unix
                 cygwin    Unix
                 os2       Unix
                 gnu       Unix
                 gnukfreebsd Unix
                
                 dos       Windows
                 MSWin32   Windows

                 os390     EBCDIC
                 os400     EBCDIC
                 posix-bc  EBCDIC
                 vmesa     EBCDIC

                 MacOS     MacOS
                 VMS       VMS
                 VOS       VOS
                 riscos    RiscOS
                 amigaos   Amiga
                 mpeix     MPEiX
                );



On 02/04/2009, at 17.45, David Golden wrote:

Anyone want to volunteer to fix M::B on dragonfly?

http://matrix.cpantesters.org/?dist=Module-Build

-- David


Reply via email to