eb6c838a2160be0a8068411f94f701598e701b7e
[oota-llvm.git] / docs / HowToReleaseLLVM.rst
1 =================================
2 How To Release LLVM To The Public
3 =================================
4
5 .. contents::
6    :local:
7    :depth: 1
8
9 .. sectionauthor:: Tanya Lattner <tonic@nondot.org>,
10                    Reid Spencer <rspencer@x10sys.com>,
11                    John Criswell <criswell@cs.uiuc.edu> and
12                    Bill Wendling <wendling@apple.com>
13
14 Introduction
15 ============
16
17 This document contains information about successfully releasing LLVM ---
18 including subprojects: e.g., ``clang`` and ``dragonegg`` --- to the public.  It
19 is the Release Manager's responsibility to ensure that a high quality build of
20 LLVM is released.
21
22 .. _timeline:
23
24 Release Timeline
25 ================
26
27 LLVM is released on a time based schedule --- roughly every 6 months.  We do
28 not normally have dot releases because of the nature of LLVM's incremental
29 development philosophy.  That said, the only thing preventing dot releases for
30 critical bug fixes from happening is a lack of resources --- testers,
31 machines, time, etc.  And, because of the high quality we desire for LLVM
32 releases, we cannot allow for a truncated form of release qualification.
33
34 The release process is roughly as follows:
35
36 * Set code freeze and branch creation date for 6 months after last code freeze
37   date.  Announce release schedule to the LLVM community and update the website.
38
39 * Create release branch and begin release process.
40
41 * Send out release candidate sources for first round of testing.  Testing lasts
42   7-10 days.  During the first round of testing, any regressions found should be
43   fixed.  Patches are merged from mainline into the release branch.  Also, all
44   features need to be completed during this time.  Any features not completed at
45   the end of the first round of testing will be removed or disabled for the
46   release.
47
48 * Generate and send out the second release candidate sources.  Only *critial*
49   bugs found during this testing phase will be fixed.  Any bugs introduced by
50   merged patches will be fixed.  If so a third round of testing is needed.
51
52 * The release notes are updated.
53
54 * Finally, release!
55
56 Release Process
57 ===============
58
59 .. contents::
60    :local:
61
62 Release Administrative Tasks
63 ----------------------------
64
65 This section describes a few administrative tasks that need to be done for the
66 release process to begin.  Specifically, it involves:
67
68 * Creating the release branch,
69
70 * Setting version numbers, and
71
72 * Tagging release candidates for the release team to begin testing.
73
74 Create Release Branch
75 ^^^^^^^^^^^^^^^^^^^^^
76
77 Branch the Subversion trunk using the following procedure:
78
79 #. Remind developers that the release branching is imminent and to refrain from
80    committing patches that might break the build.  E.g., new features, large
81    patches for works in progress, an overhaul of the type system, an exciting
82    new TableGen feature, etc.
83
84 #. Verify that the current Subversion trunk is in decent shape by
85    examining nightly tester and buildbot results.
86
87 #. Create the release branch for ``llvm``, ``clang``, the ``test-suite``, and
88    ``dragonegg`` from the last known good revision.  The branch's name is
89    ``release_XY``, where ``X`` is the major and ``Y`` the minor release
90    numbers.  The branches should be created using the following commands:
91
92    ::
93
94      $ svn copy https://llvm.org/svn/llvm-project/llvm/trunk \
95                 https://llvm.org/svn/llvm-project/llvm/branches/release_XY
96
97      $ svn copy https://llvm.org/svn/llvm-project/cfe/trunk \
98                 https://llvm.org/svn/llvm-project/cfe/branches/release_XY
99
100      $ svn copy https://llvm.org/svn/llvm-project/dragonegg/trunk \
101                 https://llvm.org/svn/llvm-project/dragonegg/branches/release_XY
102
103      $ svn copy https://llvm.org/svn/llvm-project/test-suite/trunk \
104                 https://llvm.org/svn/llvm-project/test-suite/branches/release_XY
105
106 #. Advise developers that they may now check their patches into the Subversion
107    tree again.
108
109 #. The Release Manager should switch to the release branch, because all changes
110    to the release will now be done in the branch.  The easiest way to do this is
111    to grab a working copy using the following commands:
112
113    ::
114
115      $ svn co https://llvm.org/svn/llvm-project/llvm/branches/release_XY llvm-X.Y
116
117      $ svn co https://llvm.org/svn/llvm-project/cfe/branches/release_XY clang-X.Y
118
119      $ svn co https://llvm.org/svn/llvm-project/dragonegg/branches/release_XY dragonegg-X.Y
120
121      $ svn co https://llvm.org/svn/llvm-project/test-suite/branches/release_XY test-suite-X.Y
122
123 Update LLVM Version
124 ^^^^^^^^^^^^^^^^^^^
125
126 After creating the LLVM release branch, update the release branches'
127 ``autoconf`` and ``configure.ac`` versions from '``X.Ysvn``' to '``X.Y``'.
128 Update it on mainline as well to be the next version ('``X.Y+1svn``').
129 Regenerate the configure scripts for both ``llvm`` and the ``test-suite``.
130
131 In addition, the version numbers of all the Bugzilla components must be updated
132 for the next release.
133
134 Build the LLVM Release Candidates
135 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136
137 Create release candidates for ``llvm``, ``clang``, ``dragonegg``, and the LLVM
138 ``test-suite`` by tagging the branch with the respective release candidate
139 number.  For instance, to create **Release Candidate 1** you would issue the
140 following commands:
141
142 ::
143
144   $ svn mkdir https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_XY
145   $ svn copy https://llvm.org/svn/llvm-project/llvm/branches/release_XY \
146              https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_XY/rc1
147
148   $ svn mkdir https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_XY
149   $ svn copy https://llvm.org/svn/llvm-project/cfe/branches/release_XY \
150              https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_XY/rc1
151
152   $ svn mkdir https://llvm.org/svn/llvm-project/dragonegg/tags/RELEASE_XY
153   $ svn copy https://llvm.org/svn/llvm-project/dragonegg/branches/release_XY \
154              https://llvm.org/svn/llvm-project/dragonegg/tags/RELEASE_XY/rc1
155
156   $ svn mkdir https://llvm.org/svn/llvm-project/test-suite/tags/RELEASE_XY
157   $ svn copy https://llvm.org/svn/llvm-project/test-suite/branches/release_XY \
158              https://llvm.org/svn/llvm-project/test-suite/tags/RELEASE_XY/rc1
159
160 Similarly, **Release Candidate 2** would be named ``RC2`` and so on.  This keeps
161 a permanent copy of the release candidate around for people to export and build
162 as they wish.  The final released sources will be tagged in the ``RELEASE_XY``
163 directory as ``Final`` (c.f. :ref:`tag`).
164
165 The Release Manager may supply pre-packaged source tarballs for users.  This can
166 be done with the following commands:
167
168 ::
169
170   $ svn export https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_XY/rc1 llvm-X.Yrc1
171   $ svn export https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_XY/rc1 clang-X.Yrc1
172   $ svn export https://llvm.org/svn/llvm-project/dragonegg/tags/RELEASE_XY/rc1 dragonegg-X.Yrc1
173   $ svn export https://llvm.org/svn/llvm-project/test-suite/tags/RELEASE_XY/rc1 llvm-test-X.Yrc1
174
175   $ tar -cvf - llvm-X.Yrc1        | gzip > llvm-X.Yrc1.src.tar.gz
176   $ tar -cvf - clang-X.Yrc1       | gzip > clang-X.Yrc1.src.tar.gz
177   $ tar -cvf - dragonegg-X.Yrc1   | gzip > dragonegg-X.Yrc1.src.tar.gz
178   $ tar -cvf - llvm-test-X.Yrc1   | gzip > llvm-test-X.Yrc1.src.tar.gz
179
180 Building the Release
181 --------------------
182
183 The builds of ``llvm``, ``clang``, and ``dragonegg`` *must* be free of
184 errors and warnings in Debug, Release+Asserts, and Release builds.  If all
185 builds are clean, then the release passes Build Qualification.
186
187 The ``make`` options for building the different modes:
188
189 +-----------------+---------------------------------------------+
190 | Mode            | Options                                     |
191 +=================+=============================================+
192 | Debug           | ``ENABLE_OPTIMIZED=0``                      |
193 +-----------------+---------------------------------------------+
194 | Release+Asserts | ``ENABLE_OPTIMIZED=1``                      |
195 +-----------------+---------------------------------------------+
196 | Release         | ``ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1`` |
197 +-----------------+---------------------------------------------+
198
199 Build LLVM
200 ^^^^^^^^^^
201
202 Build ``Debug``, ``Release+Asserts``, and ``Release`` versions
203 of ``llvm`` on all supported platforms.  Directions to build ``llvm``
204 are :ref:`here <getting_started>`.
205
206 Build Clang Binary Distribution
207 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
208
209 Creating the ``clang`` binary distribution (Debug/Release+Asserts/Release)
210 requires performing the following steps for each supported platform:
211
212 #. Build clang according to the directions `here
213    <http://clang.llvm.org/get_started.html>`__.
214
215 #. Build both a Debug and Release version of clang.  The binary will be the
216    Release build.
217
218 #. Package ``clang`` (details to follow).
219
220 Target Specific Build Details
221 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
222
223 The table below specifies which compilers are used for each Arch/OS combination
224 when qualifying the build of ``llvm``, ``clang``, and ``dragonegg``.
225
226 +--------------+---------------+----------------------+
227 | Architecture | OS            | compiler             |
228 +==============+===============+======================+
229 | x86-32       | Mac OS 10.5   | gcc 4.0.1            |
230 +--------------+---------------+----------------------+
231 | x86-32       | Linux         | gcc 4.2.X, gcc 4.3.X |
232 +--------------+---------------+----------------------+
233 | x86-32       | FreeBSD       | gcc 4.2.X            |
234 +--------------+---------------+----------------------+
235 | x86-32       | mingw         | gcc 3.4.5            |
236 +--------------+---------------+----------------------+
237 | x86-64       | Mac OS 10.5   | gcc 4.0.1            |
238 +--------------+---------------+----------------------+
239 | x86-64       | Linux         | gcc 4.2.X, gcc 4.3.X |
240 +--------------+---------------+----------------------+
241 | x86-64       | FreeBSD       | gcc 4.2.X            |
242 +--------------+---------------+----------------------+
243
244 Release Qualification Criteria
245 ------------------------------
246
247 A release is qualified when it has no regressions from the previous release (or
248 baseline).  Regressions are related to correctness first and performance second.
249 (We may tolerate some minor performance regressions if they are deemed
250 necessary for the general quality of the compiler.)
251
252 **Regressions are new failures in the set of tests that are used to qualify
253 each product and only include things on the list.  Every release will have
254 some bugs in it.  It is the reality of developing a complex piece of
255 software.  We need a very concrete and definitive release criteria that
256 ensures we have monotonically improving quality on some metric.  The metric we
257 use is described below.  This doesn't mean that we don't care about other
258 criteria, but these are the criteria which we found to be most important and
259 which must be satisfied before a release can go out.**
260
261 Qualify LLVM
262 ^^^^^^^^^^^^
263
264 LLVM is qualified when it has a clean test run without a front-end.  And it has
265 no regressions when using either ``clang`` or ``dragonegg`` with the
266 ``test-suite`` from the previous release.
267
268 Qualify Clang
269 ^^^^^^^^^^^^^
270
271 ``Clang`` is qualified when front-end specific tests in the ``llvm`` dejagnu
272 test suite all pass, clang's own test suite passes cleanly, and there are no
273 regressions in the ``test-suite``.
274
275 Specific Target Qualification Details
276 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
277
278 +--------------+-------------+----------------+-----------------------------+
279 | Architecture | OS          | clang baseline | tests                       |
280 +==============+=============+================+=============================+
281 | x86-32       | Linux       | last release   | llvm dejagnu,               |
282 |              |             |                | clang tests,                |
283 |              |             |                | test-suite (including spec) |
284 +--------------+-------------+----------------+-----------------------------+
285 | x86-32       | FreeBSD     | last release   | llvm dejagnu,               |
286 |              |             |                | clang tests,                |
287 |              |             |                | test-suite                  |
288 +--------------+-------------+----------------+-----------------------------+
289 | x86-32       | mingw       | none           | QT                          |
290 +--------------+-------------+----------------+-----------------------------+
291 | x86-64       | Mac OS 10.X | last release   | llvm dejagnu,               |
292 |              |             |                | clang tests,                |
293 |              |             |                | test-suite (including spec) |
294 +--------------+-------------+----------------+-----------------------------+
295 | x86-64       | Linux       | last release   | llvm dejagnu,               |
296 |              |             |                | clang tests,                |
297 |              |             |                | test-suite (including spec) |
298 +--------------+-------------+----------------+-----------------------------+
299 | x86-64       | FreeBSD     | last release   | llvm dejagnu,               |
300 |              |             |                | clang tests,                |
301 |              |             |                | test-suite                  |
302 +--------------+-------------+----------------+-----------------------------+
303
304 Community Testing
305 -----------------
306
307 Once all testing has been completed and appropriate bugs filed, the release
308 candidate tarballs are put on the website and the LLVM community is notified.
309 Ask that all LLVM developers test the release in 2 ways:
310
311 #. Download ``llvm-X.Y``, ``llvm-test-X.Y``, and the appropriate ``clang``
312    binary.  Build LLVM.  Run ``make check`` and the full LLVM test suite (``make
313    TEST=nightly report``).
314
315 #. Download ``llvm-X.Y``, ``llvm-test-X.Y``, and the ``clang`` sources.  Compile
316    everything.  Run ``make check`` and the full LLVM test suite (``make
317    TEST=nightly report``).
318
319 Ask LLVM developers to submit the test suite report and ``make check`` results
320 to the list.  Verify that there are no regressions from the previous release.
321 The results are not used to qualify a release, but to spot other potential
322 problems.  For unsupported targets, verify that ``make check`` is at least
323 clean.
324
325 During the first round of testing, all regressions must be fixed before the
326 second release candidate is tagged.
327
328 If this is the second round of testing, the testing is only to ensure that bug
329 fixes previously merged in have not created new major problems. *This is not
330 the time to solve additional and unrelated bugs!* If no patches are merged in,
331 the release is determined to be ready and the release manager may move onto the
332 next stage.
333
334 Release Patch Rules
335 -------------------
336
337 Below are the rules regarding patching the release branch:
338
339 #. Patches applied to the release branch may only be applied by the release
340    manager.
341
342 #. During the first round of testing, patches that fix regressions or that are
343    small and relatively risk free (verified by the appropriate code owner) are
344    applied to the branch.  Code owners are asked to be very conservative in
345    approving patches for the branch.  We reserve the right to reject any patch
346    that does not fix a regression as previously defined.
347
348 #. During the remaining rounds of testing, only patches that fix critical
349    regressions may be applied.
350
351 Release Final Tasks
352 -------------------
353
354 The final stages of the release process involves tagging the "final" release
355 branch, updating documentation that refers to the release, and updating the
356 demo page.
357
358 Update Documentation
359 ^^^^^^^^^^^^^^^^^^^^
360
361 Review the documentation and ensure that it is up to date.  The "Release Notes"
362 must be updated to reflect new features, bug fixes, new known issues, and
363 changes in the list of supported platforms.  The "Getting Started Guide" should
364 be updated to reflect the new release version number tag available from
365 Subversion and changes in basic system requirements.  Merge both changes from
366 mainline into the release branch.
367
368 .. _tag:
369
370 Tag the LLVM Final Release
371 ^^^^^^^^^^^^^^^^^^^^^^^^^^
372
373 Tag the final release sources using the following procedure:
374
375 ::
376
377   $ svn copy https://llvm.org/svn/llvm-project/llvm/branches/release_XY \
378              https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_XY/Final
379
380   $ svn copy https://llvm.org/svn/llvm-project/cfe/branches/release_XY \
381              https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_XY/Final
382
383   $ svn copy https://llvm.org/svn/llvm-project/dragonegg/branches/release_XY \
384              https://llvm.org/svn/llvm-project/dragonegg/tags/RELEASE_XY/Final
385
386   $ svn copy https://llvm.org/svn/llvm-project/test-suite/branches/release_XY \
387              https://llvm.org/svn/llvm-project/test-suite/tags/RELEASE_XY/Final
388
389 Update the LLVM Demo Page
390 -------------------------
391
392 The LLVM demo page must be updated to use the new release.  This consists of
393 using the new ``clang`` binary and building LLVM.
394
395 Update the LLVM Website
396 ^^^^^^^^^^^^^^^^^^^^^^^
397
398 The website must be updated before the release announcement is sent out.  Here
399 is what to do:
400
401 #. Check out the ``www`` module from Subversion.
402
403 #. Create a new subdirectory ``X.Y`` in the releases directory.
404
405 #. Commit the ``llvm``, ``test-suite``, ``clang`` source, ``clang binaries``,
406    ``dragonegg`` source, and ``dragonegg`` binaries in this new directory.
407
408 #. Copy and commit the ``llvm/docs`` and ``LICENSE.txt`` files into this new
409    directory.  The docs should be built with ``BUILD_FOR_WEBSITE=1``.
410
411 #. Commit the ``index.html`` to the ``release/X.Y`` directory to redirect (use
412    from previous release).
413
414 #. Update the ``releases/download.html`` file with the new release.
415
416 #. Update the ``releases/index.html`` with the new release and link to release
417    documentation.
418
419 #. Finally, update the main page (``index.html`` and sidebar) to point to the
420    new release and release announcement.  Make sure this all gets committed back
421    into Subversion.
422
423 Announce the Release
424 ^^^^^^^^^^^^^^^^^^^^
425
426 Have Chris send out the release announcement when everything is finished.
427