This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add --force-regen to bisect-runner.pl to regen_headers before building.
authorNicholas Clark <nick@ccl4.org>
Tue, 1 Nov 2011 19:31:43 +0000 (20:31 +0100)
committerNicholas Clark <nick@ccl4.org>
Tue, 1 Nov 2011 21:21:28 +0000 (22:21 +0100)
--force-regen runs C<make regen_headers> before building F<miniperl>. This
may fix a build that otherwise would skip because the generated headers at
that revision are stale. It's not the default because it conceals this error
in the true state of such revisions.

Porting/bisect-runner.pl

index 012aad5..7f9de33 100755 (executable)
@@ -62,7 +62,8 @@ unless(GetOptions(\%options,
                   'target=s', 'jobs|j=i', 'expect-pass=i',
                   'expect-fail' => sub { $options{'expect-pass'} = 0; },
                   'clean!', 'one-liner|e=s', 'match=s', 'force-manifest',
-                  'test-build', 'check-args', 'A=s@', 'usage|help|?',
+                  'force-regen', 'test-build', 'check-args', 'A=s@',
+                  'usage|help|?',
                   'D=s@' => sub {
                       my (undef, $val) = @_;
                       if ($val =~ /\A([^=]+)=(.*)/s) {
@@ -359,6 +360,15 @@ F<MANIFEST> are missing.
 
 =item *
 
+--force-regen
+
+Run C<make regen_headers> before building F<miniperl>. This may fix a build
+that otherwise would skip because the generated headers at that revision
+are stale. It's not the default because it conceals this error in the true
+state of such revisions.
+
+=item *
+
 --expect-pass [0|1]
 
 C<--expect-pass=0> is equivalent to C<--expect-fail>. I<1> is the default.
@@ -669,6 +679,14 @@ if ($target =~ /config\.s?h/) {
 force_manifest_cleanup($missing, $created_dirs)
         if $missing;
 
+if($options{'force-regen'}
+   && extract_from_file('Makefile', qr/\bregen_headers\b/)) {
+    # regen_headers was added in e50aee73b3d4c555, patch.1m for perl5.001
+    # It's not worth faking it for earlier revisions.
+    system "make regen_headers </dev/null"
+        and die;
+}
+
 patch_C();
 patch_ext();