Perl::Dist::Bootstrap - Bootstrapping to build Win32 Perl from scratch
Running Perl::Dist::Builder requires Perl and numerous modules. Therefore, one needs to have a working installation of Perl on Win32 with all the appropriate modules. A pre-built Win32 binary installer is one possibility to bootstrap an environment to build other Win32 binary installations.
However, a binary Perl installation cannot be used to build another copy of itself (or it would overwrite itself as it tried). Since Perl hard-codes @INC directories into the binary, avoiding this collision requires more than renaming the installed Perl directory and changing PATH and other enviroment variables.
Instead, a new Perl distribution must be built with a custom path that won't collide with the path of any Perl that will be built. Here is one way of boostrapping to that point using Perl::Dist::Strawberry, assuming no Perl already exists on the computer in question:
Download a Strawberry Perl executable installer and install it. It will be located at C:\strawberry-perl.
C:\strawberry-perl
Install Perl::Dist::Builder from CPAN to pick up all dependencies.
Download a copy of the Perl::Dist::Strawberry tarball to access the configuration and extra files for the build process. Unpack it and open a command shell in that directory.
Edit strawberry.yml and change the "image_dir" parameter to a different path, e.g. C:\bootstrap-perl.
strawberry.yml
C:\bootstrap-perl
Run perl bin\full_build.pl, which will build and install a Strawberry Perl installation at that location.
perl bin\full_build.pl
Edit the PATH, LIB, and INCLUDE environment variables to refer to bootstrap-perl instead of strawberry-perl.
bootstrap-perl
strawberry-perl
Install Perl::Dist::Builder from CPAN to pick up all dependencies again, this time installed in the fresh C:\bootstrap-perl.
Change the strawberry.yml image_dir parameter back to C:\strawberry-perl (for building Strawberry Perl).
At this point, the perl located at C:\bootstrap-perl will be the default perl and will not be affected by rebuilding a new Strawberry Perl at C:\strawberry-perl.
To install Perl::Dist, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Dist
CPAN shell
perl -MCPAN -e shell install Perl::Dist
For more information on module installation, please visit the detailed CPAN module installation guide.