Subversionify the documentation.
[oota-llvm.git] / docs / HowToReleaseLLVM.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2                       "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5   <title>How To Release LLVM To The Public</title>
6   <link rel="stylesheet" href="llvm.css" type="text/css">
7 </head>
8 <body>
9
10 <div class="doc_title">How To Release LLVM To The Public</div>
11 <p class="doc_warning">NOTE: THIS DOCUMENT IS A WORK IN PROGRESS!</p>
12 <ol>
13   <li><a href="#introduction">Introduction</a></li>
14   <li><a href="#process">Release Process</a></li>
15   <li><a href="#dist_targets">Distribution Targets</a></li>
16 </ol>
17 <div class="doc_author">
18   <p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a>,
19   <a href="mailto:criswell@cs.uiuc.edu">John Criswell</a></p>
20 </div>
21
22 <!-- *********************************************************************** -->
23 <div class="doc_section"><a name="introduction">Introduction</a></div>
24 <!-- *********************************************************************** -->
25
26 <div class="doc_text">
27 <p>This document collects information about successfully releasing LLVM to the
28 public. It is the release manager's guide to ensuring that a high quality build
29 of LLVM is released. Mostly, it's just a bunch of reminders of things to do at
30 release time so we don't inadvertently ship something that is utility 
31 deficient.</p>
32
33 <p>
34 There are three main tasks for building a release of LLVM:
35 <ol>
36   <li>Create the LLVM source distribution.</li>
37   <li>Create the LLVM GCC source distribtuion.</li>
38   <li>Create a set of LLVM GCC binary distribtuions for each supported
39       platform.  These binary distributions must include compiled versions
40       of the libraries found in <tt>llvm/runtime</tt> from the LLVM
41       source distribution created in Step 1.</li>
42 </ol>
43 </p>
44 </div>
45
46 <!-- *********************************************************************** -->
47 <div class="doc_section"><a name="process">Release Process</a></div>
48 <!-- *********************************************************************** -->
49
50 <!-- ======================================================================= -->
51 <div class="doc_subsection"><a name="overview">Process Overview</a></div>
52 <div class="doc_text">
53   <ol>
54     <li><a href="#updocs">Update Documentation</a></li>
55     <li><a href="#merge">Merge Branches</a></li>
56     <li><a href="#deps">Make LibDeps.txt</a></li>
57     <li><a href="#settle">Settle LLVM HEAD</a></li>
58     <li><a href="#tag">Tag LLVM and Create the Release Branch</a></li>
59     <li><a href="#verchanges">Update LLVM Version </a></li>
60     <li><a href="#build">Build LLVM</a></li>
61     <li><a href="#check">Run 'make check'</a></li>
62     <li><a href="#test">Run LLVM Test Suite</a></li>
63     <li><a href="#dist">Build the LLVM Source Distributions</a></li>
64     <li><a href="#rpm">Build RPM Packages (optional)</a></li>
65     <li><a href="#llvmgccbin">Build the LLVM GCC Binary Distribution</a></li>
66     <li><a href="#webupdates">Update the LLVM Website</a></li>
67   </ol>
68 </div>
69
70 <!-- ======================================================================= -->
71 <div class="doc_subsection"><a name="updocs">Update Documentation</a></div>
72 <div class="doc_text">
73   <p>
74   Review the documentation and ensure that it is up to date.  The Release Notes
75   must be updated to reflect bug fixes, new known issues, and changes in the
76   list of supported platforms.  The Getting Started Guide should be updated to
77   reflect the new release version number tag avaiable from CVS and changes in
78   basic system requirements.
79   </p>
80 </div>
81
82 <!-- ======================================================================= -->
83 <div class="doc_subsection"><a name="merge">Merge Branches</a></div>
84 <div class="doc_text">
85 <p>
86 Merge any work done on branches intended for release into mainline. Finish and
87 commit all new features or bug fixes that are scheduled to go into the release.
88 Work that is not to be incorporated into the release should not be merged from
89 branchs or commited from developer's working directories.
90 </p>
91
92 <p>
93 From this point until the release branch is created, developers should
94 <em>not</em>
95 commit changes to the llvm and llvm-gcc CVS repositories unless it is a bug
96 fix <em>for the release</em>.
97 </p>
98 </div>
99
100 <!-- ======================================================================= -->
101 <div class="doc_subsection"><a name="deps">Make LibDeps.txt</a></div>
102 <div class="doc_text">
103   <p>Rebuild the <tt>LibDeps.txt</tt> target in <tt>utils/llvm-config</tt>. This
104   makes sure that the <tt>llvm-config</tt> utility remains relevant for the
105   release, reflecting any changes in the library dependencies.</p>
106 </div>
107
108
109 <!-- ======================================================================= -->
110 <div class="doc_subsection"><a name="settle">Settle CVS HEAD</a></div>
111 <div class="doc_text">
112   <p>
113   Use the nightly test reports and 'make check' (deja-gnu based tests) to 
114   ensure that recent changes and merged branches have not destabilized LLVM.
115   Platforms which are used less often should be given special attention as they
116   are the most likely to break from commits from the previous step.
117   </p>
118 </div>
119
120 <!-- ======================================================================= -->
121 <div class="doc_subsection"><a name="tag">CVS Tag And Branch</a></div>
122 <div class="doc_text">
123   <p>Tag and branch the CVS HEAD using the following procedure:</p>
124   <ol>
125     <li>
126     Request all developers to refrain from committing. Offenders get commit
127     rights taken away (temporarily).
128     </li>
129
130     <li>
131     The Release Manager updates his/her llvm, llvm-test, and llvm-gcc source
132     trees with the
133     latest sources from mainline CVS.  The Release Manage may want to consider
134     using a new working directory for this to keep current uncommitted work
135     separate from release work.
136     </li>
137
138     <li>
139     The Release Manager tags his/her llvm, llvm-test, and llvm-gcc working
140     directories with
141     "ROOT_RELEASE_XX" where XX is the major and minor
142     release numbers. So, for Release 1.2, XX=12 and for Release 1.10, XX=110.
143           
144     <p>
145     <tt>cvs tag ROOT_RELEASE_XX</tt><br>
146     </p>
147     </li>
148
149     <li>
150     Immediately create cvs branches based on the ROOT_RELEASE_XX tag. The tag
151     should be "release_XX" (where XX matches that used for the ROOT_RELEASE_XX
152     tag).  This is where the release distribution will be created.
153
154     <p>
155     cvs tag -b -r ROOT_RELEASE_XX release_XX
156     </p>
157     </li>
158
159     <li>
160     Advise developers they can work on CVS HEAD again.
161     </li>
162
163     <li>
164     The Release Manager and any developers working on the release should switch
165     to the release branch (as all changes to the release will now be done in
166     the branch).  The easiest way to do this is to grab another working copy
167     using the following commands:
168
169     <p>
170     <tt>cvs -d &lt;CVS Repository&gt; co -r release_XX llvm</tt><br>
171     <tt>cvs -d &lt;CVS Repository&gt; co -r release_XX llvm-test</tt><br>
172     <tt>cvs -d &lt;CVS Repository&gt; co -r release_XX llvm-gcc</tt><br>
173     </p>
174     </li>
175 </div>
176
177 <!-- ======================================================================= -->
178 <div class="doc_subsection"><a name="verchanges">Update LLVM Version</a></div>
179 <div class="doc_text">
180   <p>
181   After creating the llvm release branch, update the release branch's autoconf/configure.ac 
182   version from X.Xsvn to just X.X. Update it on mainline as well to be the next version 
183   (X.X+1svn). 
184   </p>
185
186 </div>
187
188 <!-- ======================================================================= -->
189 <div class="doc_subsection"><a name="build">Build LLVM</a></div>
190 <div class="doc_text">
191   <p>
192   Build both debug and release (optimized) versions of LLVM on all
193   platforms. Ensure the build is warning and error free on each platform.
194   </p>
195
196   <p>
197   Build a new version of the LLVM GCC front-end after building the LLVM tools.
198   Once that is complete, go back to the LLVM source tree and build and install
199   the <tt>llvm/runtime</tt> libraries.
200   </p>
201 </div>
202
203 <!-- ======================================================================= -->
204 <div class="doc_subsection"><a name="check">Run 'make check'</a></div>
205 <div class="doc_text">
206   <p>Run <tt>make check</tt> and ensure there are no unexpected failures. If
207   there are, resolve the failures, commit them back into the release branch,
208   and restart testing by <a href="#build">re-building LLVM</a>.
209   </p>
210
211   <p>
212   Ensure that 'make check' passes on all platforms for all targets. If certain
213   failures cannot be resolved before release time, determine if marking them
214   XFAIL is appropriate. If not, fix the bug and go back. The test suite must
215   complete with "0 unexpected failures" for release.
216   </p>
217 </div>
218
219 <!-- ======================================================================= -->
220 <div class="doc_subsection"><a name="test">LLVM Test Suite</a></div>
221 <div class="doc_text">
222   <p>Run the llvm-test suite and ensure there are no unacceptable failures.
223   If there are, resolve the failures and go back to
224   <a href="#build">re-building LLVM</a>. The test suite
225   should be run in Nightly Test mode. All tests must pass.
226 </div>
227
228 <!-- ======================================================================= -->
229 <div class="doc_subsection"><a name="dist">Build the LLVM Source Distributions</a></div>
230 <div class="doc_text">
231   <p>
232   Create source distributions for LLVM, LLVM GCC, and the LLVM Test Suite by
233   exporting the source
234   from CVS and archiving it.  This can be done with the following commands:
235   </p>
236
237   <p>
238   <tt>cvs -d &lt;CVS Repository&gt; export -r release_XX llvm</tt><br>
239   <tt>cvs -d &lt;CVS Repository&gt; export -r release_XX llvm-test</tt><br>
240   <tt>cvs -d &lt;CVS Repository&gt; export -r release_XX llvm-gcc</tt><br>
241   <tt>mkdir cfrontend; mv llvm-gcc cfrontend/src</tt><br>
242   <tt>tar -cvf - llvm          | gzip &gt; llvm-X.X.tar.gz</tt><br>
243   <tt>tar -cvf - llvm-test     | gzip &gt; llvm-test-X.X.tar.gz</tt><br>
244   <tt>tar -cvf - cfrontend/src | gzip &gt; cfrontend-X.X.source.tar.gz</tt><br>
245   </p>
246 </div>
247
248 <!-- ======================================================================= -->
249 <div class="doc_subsection"><a name="rpm">Building RPM packages (optional)</a></div>
250 <div class="doc_text">
251   <p>You can, optionally, create source and binary RPM packages for LLVM. These
252   may make it easier to get LLVM into a distribution. This can be done with
253   the following commands:</p>
254   <pre>
255   make dist        # Build the distribution source tarball
256   make dist-check  # Check that the source tarball can build itself.
257   cp llvm-M.m.tar.gz /usr/src/redhat/SOURCES  # Required by rpmbuild
258   make srpm # for source rpm
259   make rpm  # for binary rpm
260   </pre>
261   <p>First, use "make dist" to simply build the distribution. Any
262   failures need to be corrected (on the branch). Once "make dist" can be
263   successful, do "make dist-check". This target will do the same thing as the
264   'dist' target but also test that distribution to make sure it can build itself
265   and runs "make check" as well. This ensures that needed files are not 
266   missing and that the src tarball can be successfully unpacked, built, 
267   installed, and cleaned. Once you have a reliable tarball, you need to copy
268   it to the /usr/src/redhat/SOURCES directory which is a requirement of the
269   rpmbuild tool. The last two "make" invocations just run rpmbuild to build
270   either a source (<tt>srpm</tt>) or binary (<tt>rpm</tt>) RPM package.</p>
271 </div>
272
273 <!-- ======================================================================= -->
274 <div class="doc_subsection"><a name="llvmgccbin">Build the LLVM GCC Binary Distribution</a></div>
275 <div class="doc_text">
276   <p>
277   Creating the LLVM GCC binary distribution requires performing the following
278   steps for each supported platform:
279   </p>
280
281   <ol>
282     <li>
283     Build the LLVM GCC front-end.  The LLVM GCC front-end must be installed in
284     a directory named <tt>cfrontend/&lt;platform&gt;/llvm-gcc</tt>.  For
285     example, the Sparc/Solaris directory is named
286     <tt>cfrontend/sparc/llvm-gcc</tt>.
287     </li>
288
289     <li>
290     Build the libraries in <tt>llvm/runtime</tt> and install them into the 
291     created LLVM GCC installation directory.
292     </li>
293
294     <li>
295     For systems with non-distributable header files (e.g. Solaris), manually
296     remove header files that the GCC build process has "fixed."  This process
297     is admittedly painful, but not as bad as it looks; these header files are
298     almost always easily identifiable with simple grep expressions and are
299     installed in only a few directories in the GCC installation directory.
300     </li>
301
302     <li>
303     Add the copyright files and header file fix script.
304     </li>
305
306     <li>
307     Archive and compress the installation directory.  These can be found in
308     previous releases of the LLVM-GCC front-end.
309     </li>
310   </ol>
311 </div>
312
313
314 <!-- ======================================================================= -->
315 <div class="doc_subsection"><a name="webupdates">Update the LLVM Website</a></div>
316 <div class="doc_text">
317   <p>
318   Check out the <tt>website</tt> module from Subversion. Create a new 
319   subdirectory X.X in the releases directory. Place the llvm, llvm-test, 
320   llvm-gcc source, and llvm-gcc 
321   binaries in this new directory. Copy the llvm/docs and LICENSE.txt files 
322   into this new directory. Update the releases/download.html file with  the new release. 
323   Update the releases/index.html with the new release. Finally, update the main page (
324   index.html and sidebar) to point to the new release and release announcement. Make 
325   sure this all gets commited back into cvs.
326   </p>
327 </div>
328
329 <!--
330 <div class="doc_subsection"><a name="release">Release</a></div>
331 <div class="doc_text">
332   <p>Release the distribution tarball to the public. This consists of generating
333   several tarballs. The first set, the source distributions, are automatically
334   generated by the "make dist" and "make dist-check". There are gzip, bzip2, and
335   zip versions of these bundles.</p>
336   <p>The second set of tarballs is the binary release. When "make dist-check"
337   succeeds, it will have created an _install directory into which it installed
338   the binary release. You need to rename that directory as "llvm" and then
339   create tarballs from the contents of that "llvm" directory.</p>
340   <p>Finally, use rpm to make an rpm package based on the llvm.spec file. Don't
341   forget to update the version number, documentation, etc. in the llvm.spec
342   file.</p>
343 </div>
344 -->
345
346 <!-- *********************************************************************** -->
347 <div class="doc_section"><a name="dist_targets">Distribution Targets</a></div>
348 <!-- *********************************************************************** -->
349 <!-- ======================================================================= -->
350 <div class="doc_subsection">Overview</div>
351 <div class="doc_text">
352 <p>The first thing you need to understand is that there are multiple make 
353 targets to support this feature. Here's an overview, we'll delve into the 
354 details later.</p>
355 <ul>
356   <li><b>distdir</b> - builds the distribution directory from which the 
357   distribution will be packaged</li>
358   <li><b>dist</b> - builds each of the distribution tarballs (tar.gz, 
359   tar.bzip2, .zip). These can be built individually as well, with separate 
360   targets.</li>
361   <li><b>dist-check</b> - this is identical to <tt>dist</tt> but includes a 
362   check on the distribution that ensures the tarball can: unpack successfully,
363   compile correctly, pass 'make check', and pass 'make clean'.</li>
364   <li><b>dist-clean</b>- this just does a normal clean but also cleans up the
365   stuff generated by the other three <tt>dist</tt> targets (above).</li>
366 </ul>
367 <p>Okay, that's the basic functionality. When making a release, we want to 
368 ensure that the tree you build the distribution from passes
369 <tt>dist-check</tt>. Beyond fixing the usual bugs, there is generally one 
370 impediment to making the release in this fashion: missing files. The 
371 <tt>dist-check</tt> process guards against that possibility. It will either 
372 fail and that failure will indicate what's missing, or it will succeed 
373 meaning that it has proved that the tarballs can actually succeed in 
374 building LLVM correctly and that it passes <tt>make check</tt>.</p>
375 <!-- ======================================================================= -->
376 <div class="doc_subsection">distdir</div>
377 <p>This target builds the distribution directory which is the directory from 
378 which the tarballs are generated. The distribution directory has the same 
379 name as the release, e.g. LLVM-1.7). This target goes through the following 
380 process:
381 <ol>
382   <li>First, if there was an old distribution directory (for the current 
383   release), it is removed in its entirety and you see <tt>Removing old 
384   LLVM-1.7</tt></li>
385   <li>Second, it issues a <tt>make all ENABLE_OPTIMIZED=3D1</tt> to ensure 
386   that the everything in your tree can be built in release mode. Often times 
387   there are discrepancies in building between debug and release modes so it 
388   enforces release mode first. If that fails, the <tt>distdir</tt> target 
389   fails too. This is preceded by the message <tt>Making 'all' to verify 
390   build</tt>.</li>
391   <li>Next, it traverses your source tree and copies it to a new directory 
392   that has the name of the release (<tt>LLVM-M.m</tt> in our current case). 
393   This is the directory that will get tar'd. It contains all the software 
394   that needs to be in the distribution. During the copying process, it omits 
395   generated files, CVS directories, and any other "cruft" that's in your 
396   build tree. This is done to eliminate the possibility of huge distribution 
397   tarballs that include useless or irrelevant stuff in them. This is the 
398   trickiest part of making the distribution. Done manually you will either 
399   include stuff that shouldn't be in the distribution or exclude stuff that 
400   should. This step is preceded by the message <tt>Building Distribution 
401   Directory LLVM-1.7</tt></li>
402   <li>The distribution directory is then traversed and all <tt>CVS</tt> or 
403   <tt>.svn</tt> directories are removed. You see: <tt>Eliminating CVS/.svn 
404   directories from distribution</tt></li>
405   <li>The recursive <tt>dist-hook</tt> target is executed. This gives each 
406   directory a chance to modify the distribution in some way (more on this 
407   below).</li>
408   <li>The distribution directory is traversed and the correct file 
409   permissions and modes are set based on the type of file.</li>
410 </ol>
411 <p>To control the process of making the distribution directory correctly, 
412 each Makefile can utilize two features:</p>
413 <ol>
414   <li><b><tt>EXTRA_DIST</tt></B> - this make variable specifies which files 
415   it should distribute. By default, all source files are automatically 
416   included for distribution as well as certain <tt>well known</tt> files 
417   (see DistAlways variable in Makefile.rules for details). Each Makefile 
418   specifies, via the <tt>EXTRA_DIST</tt> variable, which additional files 
419   need to be distributed. Only those files that are needed to build LLVM 
420   should be added to <tt>EXTRA_DIST</tt>. <tt>EXTRA_DIST</tt> contains a 
421   list of file or directory names that should be distributed. For example, 
422   the top level Makefile contains 
423   <tt>EXTRA_DIST := test llvm.spec include</tt>. 
424   This means that in addition to regular things that are distributed at the 
425   top level (<tt>CREDITS.txt, LICENSE.txt</tt>, etc.) the distribution should
426   contain the entire <tt>test</tt> and <tt>include</tt> directories as well 
427   as the <tt>llvm.spec</tt> file.</li>
428   <li><b><tt>dist-hook</tt></B> - this make target can be used to alter the 
429   content of the distribution directory. For example, in the top level 
430   Makefile there is some logic to eliminate files in the <tt>include</tt> 
431   subtree that are generated by the configure script. These should not be 
432   distributed. Similarly, any <tt>dist-hook</tt> target found in any 
433   directory can add or remove or modify things just before it gets packaged. 
434   Any transformation is permitted. Generally, not much is needed.
435 </ol>
436 <p>You will see various messages if things go wrong:</p>
437 <ol>
438   <li>During the copying process, any files that are missing will be flagged 
439   with: <tt>===== WARNING: Distribution Source 'dir/file' Not Found!</tt>
440   These must be corrected by either adding the file or removing it from 
441   <tt>EXTRA_DIST</tt>.
442   <li>If you build the distribution with <tt>VERBOSE=1</tt>, then you might 
443   also see: <tt>Skipping non-existent 'dir/file'</tt> in certain cases where 
444   its okay to skip the file.</li>
445   <li>The target can fail if any of the things it does fail. Error messages 
446   should indicate what went wrong.</li>
447 </ol>
448 <!-- ======================================================================= -->
449 <div class="doc_subsection">dist</div>
450 <p>This target does exactly what <tt>distdir</tt> target does, but also 
451 includes assembling the tarballs. There are actually four related targets 
452 here:<p>
453   <ul>
454     <li><b><tt>dist-gzip</tt></b>: package the gzipped distribution tar 
455     file. The distribution directory is packaged into a single file ending in 
456     <tt>.tar.gz</tt> which is gzip compressed.</li>
457     <li><b><tt>dist-bzip2</tt></b>: package the bzip2 distribution tar file. 
458     The distribution directory is packaged into a single file ending in 
459     <tt>.tar.bzip2</tt> which is bzip2 compressed.</li>
460     <li><b><tt>dist-zip</tt></b>: package the zip distribution file. The 
461     distribution directory is packaged into a single file ending in 
462     <tt>.zip</tt> which is zip compressed.</li>
463     <li><b><tt>dist</tt></b>: does all three, dist-gzip, dist-bzip2,
464     dist-zip</li>
465   </ul>
466 <!-- ======================================================================= -->
467 <div class="doc_subsection">dist-check</div>
468 <p>This target checks the distribution. The basic idea is that it unpacks the 
469 distribution tarball and ensures that it can build. It takes the following 
470 actions:</p>
471 <ol>
472   <li>It depends on the <tt>dist-gzip</tt> target which, if it hasn't already 
473   been built, builds the gzip tar bundle (see dist and distdir above).</li>
474   <li>removes any pre-existing <tt>_distcheckdir</tt> at the top level.</li>
475   <li>creates a new <tt>_distcheckdir</tt> directory at the top level.</li>
476   <li>creates a <tt>build</tt> subdirectory and an <tt>install</tt> 
477   subdirectory under <tt>_distcheckdir</tt>.</li>
478   <li>unzips and untars the release tarball into <tt>_distcheckdir</tt>, 
479   creating <tt>LLVM-1.7</tt> directory (from the tarball).</li>
480   <li>in the build subdirectory, it configures with appropriate options to build
481   from the unpacked source tarball into the <tt>build</tt> directory with 
482   installation in the <tt>install</tt> directory.</li>
483   <li>runs <tt>make all</tt></li>
484   <li>runs <tt>make </tt><tt>check</tt></li>
485   <li>runs <tt>make install</tt></li>
486   <li>runs <tt>make uninstall</tt></li>
487   <li>runs <tt>make dist</tt></li>
488   <li>runs <tt>make clean</tt></li>
489   <li>runs <tt>make dist-clean</tt></li>
490 </ol>
491 <p>If it can pass all that, the distribution will be deemed distribution 
492 worth y and you will see:<p>
493 <pre>===== LLVM-1.7.tar.gz Ready For Distribution =====</pre>
494 <p>This means the tarball should then be tested on other platforms and have the
495 nightly test run against it. If those all pass, THEN it is ready for 
496 distribution.</p>
497 <p>
498 A note about disk space: using <tt>dist-check</tt> will easily triple the 
499 amount of disk space your build tree is using. You might want to check 
500 available space before you begin.</p>
501 <!-- ======================================================================= -->
502 <div class="doc_subsection">dist-clean</div>
503 <h2>dist-clean</h2>
504 <p>In addition to doing a normal <tt>clean</tt>, this target will clean up the 
505 files and directories created by the distribution targets. In particular the 
506 distribution directory <tt>(LLVM-X.X</tt>), check directory 
507 (<tt>_distcheckdir</tt>), and the various tarballs will be removed. You do 
508 this after the release has shipped and you no longer need this stuff in your 
509 build tree.</p>
510 </div>
511
512 <!-- *********************************************************************** -->
513 <hr>
514 <address>
515   <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
516   src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
517   <a href="http://validator.w3.org/check/referer"><img
518   src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
519
520   <a href="mailto:rspencer@x10sys.com">Reid Spencer</a><br>
521   <a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
522   <br/>
523   Last modified: $Date$
524 </address>
525 </body>
526 </html>