release_managers_guide: make into two logical sections:
[p5sagit/p5-mst-13.2.git] / Porting / release_managers_guide.pod
1 =head1 NAME
2
3 release_managers_guide - Releasing a new version of perl 5.x
4
5 XXX as of Jul 2009, this file is still a work-in-progress. I think it
6 contains all the actions needed to build a release, but things may have
7 got skipped, and some things could do with polishing. Note that things
8 change each release, there may be new things not covered here, or
9 tools may need updating. DAPM
10
11 =head1 SYNOPSIS
12
13 This document describes the series of tasks required - some automatic, some
14 manual - to produce a perl release of some description, be that a snaphot,
15 release candidate, or final, numbered release of maint or blead.
16
17 The release process has traditionally been executed by the current
18 pumpking.
19
20 This document both helps as a check-list for the release engineer 
21 and is a base for ideas on how the various tasks could be automated 
22 or distributed.
23
24 The outline of a typical release cycle is as follows:
25
26     (5.10.1 is released, and post-release actions have been done)
27
28     ...time passes...
29
30     an occasional snapshot is released, that still identifies itself as
31         5.10.1
32
33     ...time passes...
34
35     a few weeks before the release, a number of steps are performed,
36         including bumping the version to 5.10.2
37
38     ...a few weeks passes...
39
40     perl-5.10.2-RC1 is released
41
42     perl-5.10.2 is released
43
44     post-release actions are performed, including creating new
45         perl5103delta.pod
46
47     ... the cycle continues ...
48
49 =head1 DETAILS
50
51 Some of the tasks described below apply to all four types of 
52 release of Perl. (snapshot, RC, final release of maint, final 
53 release of blead). Some of these tasks apply only to a subset
54 of these release types.  If a step does not apply to a given 
55 type of release, you will see a notation to that effect at
56 the beginning of the step.
57
58 =head2 Release types
59
60 =over 4
61
62 =item Snapshot
63
64 A snapshot is intended to encourage in-depth testing from time-to-time,
65 for example after a key point in the stabilisation of a branch. It
66 requires fewer steps than a full release, and the version number of perl in
67 the tarball will usually be the same as that of the previous release.
68
69 =item Release Candidate (RC)
70
71 XXX Describe me
72
73 =item Stable/Maint release
74
75 At this point you should have a working release candidate with few or no
76 changes since.
77
78 It's essentially the same procedure as for making a release candidate, but
79 with a whole bunch of extra post-release steps.
80
81 =item Blead release
82
83 It's essentially the same procedure as for making a release candidate, but
84 with a whole bunch of extra post-release steps.
85
86 =back
87
88 =head2 Prerequisites
89
90 Before you can make an official release of perl, there are a few
91 hoops you need to jump through:
92
93 =over 4
94
95 =item PAUSE account
96
97 I<SKIP this step for SNAPSHOT>
98
99 Make sure you have a PAUSE account suitable for uploading a perl release.
100 If you don't have a PAUSE account, then request one:
101
102     https://pause.perl.org/pause/query?ACTION=request_id
103
104 Check that your account is allowed to upload perl distros: goto
105 https://pause.perl.org/, login, then select 'upload file to CPAN'; there
106 should be a "For pumpkings only: Send a CC" tickbox.  If not, ask Andreas
107 König to add your ID to the list of people allowed to upload something
108 called perl.  You can find Andreas' email address at:
109
110     https://pause.perl.org/pause/query?ACTION=pause_04imprint
111
112 =item CPAN mirror
113
114 Some release engineering steps require a full mirror of the CPAN.
115 Work to fall back to using a remote mirror via HTTP is incomplete
116 but ongoing. (No, a minicpan mirror is not sufficient)
117
118 =item git checkout and commit bit
119
120 You will need a working C<git> installation, checkout of the perl
121 git repository and perl commit bit.  For information about working
122 with perl and git, see F<pod/perlrepository.pod>.
123
124 If you are not yet a perl committer, you won't be able to make a
125 release.  Have a chat with whichever evil perl porter tried to talk
126 you into the idea in the first place to figure out the best way to
127 resolve the issue.
128
129
130 =item Quotation for release announcement epigraph
131
132 I<SKIP this step for SNAPSHOT and RC>
133
134 For a numbered blead or maint release of perl, you will need a quotation 
135 to use as an epigraph to your release announcement.  (There's no harm
136 in having one for a snapshot, but it's not required).
137
138
139 =back
140
141
142 =head2 Building a release - advance actions
143
144 The work of building a release candidate for a numbered release of
145 perl generally starts several weeks before the first release candidate.
146 Some of these should be done regularly, but all I<must> be done in the 
147 runup to a release.
148
149 =over 4
150
151 =item *
152
153 I<You MAY SKIP this step for SNAPSHOT>
154
155 Ensure that dual-life CPAN modules are synchronised with CPAN.  Basically,
156 run the following:
157
158     $ ./perl -Ilib Porting/core-cpan-diff -a -o /tmp/corediffs
159
160 to see any inconsistencies between the core and CPAN versions of distros,
161 then fix the core, or cajole CPAN authors as appropriate. See also the
162 C<-d> and C<-v> options for more detail.  You'll probably want to use the
163 C<-c cachedir> option to avoid repeated CPAN downloads.
164
165 To see which core distro versions differ from the current CPAN versions:
166
167     $ ./perl -Ilib Porting/core-cpan-diff -x -a
168
169 if you are making a maint release, run C<core-cpan-diff> on both blead and
170 maint, then diff the two outputs. Compare this with what you expect, and if
171 necessary, fix things up. For example, you might think that both blead
172 and maint are synchronised with a particular CPAN module, but one might
173 have some extra changes. 
174
175 =item *
176
177 I<You MAY SKIP this step for SNAPSHOT>
178
179 Ensure dual-life CPAN modules are stable, which comes down to:
180
181     for each module that fails its regression tests on $current
182         did it fail identically on $previous?
183         if yes, "SEP" (Somebody Else's Problem)
184         else work out why it failed (a bisect is useful for this)
185
186     attempt to group failure causes
187
188     for each failure cause
189         is that a regression?
190         if yes, figure out how to fix it
191             (more code? revert the code that broke it)
192         else
193             (presumably) it's relying on something un-or-under-documented
194             should the existing behaviour stay?
195                 yes - goto "regression"
196                 no - note it in perldelta as a significant bugfix
197                 (also, try to inform the module's author)
198
199 =item *
200
201 I<You MAY SKIP this step for SNAPSHOT>
202
203 Similarly, monitor the smoking of core tests, and try to fix.
204
205 =item *
206
207 I<You MAY SKIP this step for SNAPSHOT>
208
209 Similarly, monitor the smoking of perl for compiler warnings, and try to
210 fix.
211
212 =item *
213
214 I<You MAY SKIP this step for SNAPSHOT>
215
216 Run F<Porting/cmpVERSION.pl> to compare the current source tree with the
217 previous version to check for for modules that have identical version
218 numbers but different contents, e.g.:
219
220      $ cd ~/some-perl-root
221      $ ./perl -Ilib Porting/cmpVERSION.pl -xd ~/my_perl-tarballs/perl-5.10.0 .
222
223 then bump the version numbers of any non-dual-life modules that have
224 changed since the previous release, but which still have the old version
225 number. If there is more than one maintenance branch (e.g. 5.8.x, 5.10.x),
226 then compare against both.
227
228 Note that some of the files listed may be generated (e.g. copied from ext/
229 to lib/, or a script like lib/lib_pm.PL is run to produce lib/lib.pm);
230 make sure you edit the correct file!
231
232 Once all version numbers have been bumped, re-run the checks.
233
234 Then run again without the -x option, to check that dual-life modules are
235 also sensible.
236
237 =item *
238
239 I<You MAY SKIP this step for SNAPSHOT>
240
241 Get perldelta in a mostly finished state.
242
243 Peruse  F<Porting/how_to_write_a_perldelta.pod>, and try to make sure that
244 every section it lists is, if necessary, populated and complete. Copy
245 edit the whole document.
246
247 =item *
248
249 I<You MUST SKIP this step for SNAPSHOT>
250
251 A week or two before the first release candidate, bump the perl version
252 number (e.g. from 5.10.0 to 5.10.1), to allow sufficient time for testing
253 and smoking with the target version built into the perl executable. For
254 subsequent release candidates and the final release, it it not necessary
255 to bump the version further.
256
257 There is a tool to semi-automate this process. It works in two stages.
258 First, it generates a list of suggested changes, which you review and
259 edit; then you feed this list back and it applies the edits. So, first
260 scan the source dir looking for likely  candidates:
261
262     $ Porting/bump-perl-version -s 5.10.0 5.10.1 > /tmp/scan
263
264 This produces a file containing a list of suggested edits, eg:
265
266     NetWare/Makefile
267
268        89: -MODULE_DESC     = "Perl 5.10.0 for NetWare"
269            +MODULE_DESC     = "Perl 5.10.1 for NetWare"
270
271 i.e. in the file F<NetWare/Makefile>, line 89 would be changed as shown.
272 Review the file carefully, and delete any -/+ line pairs that you don't
273 want changing. Remember that this tool is largely just grepping for '5.10.0'
274 or whatever, so it will generate false positives. Be careful not change
275 text like "this was fixed in 5.10.0"! Then run:
276
277     $ Porting/bump-perl-version -u < /tmp/scan
278
279 which will update all the files shown; then commit the changes.
280
281 Be particularly careful with F<INSTALL>, which contains a mixture of
282 C<5.10.0>-type strings, some of which need bumping on every release, and
283 some of which need to be left. Also note that this tool currently only
284 performs a single change per line, so in particular, this line in
285 README.vms needs special handling:
286
287     rename perl-5^.10^.1.dir perl-5_10_1.dir
288
289
290 =item *
291
292 I<You MUST SKIP this step for SNAPSHOT>
293
294 Review and update INSTALL to account for the change in version number;
295 in particular, the "Coexistence with earlier versions of perl 5" section.
296
297 =item *
298
299 I<You MUST SKIP this step for SNAPSHOT>
300
301 Update the F<Changes> file to contain the git log command which would show
302 all the changes in this release. You will need assume the existence of a
303 not-yet created tag for the forthcoming release; e.g.
304
305     git log ... perl-5.10.0..perl5.12.0
306
307 Due to warts in the perforce-to-git migration, some branches require extra
308 exclusions to avoid other branches being pulled in. Make sure you have the
309 correct incantation: replace the not-yet-created tag with C<HEAD> and see
310 if git log produces roughly the right number of commits across roughly the
311 right time period.
312
313
314 =item *
315
316 Check some more build configurations, e.g.
317
318      -Duseshrplib -Dd_dosuid
319      make suidperl
320
321 Check that setuid installs works (for < 5.11.0 only).
322 XXX any other configs?
323
324
325 =item *
326
327 I<You MAY SKIP this step for SNAPSHOT>
328
329 Update F<AUTHORS>, using the C<Porting/checkAUTHORS.pl> script, and if
330 necessary, update the script to include new alias mappings for porters
331 already in F<AUTHORS>
332
333         $ git log | perl Porting/checkAUTHORS.pl --acknowledged AUTHORS -
334
335 =item *
336
337 I<You MAY SKIP this step for SNAPSHOT>
338
339 As there are no regular smokes [ XXX yet - please fix?] find out about the
340 state of the current branch on VMS. If the branch you're releasing on
341 is failing tests on VMS, you may not want to do a release.
342
343 =back
344
345 =head2 Building a release - on the day
346
347 This section describes the actions required to make a release (or snapshot
348 etc) that are performed on the actual day.
349
350 =over 4
351
352 =item *
353
354 Review all the items in the previous section,
355 L<"Building a release - advance actions"> to ensure they are all done and
356 up-to-date.
357
358 =item *
359
360 Configure and build perl so that you have a Makefile and porting tools:
361
362     $ ./Configure -Dusedevel -des
363     $ make
364
365 XXX probably want some re-ordering here: we build a perl, and very soon
366 afterwards do a distclean
367
368 =item *
369
370 Check that files managed by F<regen.pl> and friends are up to date. From
371 within your working directory:
372
373     $ git status
374     $ make regen
375     $ make regen_perly
376     $ git status
377
378 If any of the files managed by regen.pl have changed, then you should commit
379 the updated versions:
380
381     $ git commit -m 'Updated files generated by regen tools for perl 5.x.y' <list of files>
382
383
384 =item *
385
386 Rebuild META.yml:
387
388     $ rm META.yml
389     $ make META.yml
390
391 Commit META.yml if it has changed:
392
393     $ git commit -m 'Updating META.yml in preparation for release of 5.x.y' META.yml
394
395 =item *
396
397 Check that the manifest is sorted and correct:
398
399     $ make manisort
400     $ make distclean 
401     $ perl Porting/manicheck
402
403
404 Commit MANIFEST if it has changed:
405
406     $ git commit -m 'Updating MANIFEST in preparation for release of 5.x.y' MANIFEST
407
408
409
410 =item *
411
412 I<You MUST SKIP this step for SNAPSHOT>
413
414 Add an entry to F<pod/perlhist.pod> with the current date:
415
416           5.8.9-RC1     2008-Nov-10
417
418 Make sure the correct pumpking is listed, and if this is the first release
419 under the stewardship of a new pumpking, make sure that his or her name
420 is listed in the section entitled C<THE KEEPERS OF THE PUMPKIN>.
421
422 Be sure to commit your changes:
423
424     $ git commit -m 'Updating perlhist in preparation for release of 5.x.y pod/perlhist.pod
425
426
427 =item *
428
429
430 I<You MAY SKIP this step for SNAPSHOT>
431
432 Re-read the perldelta to try to find any embarrassing typos and thinkos;
433 remove any C<TODO> or C<XXX> flags; and run through pod and spell
434 checkers, e.g.
435
436     podchecker -warnings -warnings pod/perl5101delta.pod
437     spell pod/perl5101delta.pod
438
439 =item *
440
441 I<You MUST SKIP this step for SNAPSHOT>
442
443 Update patchlevel.h to add a C<-RC1>-or-whatever string; or, if this is a
444 final release, remove it.  [ XXX how now?? see 34813 for old way ]
445
446 =item *
447
448 I<You MUST SKIP this step for SNAPSHOT>
449
450 Update C<Module::Corelist>.
451
452 Note that if this is a maint release, you should run the following actions
453 from the maint directory, but edit the C<Corelist.pm> in I<blead> and
454 subsequently cherry-pick it.
455
456 corelist.pl uses ftp.funet.fi to verify information about dual-lifed
457 modules on CPAN. It can use a full, local CPAN mirror or fall back
458 to C<wget> or C<curl> to fetch only package metadata remotely.
459
460 (If you'd prefer to have a full CPAN mirror, see 
461 http://www.cpan.org/misc/cpan-faq.html#How_mirror_CPAN)
462
463
464 Then change to your perl checkout.
465
466 If you have a local CPAN mirror, run:
467
468     $ make perl
469     $ ./perl -Ilib Porting/corelist.pl ~/my-cpan-mirror
470
471 Otherwise, run:
472
473     $ make perl
474     $ ./perl -Ilib Porting/corelist.pl cpan
475
476 This will chug for a while. Assuming all goes well, it will
477 update lib/Module/CoreList.pm. 
478
479 Check that file over carefully:
480
481     $ git diff lib/Module/CoreList.pm
482
483
484 If necessary, bump C<$VERSION> (there's no need to do this for
485 every RC; in RC1, bump the version to a new clean number that will
486 appear in the final release, and leave as-is for the later RCs and final).
487
488 Edit the version number in the new C<< 'Module::CoreList' => 'X.YZ' >>
489 entry, as that is likely to reflect the previous version number.
490
491 If this is a final release (rather than a release candidate):
492
493 =over 4 
494
495 =item *
496
497 Update this version's entry in the C<%released> hash with today's date.
498
499 =item *
500
501 Make sure that the script has correctly updated the C<CAVEATS> section
502
503 =back
504
505 Finally, commit the new version of Module::CoreList:
506
507     $ git commit -m 'Updated Module::CoreList for the 5.x.y release' \
508      lib/Module/Corelist.pm
509
510 =item *
511
512 Build perl, then make sure it passes its own test suite, and installs:
513
514     $ ./Configure -des -Dusedevel -Dprefix=/tmp/perl-5.x.y-pretest
515     $ make test install
516
517 =item *
518
519 Create a tarball. Use the C<-s> option to specify a suitable suffix for
520 the tarball and directory name:
521
522     $ cd root/of/perl/tree
523     $ make distclean
524     $ git clean -xdf            #  make sure perl and git agree on files
525
526     $ perl Porting/makerel -b -s `git describe` # for a snapshot
527     $ perl Porting/makerel -b -s RC1            # for a release candidate
528     $ perl Porting/makerel -b                   # for a final release
529
530 This creates the  directory F<../perl-x.y.z-RC1> or similar, copies all
531 the MANIFEST files into it, sets the correct permissions on them,
532 adds DOS line endings to some, then tars it up as
533 F<../perl-x.y.z-RC1.tar.gz>. With C<-b>, it also creates a C<tar.bz2> file.
534
535 XXX if we go for extra tags and branches stuff, then add the extra details
536 here
537
538 =item *
539
540 Copy the tarballs (.gz and possibly .bz2) to a web server somewhere you
541 have access to.
542
543 =item *
544
545 Download the tarball to some other machine. For a release candidate, 
546 you really want to test your tarball on two or more different platforms
547 and architectures. The #p5p IRC channel on irc.perl.org is a good place
548 to find willing victims.
549
550 =item *
551
552 Check that basic configuration and tests work on each test machine:
553
554     $ ./Configure -des && make all test
555
556 =item *
557
558 Check that the test harness and install work on each test machine:
559
560     $ ./Configure -des -Dprefix=/install/path && make all test_harness install
561
562 =item *
563
564 Check that the output of C<perl -v> and C<perl -V> are as expected,
565 especially as regards version numbers, patch and/or RC levels, and @INC
566 paths. 
567
568 Note that the results may be different without a F<.git/> directory,
569 which is why you should test from the tarball.
570
571 =item *
572
573 Bootstrap the CPAN client on the clean install:
574
575     $ ./bin/perl -MCPAN -e'shell' 
576
577 =item *
578
579 Install Inline.pm 
580
581     $ ./bin/perl -MCPAN -e'install Inline'
582
583 Check that your perl can run this:
584
585     $ ./bin/perl -lwe 'use Inline C => "int answer() { return 42;} "; print answer'
586
587 =item *
588
589 Bootstrap the CPANPLUS client on the clean install:
590
591     $ ./bin/cpanp
592
593
594 =item *
595
596 Install an XS module.
597
598 =item *
599
600 If all is well, announce the snapshot to p5p. (For a release candidate,
601 instead follow the further steps described later.)
602
603
604 =item *
605
606 I<You MAY SKIP this step for SNAPSHOT>
607
608 Wait for the smoke tests to catch up with the commit which this release is
609 based on (or at least the last commit of any consequence).
610
611 Then check that the smoke tests pass (particularly on Win32). If not, go
612 back and fix things.
613
614
615 =item *
616
617 I<You MUST SKIP this step for SNAPSHOT>
618
619 Once smoking is okay, upload it to PAUSE. This is the point of no return.
620 If anything goes wrong after this point, you will need to re-prepare
621 a new release with a new minor version or RC number.
622
623 You may wish to create a .bz2 version of the tarball and upload that too.
624
625 =item *
626
627 I<You MUST SKIP this step for SNAPSHOT>
628
629 Create a tag for the exact git revision you built the release from.
630 C<commit> below is the commit corresponding to the tarball. It can be
631 omitted if there have been no further commits since the tarball was
632 created.
633
634     $ git tag perl-5.10.1-RC1 -m'Release Candidate 1 of Perl 5.10.1' <commit>
635     $ git push origin tag perl-5.10.1-RC1
636
637 =item *
638
639 I<You MUST SKIP this step for SNAPSHOT>
640
641 Disarm the patchlevel.h change [ XXX expand ]
642
643 =item *
644
645 Mail p5p to announce your new release, with a quote you prepared earlier.
646
647 =item *
648
649 I<You MAY SKIP this step for SNAPSHOT>
650
651 Wait 24 hours or so, then post the announcement to use.perl.org.
652 (if you don't have access rights to post news, ask someone like Rafael to
653 do it for you.)
654
655 =item *
656
657 I<You MUST SKIP this step for SNAPSHOT, RC, BLEAD>
658
659 Ask Jarkko to update http://www.cpan.org/src/README.html and
660 Rafael to update http://dev.perl.org/perl5/
661
662 =item *
663
664 I<You MUST SKIP this step for SNAPSHOT, RC>
665
666 Create a new empty perlNNNdelta.pod file for the current release + 1;
667 see F<Porting/how_to_write_a_perldelta.pod>.
668 [ XXX Perhaps we should have an empty template file we can copy in. ]
669
670 In addition, edit F<pod.lst>, adding the new entry as 'D', and unmark previous
671 entry as 'D',
672
673 Change perlNNNdelta references to the new version in these files
674
675     INSTALL
676     win32/Makefile.mk
677     win32/Makefile
678     Makefile.SH
679     README
680
681 Also, edit the previous delta file to change the C<NAME> from C<perldelta>
682 to C<perlNNNdelta>.
683
684 These two lists of files probably aren't exhaustive; do a recursive grep
685 on the previous filename to look for suitable candidates.
686
687 (see 16410843ea for an example).
688
689 =item *
690
691 Run C<perl pod/buildtoc --build-all> to update the following files:
692
693     MANIFEST
694     pod/perl.pod
695     win32/pod.mak
696     vms/descrip_mms.template
697
698 If you modified perldelta.pod, (F<vms/descrip_mms.template> will
699 needs a manual edit to bump the C<perldelta.pod> entry - it would
700 be good for someone to figure out the fix.)
701
702 =item *
703
704 I<You MUST SKIP this step for SNAPSHOT, RC, BLEAD>
705
706 If this was a maint release, then edit F<Porting/mergelog> to change
707 all the C<d> (deferred) flags to C<.> (needs review).
708
709 =item *
710
711 I<You MUST SKIP this step for SNAPSHOT, RC, BLEAD>
712
713 If this was a major release (5.x.0), then create a new maint branch 
714 based on the commit tagged as the current release and bump the version 
715 in the blead branch in git, e.g. 5.12.0 to 5.13.0.
716
717 [ XXX probably lots more stuff to do, including perldelta,
718 C<lib/feature.pm> ]
719
720 XXX need a git recipe
721
722 =item *
723
724 I<You MUST SKIP this step for SNAPSHOT, RC, BLEAD>
725
726 Copy the perlNNNdelta.pod for this release into the other branches, and
727 remember to update these files on those branches too:
728
729     MANIFEST
730     pod.lst
731     pod/perl.pod
732     vms/descrip_mms.template
733     win32/pod.mak
734
735 (see fc5be80860 for an example).
736
737 =item *
738
739 I<You MUST SKIP this step for SNAPSHOT>
740
741 Make sure any recent F<pod/perlhist.pod> entries are copied to
742 F<perlhist.pod> on other branches; typically the RC* and final entries,
743 e.g.
744
745           5.8.9-RC1     2008-Nov-10
746           5.8.9-RC2     2008-Dec-06
747           5.8.9         2008-Dec-14
748
749 =item *
750
751 I<You MUST SKIP this step for SNAPSHOT, RC>
752
753 Remind the current maintainer of C<Module::CoreList> to push a new release
754 to CPAN.
755
756 =item *
757
758 I<You MUST RETIRE to your preferred PUB, CAFE or SEASIDE VILLA for some much-needed
759 rest and relaxation>. 
760
761 Thanks for releasing perl!
762
763 =back
764
765 =head1 SOURCE
766
767 Based on
768 http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2009-05/msg00608.html,
769 plus a whole bunch of other sources, including private correspondence.
770
771 =cut
772