develooper Front page | perl.perl5.porters | Postings from February 2009

restructuring ext (Re: merging make_ext and make_ext_cross)

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
February 10, 2009 04:57
Subject:
restructuring ext (Re: merging make_ext and make_ext_cross)
Message ID:
20090210125654.GD81285@plum.flirble.org
On Sun, Feb 08, 2009 at 07:36:04PM -0600, Craig A. Berry wrote:

> All the changes I can think of to use make_ext.pl in the VMS build and
> handle flattened extension directories (where Foo::Bar might live
> under ext/Foo-Bar) are now committed and pushed, so let THE PLAN
> proceed.

Thanks.

I've flattened ext:

$ ls -l ext
total 116
drwxr-xr-x   6 nick  nick   512 Feb  9 21:39 B
drwxr-xr-x  10 nick  nick  1024 Feb  9 21:39 Compress-Raw-Zlib
drwxr-xr-x   8 nick  nick   512 Feb  9 21:38 Compress-Zlib
drwxr-xr-x   4 nick  nick   512 Feb  9 21:39 Cwd
drwxr-xr-x   5 nick  nick   512 Feb  9 21:39 DB_File
drwxr-xr-x   4 nick  nick   512 Feb  9 21:39 Data-Dumper
drwxr-xr-x   4 nick  nick   512 Feb  9 21:39 Devel-DProf
drwxr-xr-x   6 nick  nick  1024 Feb  9 21:39 Devel-PPPort
drwxr-xr-x   4 nick  nick   512 Feb  9 21:39 Devel-Peek
drwxr-xr-x   5 nick  nick   512 Feb  9 21:39 Digest-MD5
drwxr-xr-x   7 nick  nick   512 Feb  9 21:39 Digest-SHA
drwxr-xr-x   5 nick  nick  1024 Feb  9 21:38 DynaLoader
drwxr-xr-x  16 nick  nick  1024 Feb  9 21:40 Encode
drwxr-xr-x   4 nick  nick   512 Feb  9 21:38 Errno
drwxr-xr-x   4 nick  nick   512 Feb  9 21:39 Fcntl
drwxr-xr-x   4 nick  nick   512 Feb  9 21:39 File-Glob
drwxr-xr-x   4 nick  nick   512 Feb  9 21:39 Filter-Util-Call
drwxr-xr-x   4 nick  nick   512 Dec 22 14:08 GDBM_File
drwxr-xr-x   5 nick  nick   512 Feb  9 21:39 Hash-Util
drwxr-xr-x   5 nick  nick   512 Feb  9 21:40 Hash-Util-FieldHash
drwxr-xr-x   5 nick  nick   512 Feb  9 21:40 I18N-Langinfo
drwxr-xr-x   6 nick  nick   512 Feb  9 21:40 IO
drwxr-xr-x   7 nick  nick   512 Feb  9 21:38 IO_Compress_Base
drwxr-xr-x   8 nick  nick   512 Feb  9 21:38 IO_Compress_Zlib
drwxr-xr-x   2 nick  nick   512 Feb  9 10:17 IPC
drwxr-xr-x   6 nick  nick   512 Feb  9 21:40 IPC-SysV
drwxr-xr-x   5 nick  nick   512 Feb  9 21:40 List-Util
drwxr-xr-x   4 nick  nick   512 Feb  9 21:40 MIME-Base64
drwxr-xr-x   4 nick  nick   512 Feb  9 21:41 Math-BigInt-FastCalc
drwxr-xr-x   4 nick  nick   512 Feb  9 21:38 Module-Pluggable
drwxr-xr-x   5 nick  nick   512 Feb  9 21:40 NDBM_File
drwxr-xr-x   4 nick  nick   512 Dec 22 14:09 ODBM_File
drwxr-xr-x   4 nick  nick   512 Feb  9 21:40 Opcode
drwxr-xr-x   5 nick  nick   512 Feb  9 21:40 POSIX
drwxr-xr-x   4 nick  nick   512 Feb  9 21:40 PerlIO-encoding
drwxr-xr-x   4 nick  nick   512 Feb  9 21:40 PerlIO-scalar
drwxr-xr-x   5 nick  nick   512 Feb  9 21:40 PerlIO-via
drwxr-xr-x   5 nick  nick   512 Feb  9 21:40 SDBM_File
drwxr-xr-x   3 nick  nick   512 Dec 22 14:09 Safe
drwxr-xr-x   4 nick  nick   512 Feb  9 21:40 Socket
drwxr-xr-x   5 nick  nick   512 Feb  9 21:40 Storable
drwxr-xr-x   4 nick  nick   512 Feb  9 21:40 Sys-Hostname
drwxr-xr-x   7 nick  nick   512 Feb  9 21:40 Sys-Syslog
drwxr-xr-x   6 nick  nick   512 Feb  9 21:39 Test-Harness
drwxr-xr-x   4 nick  nick   512 Feb  9 21:40 Text-Soundex
drwxr-xr-x   6 nick  nick   512 Feb  9 21:41 Time-HiRes
drwxr-xr-x   4 nick  nick   512 Feb  9 21:40 Time-Piece
drwxr-xr-x   4 nick  nick   512 Feb  9 21:41 Unicode-Normalize
drwxr-xr-x   3 nick  nick   512 Jan 30 19:25 Win32
drwxr-xr-x   4 nick  nick   512 Feb  9 21:38 Win32API-File
drwxr-xr-x   3 nick  nick   512 Dec 22 14:09 Win32CORE
drwxr-xr-x   4 nick  nick   512 Feb  9 21:41 XS-APItest
drwxr-xr-x   4 nick  nick   512 Feb  9 21:41 XS-Typemap
drwxr-xr-x   4 nick  nick   512 Feb  9 21:41 attrs
drwxr-xr-x   3 nick  nick   512 Feb  9 21:41 mro
drwxr-xr-x   5 nick  nick   512 Feb  9 21:41 re
drwxr-xr-x   5 nick  nick   512 Feb  9 21:41 threads
drwxr-xr-x   5 nick  nick   512 Feb  9 21:41 threads-shared


There's now a one to one mapping between directories in ext, and extensions.
I've removed the code from Configure and win32/FindExt.pm that recurses to
look for extensions, and changed them to assume that every directory in ext
is an extension.

(This gets a bit messy if one updates an existing build tree before running
make distclean. This is an understatement. I suspect it might even be messy
with distclean, due to the ongoing failure of distclean on ext/Test-Harness)


To do this, ext/Safe has become a proper extension (with, for now, a
Makefile.PL), and Safe.pm has moved there from inside ext/Opcode. However, this
means that it's now a new, listed, nonxs_ext

I had assumed that all this re-arranging was valid for maint-5.10 too, as
the names of extensions in config.sh (and by implication Config.pm) has
NOT changed - it's merely an implementation detail of the build process.

I'm not sure that what comes next (moving things from lib/ to ext/) is good
to go until after 5.10.1 escapes to CPAN, as when it happens, lots more
extensions appear in nonxs_ext, and people might be foolish enough to
deconfigure them. Then again, anyone running Configure with a custom
command line to force a specific set of nonxs extensions is acting like they
know what they are doing...


Anyway, for now, we're (also) back to needing a tweak to configure.com.
Right now it scans MANIFEST for m!(?:vms/)ext/.*/Makfile\.PL!
which means that it won't consider any new directory in ext/ without a
Makefile.PL as an extension. How complex is it to change it to treat
all directories in ext (and vms/ext) as extension directories?

With that done, I can change make_ext.pl to fake up an appropriate Makefile.PL
in any extension that does not yet have one. At which point it's possible to
delete ext/Safe/Makefile.PL (and possibly others), and then we're ready to go
on moving dual life modules from lib to ext/...

(with the same layout as their CPAN distributions, for the improved sanity of
all)


I'm not sure whether git mv IO_Compress_Base IO-Compress-Base and
git mv IO_Compress_Zlib IO-Compress-Zlib is a good idea, as this *will*
change their name in nonxs_ext
Also, with Module::Pluggable now one level less deep in the tree, will its
tests fit inside it without busting the VMS directory level limit? Or are
they already at 8 in their location in t/Module_Pluggable?


Also, moving things around revealed that we have rather a lot of .gitignore
files in and under ext/

Some of them have lines that seem to duplicate each other. Given than none of
these originate from modules on CPAN, it would seem to me to be cleaner
(and less repetitive) to refactor all of them into a top level ext/.gitignore
Is this sane?

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About