FAQ
This test builds a list of extensions using File::Find, but that only returns a list of filenames, not extension names, and filenames might be all lower or all upper case depending on the OS and filesystem (the C library returns lower case on VMS). The results in this instance do not match the contents of $Config{extensions}, so deletions from the %Core_Modules hash based on existence there are noops, as are the explicit deletions of CGI:Fast, Devel::Dprof, etc.

I was about to work up a patch that deleted a downcased version of everything otherwise deleted from %Core_Modules, but I was wondering why we even bother with File::Find at all rather than starting directly from $Config{extensions}?

Search Discussions

  • Jarkko Hietaniemi at Jan 24, 2001 at 2:19 am

    On Tue, Jan 23, 2001 at 06:28:10PM -0600, Craig A. Berry wrote:
    This test builds a list of extensions using File::Find, but that only returns a list of filenames, not extension names, and filenames might be all lower or all upper case depending on the OS and filesystem (the C library returns lower case on VMS). The results in this instance do not match the contents of $Config{extensions}, so deletions from the %Core_Modules hash based on existence there are noops, as are the explicit deletions of CGI:Fast, Devel::Dprof, etc.

    I was about to work up a patch that deleted a downcased version of everything otherwise deleted from %Core_Modules, but I was wondering why we even bother with File::Find at all rather than starting directly from $Config{extensions}?
    Because it's not just the extensions we are checking but all the library
    files and pragmas, do they compile or not.

    --
    $jhi++; # http://www.iki.fi/jhi/
    # There is this special biologist word we use for 'stable'.
    # It is 'dead'. -- Jack Cohen
  • Spider Boardman at Jan 24, 2001 at 2:25 am
    On Tue, 23 Jan 2001 20:19:30 -0600, Jarkko Hietaniemi wrote (in part):

    jhi> Because it's not just the extensions we are checking but all
    jhi> the library files and pragmas, do they compile or not.

    Given that, and the case-[in]sensitivity issues, maybe the scan
    should be done by reading from F<MANIFEST>, with suitable
    knowledge of how to translate from ext/.../foo to lib/.../foo
    (skipping extensions not built)? I think that such a solution
    raises *.PL issues, though, so it's not as a trivial change as
    one might wish.

    --
    Spider Boardman (at home) spider@Orb.Nashua.NH.US
    The management (my cats) made me say this. http://www.ultranet.com/~spiderb
    PGP public key fingerprint: 96 72 D2 C6 E0 92 32 89 F6 B2 C2 A0 1C AB 1F DC
  • Jarkko Hietaniemi at Jan 24, 2001 at 2:48 am

    On Tue, Jan 23, 2001 at 06:28:10PM -0600, Craig A. Berry wrote:
    This test builds a list of extensions using File::Find, but that only returns a list of filenames, not extension names, and filenames might be all lower or all upper case depending on the OS and filesystem (the C library returns lower case on VMS). The results in this instance do not match the contents of $Config{extensions}, so deletions from the %Core_Modules hash based on existence there are noops, as are the explicit deletions of CGI:Fast, Devel::Dprof, etc.

    I was about to work up a patch that deleted a downcased version of everything otherwise deleted from %Core_Modules, but I was wondering why we even bother with File::Find at all rather than starting directly from $Config{extensions}?
    I think downcasing everything in the find sub and then deleting downcased
    versions should work just fine.

    >

    --
    $jhi++; # http://www.iki.fi/jhi/
    # There is this special biologist word we use for 'stable'.
    # It is 'dead'. -- Jack Cohen
  • Craig A. Berry at Jan 24, 2001 at 6:10 am

    At 8:47 PM -0600 1/23/01, Jarkko Hietaniemi wrote:
    On Tue, Jan 23, 2001 at 06:28:10PM -0600, Craig A. Berry wrote:

    I was about to work up a patch that deleted a downcased version of
    everything otherwise deleted from %Core_Modules, but I was
    wondering why we even bother with File::Find at all rather than
    starting directly from $Config{extensions}?
    I think downcasing everything in the find sub and then deleting downcased
    versions should work just fine.
    The find sub already downcases (that's where the problem comes from)
    but I've added hacks to other places to delete downcased versions
    from the hash. The only tests that don't pass now seem to be genuine
    problems. It thinks it has Thread but it doesn't, and Byteloader
    doesn't get put under lib during the build.

    This against 8531. Probably best to test on a case sensitive
    filesystem before applying.

    --- t/lib/1_compile.t;-0 Tue Jan 23 09:38:13 2001
    +++ t/lib/1_compile.t Tue Jan 23 22:54:48 2001
    @@ -23,7 +23,13 @@
    # Delete stuff that can't be tested here.

    sub delete_unless_in_extensions {
    - delete $Core_Modules{$_[0]} unless $Config{extensions} =~ /\b$_[0]\b/;
    + unless ($Config{extensions} =~ /\b$_[0]\b/i) {
    + if ($^O eq 'VMS') {
    + delete $Core_Modules{lc($_[0])};
    + } else {
    + delete $Core_Modules{$_[0]};
    + }
    + }
    }

    foreach my $known_extension (split(' ', $Config{known_extensions})) {
    @@ -31,12 +37,16 @@
    }

    sub delete_by_prefix {
    - delete @Core_Modules{grep { /^$_[0]/ } keys %Core_Modules};
    + my $prefix_to_delete = $_[0];
    + $prefix_to_delete = lc($prefix_to_delete) if $^O eq 'VMS';
    + delete @Core_Modules{grep { /^$prefix_to_delete/ } keys %Core_Modules};
    }

    delete $Core_Modules{'CGI::Fast'}; # won't load without FCGI
    +delete $Core_Modules{'cgi::fast'} if $^O eq 'VMS';

    delete $Core_Modules{'Devel::DProf'}; # needs to be run as -d:DProf
    +delete $Core_Modules{'devel::dprof'} if $^O eq 'VMS';

    delete_by_prefix('ExtUtils::MM_'); # ExtUtils::MakeMaker's domain

    @@ -45,6 +55,7 @@

    unless ($Config{extensions} =~ /\bThread\b/) {
    delete $Core_Modules{Thread};
    + delete $Core_Modules{thread} if $^O eq 'VMS';
    delete_by_prefix('Thread::');
    }

    @@ -71,5 +82,5 @@
    sub compile_module {
    my($module) = @_;

    - return scalar `./perl -Ilib t/lib/compmod.pl $module` =~ /^ok/;
    + return scalar `./perl -"Ilib" t/lib/compmod.pl $module` =~ /^ok/;
    }
    [end of patch]
    --
    ____________________________________________
    Craig A. Berry
    mailto:craig.berry@psinetcs.com

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedJan 24, '01 at 1:50a
activeJan 24, '01 at 6:10a
posts5
users3
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase