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