Permalink
Browse files

[GH #910] add Parrot::Install::sanitycheck_install

Check for some common possibly ungenerated
configure and make targets in MANIFEST.generated and die
with the appropriate error message. Suggest make clean or make reconfig then.
  • Loading branch information...
Reini Urban
Reini Urban committed Jan 5, 2013
1 parent af349b9 commit 10215f129a3bd65f092a8e0769dc8e1a2f804f2a
Showing with 63 additions and 5 deletions.
  1. +56 −4 lib/Parrot/Install.pm
  2. +3 −0 tools/dev/install_dev_files.pl
  3. +4 −1 tools/dev/install_files.pl
View
@@ -1,5 +1,5 @@
package Parrot::Install;
-# Copyright (C) 2001-2009, Parrot Foundation.
+# Copyright (C) 2001-2013, Parrot Foundation.
use strict;
use warnings;
use File::Basename qw( dirname );
@@ -12,6 +12,8 @@ our @EXPORT_OK = qw(
create_directories
install_files
);
+use lib 'lib';
+use Parrot::BuildUtil;
#################### DOCUMENTATION ####################
@@ -29,10 +31,10 @@ Parrot::Install - Functionality for installation programs
=head1 DESCRIPTION
-This module exports on demand only three subroutines used in the Parrot
+This module exports on demand some subroutines used in the Parrot
installation programs F<tools/dev/install_files.pl> and
-F<tools/dev/install_dev_files.pl>. The subroutines are tested by tests found
-in F<t/tools/install/>.
+F<tools/dev/install_dev_files.pl>.
+The subroutines are tested by tests found in F<t/tools/install/>.
=head1 SUBROUTINES
@@ -185,6 +187,56 @@ sub create_directories {
return 1;
}
+=head2 C<sanitycheck_install()>
+
+Check if the generated MANIFEST.generated contains some typically
+needed files. Dies if not ok.
+
+If you update your repo and rebuild parrot without perl Configure.PL
+which deletes MANIFEST.generated anew, MANIFEST.generated might not
+contain already up-to-date targets, thus not creating the required
+MANIFEST.generated lines.
+
+=cut
+
+sub sanitycheck_install {
+ my $fname = "MANIFEST.generated";
+ my $manifest = Parrot::BuildUtil::slurp_file($fname);
+ die "$fname not found.\n" unless $manifest;
+ my $win = $^O eq 'MSWin32';
+ # configure generated:
+ for my $file (qw
+ (
+ lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm
+ include/parrot/config.h
+ include/parrot/pbcversion.h
+ include/parrot/vtable.h
+ include/parrot/core_pmcs.h
+ lib/Parrot/Config/Generated.pm
+ runtime/parrot/library/config.pir
+ )) {
+ $file =~ s{/}{\\}g if $win;
+ die "Error: configure generated $file missing in $fname.\n"
+ . "make reconfig before make install.\n"
+ unless $manifest =~ /^\Q$file\E/m;
+ }
+ # make generated
+ for my $file (qw
+ (
+ vtable.dump
+ runtime/parrot/dynext/dynlexpad
+ runtime/parrot/dynext/os
+ runtime/parrot/dynext/file
+ runtime/parrot/dynext/bit_ops
+ installable_parrot
+ )) {
+ $file =~ s{/}{\\}g if $win;
+ die "Error: make generated $file missing in $fname.\n"
+ . "make clean before make install.\n"
+ unless $manifest =~ /^\Q$file\E/m;
+ }
+}
+
=head2 C<install_files()>
B<Purpose:> Install the mentioned files into the appropriate locations.
@@ -94,6 +94,9 @@ =head1 SEE ALSO
my $parrotdir = $options{versiondir};
+# #GH 910
+Parrot::Install::sanitycheck_install();
+
# Set up transforms on filenames
my(@transformorder) = (qw(lib share include bin src doc), '^(tools|VERSION)', '^compilers');
my(%metatransforms) = (
@@ -1,6 +1,6 @@
#! perl
################################################################################
-# Copyright (C) 2001-2009, Parrot Foundation.
+# Copyright (C) 2001-2013, Parrot Foundation.
################################################################################
=head1 NAME
@@ -97,6 +97,9 @@ =head1 SEE ALSO
my $parrotdir = $options{versiondir};
+# #GH 910
+Parrot::Install::sanitycheck_install();
+
# Set up transforms on filenames
my(@transformorder) = qw(lib bin include doc man ^compilers);
my(%metatransforms) = (

0 comments on commit 10215f1

Please sign in to comment.