Skip to content

Commit 21a660d

Browse files
committed
Create Porting/MANIFEST.dev as a complement to MANIFEST and related infra
This file is intended to list all the files in the repo which are not listed in the main MANIFEST file, and which are used only for development purposes, especially those files which are only useful when working in a git checkout of the main perl git repository. The files it contains will NOT be added to the production tarball release. The file has the exact same format as the main MANIFEST: "file\t+description" or "file". Q. Why didn't I call this Porting/MANIFEST as mentioned in the discussion thread that lead to this patch? A. The main reason was that Porting/README.pod includes a list of files in Porting with descriptions and explanations for what the files do or how they are used. In several places the file refers to "MANIFEST", which lead to ambiguity that would have had to be resolved by changing all the entries to refer to "Porting/whatever" instead. It was much simpler to give the new file an extension, and I thought that '.dev' suggests it is for "development" purposes. Q. Why isn't this using MANIFEST.skip style functionality? A1. Various parts of our build and test process expect to read the MANIFEST file and then do things based on the entries contained within. Eg, run tests, or extract data, or compare the file list to content in another file. Those parts of our build process would break if we used a skip style list of regexen. So it would be more work to teach them to deal with such a file, assuming it was actually doable - given the additional work I have not considered it deeply. On the other hand teaching that logic to simply read two files was and is easy. A2. I think each file we have in the repo should have a description. This patch currently doesn't provide a description for each, but it does for many, especially those migrated from MANIFEST. A3. I think that MANIFEST.skip style files of exclusion regexens and globs are error prone and easy to mess up, for instance by excluding far more than you had intended to. They can also be annoying to get right, obviously not impossible, but sometimes annoying. Explicitly listing everything is easy in every way, especially to mechanize. A4. I would like to be able to move verbatim entries from our existing MANIFEST into the new Porting/MANIFEST.dev, description and all. MANIFEST.skip style files do not support descriptions except as comments as far as I recall. That would have meant munging the data from MANIFEST during the move process which would be annoying. A5. I would like to be able to reuse our sorting logic to keep the files nicely sorted in a way where the file is somewhat readable. A list of skip files would be less amenable to doing so. Q. There is a lot of duplicated logic related to testing manifests, should we refactor it out into a module or some resuable tool set? A. YES! We already have Porting/manifest_lib.pm, but it currently does not declare a package, and it only contains one function. Instead of adding yet more code that depends on requiring a file and having it inject subs into package main I decided that doing the refactoring could wait for a separate commit or PR. But I definitely think we should refactor as much of this logic as possible. Q. Some of the test files were fairly significantly changed, are you sure you didn't break or drop any of the tests? A. I am reasonably confident I did not. Secondary review appreciated. Some of the touched files are quite old and obviously "quick hack" scripts. By rewriting them quite a bit I was able to simplify and perform some of the tests in different ways or parts of the script. As far as I know I didn't drop any. Q. Why didn't you use newer features in the rewrite? A. I am a bit conservative in my taste, and I like build tools to be able to run on older perls, and for things like this I prefer to stick with what I know well. Patches welcome. Q. Why didn't you move more of the stuff we shouldn't bundle with our releases? A. I figured someone like Nicolas R. (who helped motivate this patch) would feel left out if I didn't leave him anything to do. :-)
1 parent 605f007 commit 21a660d

File tree

11 files changed

+322
-138
lines changed

11 files changed

+322
-138
lines changed

MANIFEST

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
.editorconfig EditorConfig style file
33
.lgtm.yml LGTM.com configuration file
44
.metaconf-exclusions.txt Symbols that should ignored when generating Configure
5-
.travis.yml continuous integration on github (where enabled)
65
amigaos4/amigaio.c AmigaOS4 port
76
amigaos4/amigaio.h AmigaOS4 port
87
amigaos4/amigaos.c AmigaOS4 port
@@ -5408,14 +5407,10 @@ Porting/acknowledgements.pl Generate perldelta acknowledgements text
54085407
Porting/add-package.pl Add/Update CPAN modules that are part of Core
54095408
Porting/add-pod-file Utility to add new pod/*.pod file to core distribution
54105409
Porting/bench.pl Run benchmarks against t/perf/benchmarks
5411-
Porting/bisect.pl A tool to make bisecting easy
5412-
Porting/bisect-example.sh Example script to use with git bisect run
5413-
Porting/bisect-runner.pl Tool to be called by git bisect run
54145410
Porting/bump-perl-version bump the perl version in relevant files
54155411
Porting/check-cpan-pollution Check for commits that may wrongly touch CPAN distros
54165412
Porting/check83.pl Check whether we are 8.3-friendly
54175413
Porting/checkansi.pl Check source code for ANSI-C violations
5418-
Porting/checkAUTHORS.pl Check that the AUTHORS file is complete
54195414
Porting/checkcfguse.pl Check that config symbols are being used
54205415
Porting/checkcfgvar.pl Check that config scripts define all symbols
54215416
Porting/checkpodencoding.pl Check POD encoding
@@ -5438,10 +5433,6 @@ Porting/exec-bit.txt List of files that get +x in release tarball
54385433
Porting/exercise_makedef.pl Brute force testing for makedef.pl
54395434
Porting/expand-macro.pl A tool to expand C macro definitions in the Perl source
54405435
Porting/findrfuncs Find reentrant variants of functions used in an executable
5441-
Porting/git-deltatool Mark commits for perldelta in git notes
5442-
Porting/git-find-p4-change Find the change for a p4 change number
5443-
Porting/git-make-p4-refs Output git refs for each p4 change number, suitable for appending to .git/packed-refs
5444-
Porting/GitUtils.pm Generate the contents of a .patch file
54455436
Porting/Glossary Glossary of config.sh variables
54465437
Porting/harness-timer-report.pl Analyze the timings from the test harness
54475438
Porting/how_to_write_a_perldelta.pod Bluffer's guide to writing a perldelta.
@@ -5479,7 +5470,6 @@ Porting/sync-with-cpan Sync with CPAN
54795470
Porting/timecheck.c Test program for the 2038 fix
54805471
Porting/timecheck2.c Test program for the 2038 fix
54815472
Porting/todo.pod Perl things to do
5482-
Porting/updateAUTHORS.pl Tool to automatically update AUTHORS and .mailmap from git log data
54835473
Porting/valgrindpp.pl Summarize valgrind reports
54845474
Porting/vote_admin_guide.pod Perlgov Vote Administrator guide
54855475
pp.c Push/Pop code

Makefile.SH

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,9 @@ all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafile
668668
$(MANIFEST_SRT): MANIFEST $(PERL_EXE)
669669
@$(RUN_PERL) Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
670670
$(RUN_PERL) Porting/manisort --fix=MANIFEST)
671+
@$(RUN_PERL) Porting/manisort -q Porting/MANIFEST.dev || \
672+
(echo "WARNING: re-sorting Porting/MANIFEST.dev"; \
673+
$(RUN_PERL) Porting/manisort --fix=Porting/MANIFEST.dev)
671674
@touch $(MANIFEST_SRT)
672675
673676
.PHONY: all utilities
@@ -1288,6 +1291,9 @@ regen_all regen-all: regen regen_meta
12881291
manisort: FORCE
12891292
@perl Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
12901293
perl Porting/manisort --fix=MANIFEST)
1294+
@perl Porting/manisort -q Porting/MANIFEST.dev || \
1295+
(echo "WARNING: re-sorting Porting/MANIFEST.dev"; \
1296+
perl Porting/manisort --fix=Porting/MANIFEST.dev)
12911297
12921298
manicheck: FORCE
12931299
perl Porting/manicheck

Porting/MANIFEST.dev

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
.git_patch Format used by make_patchnum.pl
2+
.gitattributes See: git --help gitattributes
3+
.github/ISSUE_TEMPLATE/01-perlbug-core.md
4+
.github/ISSUE_TEMPLATE/02-perlbug-docs.md
5+
.github/ISSUE_TEMPLATE/config.yml
6+
.github/workflows/detect-conflicts.yml
7+
.github/workflows/irc-notifications.yaml
8+
.github/workflows/testsuite.yml
9+
.gitignore Generic .gitignore rules. See: git --help gitignore
10+
.mailmap Map canonical name/email to those in commits
11+
.travis.yml continuous integration on github (where enabled)
12+
cpan/.gitignore Generic .gitignore for the cpan/ tree
13+
cpan/Compress-Raw-Bzip2/.gitignore .gitignore rules for the Compress-Raw-Bzip2 cpan distribution
14+
cpan/Compress-Raw-Zlib/.gitignore .gitignore rules for the Compress-Raw-Zlib cpan distribution
15+
cpan/DB_File/.gitignore .gitignore rules for the DB_File cpan distribution
16+
cpan/Digest-MD5/.gitignore .gitignore rules for the Digest-MD5 cpan distribution
17+
cpan/Digest-SHA/.gitignore .gitignore rules for the Digest-SHA cpan distribution
18+
cpan/Encode/.gitignore .gitignore rules for the Encode cpan distribution
19+
cpan/IO-Compress/.gitignore .gitignore rules for the IO-Compress cpan distribution
20+
cpan/IPC-SysV/.gitignore .gitignore rules for the IPC-SysV cpan distribution
21+
cpan/libnet/.gitignore .gitignore rules for the libnet cpan distribution
22+
cpan/perlfaq/.gitignore .gitignore rules for the perlfaq cpan distribution
23+
cpan/Pod-Checker/.gitignore .gitignore rules for the Pod-Checker cpan distribution
24+
cpan/Pod-Perldoc/.gitignore .gitignore rules for the Pod-Perldoc cpan distribution
25+
cpan/Pod-Usage/.gitignore .gitignore rules for the Pod-Usage cpan distribution
26+
cpan/podlators/.gitignore .gitignore rules for the podlators cpan distribution
27+
cpan/Scalar-List-Utils/.gitignore .gitignore rules for the Scalar-List-Utils cpan distribution
28+
cpan/Socket/.gitignore .gitignore rules for the Socket cpan distribution
29+
cpan/Sys-Syslog/.gitignore .gitignore rules for the Sys-Syslog cpan distribution
30+
cpan/Unicode-Collate/.gitignore .gitignore rules for the Unicode-Collate cpan distribution
31+
cpan/Win32/.gitignore .gitignore rules for the Win32 cpan distribution
32+
cpan/Win32API-File/.gitignore .gitignore rules for the Win32API-File cpan distribution
33+
dist/.gitignore Generic .gitignore for the dist/ tree
34+
dist/base/.gitignore .gitignore rules for the base distribution
35+
dist/Carp/.gitignore .gitignore rules for the Carp distribution
36+
dist/Devel-PPPort/.gitignore .gitignore rules for the Devel-PPPort distribution
37+
dist/ExtUtils-CBuilder/.gitignore .gitignore rules for the ExtUtils-CBuilder distribution
38+
dist/IO/.gitignore .gitignore rules for the IO distribution
39+
dist/lib/.gitignore .gitignore rules for the lib distribution
40+
dist/Module-CoreList/.gitignore .gitignore rules for the Module-CoreList distribution
41+
dist/PathTools/.gitignore .gitignore rules for the PathTools distribution
42+
dist/Safe/.gitignore .gitignore rules for the Safe distribution
43+
dist/Search-Dict/.gitignore .gitignore rules for the Search-Dict distribution
44+
dist/Storable/.gitignore .gitignore rules for the Storable distribution
45+
dist/Time-HiRes/.gitignore .gitignore rules for the Time-HiRes distribution
46+
dist/Unicode-Normalize/.gitignore .gitignore rules for the Unicode-Normalize distribution
47+
dist/XSLoader/.gitignore .gitignore rules for the XSLoader distribution
48+
ext/.gitignore Generic .gitignore for the ext/ tree
49+
ext/Amiga-ARexx/.gitignore .gitignore rules for the Amiga-ARexx extension
50+
ext/Amiga-Exec/.gitignore .gitignore rules for the Amiga-Exec extension
51+
ext/B/.gitignore .gitignore rules for the B extension
52+
ext/DynaLoader/.gitignore .gitignore rules for the DynaLoader extension
53+
ext/Errno/.gitignore .gitignore rules for the Errno extension
54+
ext/Fcntl/.gitignore .gitignore rules for the Fcntl extension
55+
ext/File-Glob/.gitignore .gitignore rules for the File-Glob extension
56+
ext/GDBM_File/.gitignore .gitignore rules for the GDBM_File extension
57+
ext/Hash-Util/.gitignore .gitignore rules for the Hash-Util extension
58+
ext/I18N-Langinfo/.gitignore .gitignore rules for the I18N-Langinfo extension
59+
ext/NDBM_File/.gitignore .gitignore rules for the NDBM_File extension
60+
ext/ODBM_File/.gitignore .gitignore rules for the ODBM_File extension
61+
ext/Pod-Functions/.gitignore .gitignore rules for the Pod-Functions extension
62+
ext/Pod-Html/.gitignore .gitignore rules for the Pod-Html extension
63+
ext/POSIX/.gitignore .gitignore rules for the POSIX extension
64+
ext/re/.gitignore .gitignore rules for the re extension
65+
ext/SDBM_File/.gitignore .gitignore rules for the SDBM_File extension
66+
ext/VMS-DCLsym/.gitignore .gitignore rules for the VMS-DCLsym extension
67+
ext/VMS-Stdio/.gitignore .gitignore rules for the VMS-Stdio extension
68+
ext/Win32CORE/.gitignore .gitignore rules for the Win32CORE extension
69+
ext/XS-APItest/.gitignore .gitignore rules for the XS-APItest extension
70+
ext/XS-Typemap/.gitignore .gitignore rules for the XS-Typemap extension
71+
lib/.gitignore Generic .gitignore for the lib/ tree
72+
pod/.gitignore Generic .gitignore for the pod/ tree
73+
Porting/bisect.pl A tool to make bisecting easy
74+
Porting/bisect-example.sh Example script to use with git bisect run
75+
Porting/bisect-runner.pl Tool to be called by git bisect run
76+
Porting/checkAUTHORS.pl Check that the AUTHORS file is complete
77+
Porting/git-deltatool Mark commits for perldelta in git notes
78+
Porting/git-find-p4-change Find the change for a p4 change number
79+
Porting/git-make-p4-refs Output git refs for each p4 change number, suitable for appending to .git/packed-refs
80+
Porting/GitUtils.pm Generate the contents of a .patch file
81+
Porting/MANIFEST.dev Porting files - all files in repo we do not ship
82+
Porting/updateAUTHORS.pl Tool to automatically update AUTHORS and .mailmap from git log data
83+
utils/.gitignore Generic .gitignore for the utils/ tree
84+
win32/.gitignore Generic .gitignore for the win32/ tree

Porting/README.pod

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,21 @@ web page to use to generate the snapshot files.
253253

254254
=head2 F<manicheck>
255255

256-
This script outputs a list of files in F<MANIFEST> which don't exist and a
257-
list of files that exist and aren't in F<MANIFEST>.
256+
This script outputs a list of files in F<MANIFEST> and F<MANIFEST.dev>
257+
which don't exist and a list of files that exist and aren't in
258+
F<MANIFEST> or in F<MANIFEST.dev>
259+
260+
=head2 F<MANIFEST.dev>
261+
262+
This file lists all files that are not included in the F<MANIFEST>
263+
file in the root of the repo. The union of the files it contains with
264+
the files in C<MANIFEST> should be the same the list of file produced
265+
by C<git ls-files> from a git checkout.
258266

259267
=head2 F<manifest_lib.pl>
260268

261269
This library provides functions used in checking and sorting the
262-
F<MANIFEST>. The sort order is similar to
270+
F<MANIFEST> and F<MANIFEST.dev> files. The sort order is similar to
263271
dictionary sort order (alphabetical case insensitive) but where path
264272
components and extensions are sorted independently such that the
265273
following files would be sorted into the following order:
@@ -314,6 +322,12 @@ distribution, provides functions useful during testing.
314322
Generate the sections of files listed in C<%Targets> from F<pod/perl.pod>.
315323
Mostly these are rules in Makefiles.
316324

325+
An example of what this tool does is to ensure that every podfile listed
326+
in F<pod/perl.pod> is also listed in F<MANIFEST> with the same
327+
description in F<pod/perl.pod>. If they differ in test mode it will
328+
complain. To update the manifest entries run it from the command line
329+
without the --test argument.
330+
317331
--verbose gives slightly more output
318332
--build-all tries to build everything
319333
--build-foo updates foo as follows
@@ -418,4 +432,3 @@ leaks.
418432
Guide for Vote Administrators for running Steering Council elections.
419433

420434
=cut
421-

Porting/manicheck

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,69 @@
44
# a) files listed in MANIFEST which don't exist
55
# b) files which exist but which aren't in MANIFEST
66

7+
# this file should be refactored with t/porting/manifest.t and
8+
# Porting/manifest_list.pm
9+
710
use v5.14;
811
use warnings;
912
use File::Find;
1013
use Getopt::Long;
11-
use constant SKIP => 125;
14+
use constant MAX_EXIT_CODE => 124;
1215

1316
my $exitstatus;
1417
GetOptions('exitstatus!', \$exitstatus)
1518
or die "$0 [--exitstatus]";
1619

17-
my %files;
18-
my $missing = 0;
1920
my $bonus = 0;
2021

21-
open my $fh, '<', 'MANIFEST' or die "Can't read MANIFEST: $!\n";
22-
for my $line (<$fh>) {
23-
my ($file) = $line =~ /^(\S+)/;
24-
++$files{$file};
25-
next if -f $file;
26-
++$missing;
27-
print "$file from MANIFEST doesn't exist\n";
22+
sub read_manifest {
23+
my ($manifest_file) = @_;
24+
open my $fh, '<', $manifest_file
25+
or die "Can't read '$manifest_file': $!\n";
26+
my %files;
27+
my $missing = 0;
28+
for my $line (<$fh>) {
29+
my ($file) = $line =~ /^(\S+)/;
30+
if (!defined($file)) {
31+
warn "No file specified in '$manifest_file' line $.\n";
32+
next;
33+
}
34+
$files{$file} = $.;
35+
next if -f $file;
36+
$missing++;
37+
print "'$file' from '$manifest_file' at line $. doesn't exist\n";
38+
}
39+
close $fh or die "Failed to close '$manifest_file': $!\n";
40+
return (\%files, $missing);
2841
}
29-
close $fh;
42+
43+
my ($manifest_files, $manifest_missing) = read_manifest("MANIFEST");
44+
my ($porting_files, $porting_missing) = read_manifest("Porting/MANIFEST.dev");
3045

3146
find {
47+
no_chdir => 1,
3248
wanted => sub {
33-
return if -d;
34-
return if $_ eq '.mailmap';
35-
return if $_ eq '.gitignore';
36-
return if $_ eq '.gitattributes';
37-
return if $_ eq '.git_patch';
38-
39-
my $x = $File::Find::name =~ s!^\./!!r;
40-
return if $x =~ /^\.git\b/;
41-
return if $x =~ m{^\.github/};
42-
return if $files{$x};
49+
return if -d $_;
50+
my $file = $_;
51+
$file =~s!^\./!!;
52+
return if $file=~m!^\.git/!;
53+
return if $porting_files->{$file};
54+
return if $manifest_files->{$file};
4355
++$bonus;
44-
print "$x\t\tnot in MANIFEST\n";
56+
print "$file\t\tnot in MANIFEST and not in Porting/MANIFEST.dev\n";
4557
},
4658
}, ".";
4759

48-
my $exitcode = $exitstatus ? $missing + $bonus : 0;
60+
my $problems = $manifest_missing + $porting_missing + $bonus;
4961

5062
# We can't (meaningfully) exit with codes above 255, so we're going to have to
5163
# clamp them to some range whatever we do. So as we need the code anyway, use
5264
# 124 as our maximum instead, and then we can run as a useful git bisect run
5365
# script if needed...
54-
55-
$exitcode = SKIP - 1
56-
if $exitcode > SKIP;
66+
my $exitcode = (!$exitstatus)
67+
? 0
68+
: ($problems > MAX_EXIT_CODE)
69+
? MAX_EXIT_CODE
70+
: $problems;
5771

5872
exit $exitcode;

Porting/manifest_lib.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/perl
2-
32
use strict;
43

54
=head1 NAME
@@ -21,6 +20,9 @@ =head2 C<sort_manifest>
2120
2221
=cut
2322

23+
# this file should be refactored with t/porting/manifest.t and
24+
# Porting/manicheck
25+
2426
# Try to get a sane sort. case insensitive, more or less
2527
# sorted such that path components are compared independently,
2628
# and so that lib/Foo/Bar sorts before lib/Foo-Alpha/Baz

Porting/release_managers_guide.pod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,12 @@ C<git rm> to tell git the files will be gone.
300300

301301
=item *
302302

303-
If the F<MANIFEST> file was changed in any of the
304-
previous steps, run C<make manisort> which will sort the file, or you
303+
If the F<MANIFEST> file or F<Porting/MANIFEST.dev> was changed in any of the
304+
previous steps, run C<make manisort> which will sort both files, or you
305305
can manually run:
306306

307307
perl Porting/manisort --fix MANIFEST
308+
perl Porting/manisort --fix Porting/MANIFEST.dev
308309

309310
=item *
310311

@@ -1616,4 +1617,3 @@ L<http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2009-05/msg00608.html>,
16161617
plus a whole bunch of other sources, including private correspondence.
16171618

16181619
=cut
1619-

t/porting/exec-bit.t

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ plan('no_plan');
3838

3939
use ExtUtils::Manifest qw(maniread);
4040

41+
# Get MANIFEST
42+
$ExtUtils::Manifest::Quiet = 1;
43+
my @manifest = (keys(%{ maniread("../MANIFEST") }),
44+
keys(%{ maniread("../Porting/MANIFEST.dev") }));
45+
@manifest = sort @manifest;
46+
4147
# Copied from Porting/makerel - these will get +x in the tarball
4248
# XXX refactor? -- dagolden, 2010-07-23
4349
my %exe_list =
@@ -47,9 +53,6 @@ my %exe_list =
4753
map { split "\n" }
4854
do { local (@ARGV, $/) = '../Porting/exec-bit.txt'; <> };
4955

50-
# Get MANIFEST
51-
$ExtUtils::Manifest::Quiet = 1;
52-
my @manifest = sort keys %{ maniread("../MANIFEST") };
5356

5457
# Check that +x files in repo get +x from makerel
5558
for my $f ( map { "../$_" } @manifest ) {

t/porting/known_pod_issues.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ ext/pod-html/corpus/perlvar-copy.pod Verbatim line length including indents exce
384384
ext/vms-filespec/lib/vms/filespec.pm Verbatim line length including indents exceeds 78 by 1
385385
install ? Should you be using F<...> or maybe L<...> instead of 1
386386
install Verbatim line length including indents exceeds 78 by 2
387-
pod/perl.pod Verbatim line length including indents exceeds 78 by 5
387+
pod/perl.pod Verbatim line length including indents exceeds 78 by 6
388388
pod/perlandroid.pod Verbatim line length including indents exceeds 78 by 3
389389
pod/perlbook.pod Verbatim line length including indents exceeds 78 by 1
390390
pod/perldebguts.pod Verbatim line length including indents exceeds 78 by 24

0 commit comments

Comments
 (0)