1=================================
2How To Release LLVM To The Public
3=================================
4
5Introduction
6============
7
8This document contains information about successfully releasing LLVM ---
9including sub-projects: e.g., ``clang`` and ``compiler-rt`` --- to the public.
10It is the Release Manager's responsibility to ensure that a high quality build
11of LLVM is released.
12
13If you're looking for the document on how to test the release candidates and
14create the binary packages, please refer to the :doc:`ReleaseProcess` instead.
15
16.. _timeline:
17
18Release Timeline
19================
20
21LLVM is released on a time based schedule --- with major releases roughly
22every 6 months.  In between major releases there may be dot releases.
23The release manager will determine if and when to make a dot release based
24on feedback from the community.  Typically, dot releases should be made if
25there are large number of bug-fixes in the stable branch or a critical bug
26has been discovered that affects a large number of users.
27
28Unless otherwise stated, dot releases will follow the same procedure as
29major releases.
30
31The release process is roughly as follows:
32
33* Set code freeze and branch creation date for 6 months after last code freeze
34  date.  Announce release schedule to the LLVM community and update the website.
35
36* Create release branch and begin release process.
37
38* Send out release candidate sources for first round of testing.  Testing lasts
39  7-10 days.  During the first round of testing, any regressions found should be
40  fixed.  Patches are merged from mainline into the release branch.  Also, all
41  features need to be completed during this time.  Any features not completed at
42  the end of the first round of testing will be removed or disabled for the
43  release.
44
45* Generate and send out the second release candidate sources.  Only *critical*
46  bugs found during this testing phase will be fixed.  Any bugs introduced by
47  merged patches will be fixed.  If so a third round of testing is needed.
48
49* The release notes are updated.
50
51* Finally, release!
52
53The release process will be accelerated for dot releases.  If the first round
54of testing finds no critical bugs and no regressions since the last major release,
55then additional rounds of testing will not be required.
56
57Release Process
58===============
59
60.. contents::
61   :local:
62
63Release Administrative Tasks
64----------------------------
65
66This section describes a few administrative tasks that need to be done for the
67release process to begin.  Specifically, it involves:
68
69* Creating the release branch,
70
71* Setting version numbers, and
72
73* Tagging release candidates for the release team to begin testing.
74
75Create Release Branch
76^^^^^^^^^^^^^^^^^^^^^
77
78Branch the Subversion trunk using the following procedure:
79
80#. Remind developers that the release branching is imminent and to refrain from
81   committing patches that might break the build.  E.g., new features, large
82   patches for works in progress, an overhaul of the type system, an exciting
83   new TableGen feature, etc.
84
85#. Verify that the current Subversion trunk is in decent shape by
86   examining nightly tester and buildbot results.
87
88#. Create the release branch for ``llvm``, ``clang``, and other sub-projects,
89   from the last known good revision.  The branch's name is
90   ``release_XY``, where ``X`` is the major and ``Y`` the minor release
91   numbers.  Use ``utils/release/tag.sh`` to tag the release.
92
93#. Advise developers that they may now check their patches into the Subversion
94   tree again.
95
96#. The Release Manager should switch to the release branch, because all changes
97   to the release will now be done in the branch.  The easiest way to do this is
98   to grab a working copy using the following commands:
99
100   ::
101
102     $ svn co https://llvm.org/svn/llvm-project/llvm/branches/release_XY llvm-X.Y
103
104     $ svn co https://llvm.org/svn/llvm-project/cfe/branches/release_XY clang-X.Y
105
106     $ svn co https://llvm.org/svn/llvm-project/test-suite/branches/release_XY test-suite-X.Y
107
108Update LLVM Version
109^^^^^^^^^^^^^^^^^^^
110
111After creating the LLVM release branch, update the release branches'
112``CMakeLists.txt`` versions from '``X.Ysvn``' to '``X.Y``'.
113Update it on mainline as well to be the next version ('``X.Y+1svn``').
114
115In addition, the version numbers of all the Bugzilla components must be updated
116for the next release.
117
118Tagging the LLVM Release Candidates
119^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120
121Tag release candidates using the tag.sh script in utils/release.
122
123::
124
125  $ ./tag.sh -release X.Y.Z -rc $RC
126
127The Release Manager may supply pre-packaged source tarballs for users.  This can
128be done with the export.sh script in utils/release.
129
130::
131
132  $ ./export.sh -release X.Y.Z -rc $RC
133
134This will generate source tarballs for each LLVM project being validated, which
135can be uploaded to the website for further testing.
136
137Build Clang Binary Distribution
138^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139
140Creating the ``clang`` binary distribution requires following the instructions
141:doc:`here <ReleaseProcess>`.
142
143That process will perform both Release+Asserts and Release builds but only
144pack the Release build for upload. You should use the Release+Asserts sysroot,
145normally under ``final/Phase3/Release+Asserts/llvmCore-3.8.1-RCn.install/``,
146for test-suite and run-time benchmarks, to make sure nothing serious has
147passed through the net. For compile-time benchmarks, use the Release version.
148
149The minimum required version of the tools you'll need are :doc:`here <GettingStarted>`
150
151Release Qualification Criteria
152------------------------------
153
154A release is qualified when it has no regressions from the previous release (or
155baseline).  Regressions are related to correctness first and performance second.
156(We may tolerate some minor performance regressions if they are deemed
157necessary for the general quality of the compiler.)
158
159More specifically, Clang/LLVM is qualified when it has a clean test with all
160supported sub-projects included (``make check-all``), per target, and it has no
161regressions with the ``test-suite`` in relation to the previous release.
162
163Regressions are new failures in the set of tests that are used to qualify
164each product and only include things on the list.  Every release will have
165some bugs in it.  It is the reality of developing a complex piece of
166software.  We need a very concrete and definitive release criteria that
167ensures we have monotonically improving quality on some metric.  The metric we
168use is described below.  This doesn't mean that we don't care about other
169criteria, but these are the criteria which we found to be most important and
170which must be satisfied before a release can go out.
171
172Official Testing
173----------------
174
175A few developers in the community have dedicated time to validate the release
176candidates and volunteered to be the official release testers for each
177architecture.
178
179These will be the ones testing, generating and uploading the official binaries
180to the server, and will be the minimum tests *necessary* for the release to
181proceed.
182
183This will obviously not cover all OSs and distributions, so additional community
184validation is important. However, if community input is not reached before the
185release is out, all bugs reported will have to go on the next stable release.
186
187The official release managers are:
188
189* Major releases (X.0): Hans Wennborg
190* Stable releases (X.n): Tom Stellard
191
192The official release testers are volunteered from the community and have
193consistently validated and released binaries for their targets/OSs. To contact
194them, you should email the ``release-testers@lists.llvm.org`` mailing list.
195
196The official testers list is in the file ``RELEASE_TESTERS.TXT``, in the ``LLVM``
197repository.
198
199Community Testing
200-----------------
201
202Once all testing has been completed and appropriate bugs filed, the release
203candidate tarballs are put on the website and the LLVM community is notified.
204
205We ask that all LLVM developers test the release in any the following ways:
206
207#. Download ``llvm-X.Y``, ``llvm-test-X.Y``, and the appropriate ``clang``
208   binary.  Build LLVM.  Run ``make check`` and the full LLVM test suite (``make
209   TEST=nightly report``).
210
211#. Download ``llvm-X.Y``, ``llvm-test-X.Y``, and the ``clang`` sources.  Compile
212   everything.  Run ``make check`` and the full LLVM test suite (``make
213   TEST=nightly report``).
214
215#. Download ``llvm-X.Y``, ``llvm-test-X.Y``, and the appropriate ``clang``
216   binary. Build whole programs with it (ex. Chromium, Firefox, Apache) for
217   your platform.
218
219#. Download ``llvm-X.Y``, ``llvm-test-X.Y``, and the appropriate ``clang``
220   binary. Build *your* programs with it and check for conformance and
221   performance regressions.
222
223#. Run the :doc:`release process <ReleaseProcess>`, if your platform is
224   *different* than that which is officially supported, and report back errors
225   only if they were not reported by the official release tester for that
226   architecture.
227
228We also ask that the OS distribution release managers test their packages with
229the first candidate of every release, and report any *new* errors in Bugzilla.
230If the bug can be reproduced with an unpatched upstream version of the release
231candidate (as opposed to the distribution's own build), the priority should be
232release blocker.
233
234During the first round of testing, all regressions must be fixed before the
235second release candidate is tagged.
236
237In the subsequent stages, the testing is only to ensure that bug
238fixes previously merged in have not created new major problems. *This is not
239the time to solve additional and unrelated bugs!* If no patches are merged in,
240the release is determined to be ready and the release manager may move onto the
241next stage.
242
243Reporting Regressions
244---------------------
245
246Every regression that is found during the tests (as per the criteria above),
247should be filled in a bug in Bugzilla with the priority *release blocker* and
248blocking a specific release.
249
250To help manage all the bugs reported and which ones are blockers or not, a new
251"[meta]" bug should be created and all regressions *blocking* that Meta. Once
252all blockers are done, the Meta can be closed.
253
254If a bug can't be reproduced, or stops being a blocker, it should be removed
255from the Meta and its priority decreased to *normal*. Debugging can continue,
256but on trunk.
257
258Merge Requests
259--------------
260
261You can use any of the following methods to request that a revision from trunk
262be merged into a release branch:
263
264#. Use the ``utils/release/merge-request.sh`` script which will automatically
265   file a bug_ requesting that the patch be merged. e.g. To request revision
266   12345 be merged into the branch for the 5.0.1 release:
267   ``llvm.src/utils/release/merge-request.sh -stable-version 5.0 -r 12345 -user bugzilla@example.com``
268
269#. Manually file a bug_ with the subject: "Merge r12345 into the X.Y branch",
270   enter the commit(s) that you want merged in the "Fixed by Commit(s)" and mark
271   it as a blocker of the current release bug.  Release bugs are given aliases
272   in the form of release-x.y.z, so to mark a bug as a blocker for the 5.0.1
273   release, just enter release-5.0.1 in the "Blocks" field.
274
275#. Reply to the commit email on llvm-commits for the revision to merge and cc
276   the release manager.
277
278.. _bug: https://bugs.llvm.org/
279
280Release Patch Rules
281-------------------
282
283Below are the rules regarding patching the release branch:
284
285#. Patches applied to the release branch may only be applied by the release
286   manager, the official release testers or the code owners with approval from
287   the release manager.
288
289#. During the first round of testing, patches that fix regressions or that are
290   small and relatively risk free (verified by the appropriate code owner) are
291   applied to the branch.  Code owners are asked to be very conservative in
292   approving patches for the branch.  We reserve the right to reject any patch
293   that does not fix a regression as previously defined.
294
295#. During the remaining rounds of testing, only patches that fix critical
296   regressions may be applied.
297
298#. For dot releases all patches must maintain both API and ABI compatibility with
299   the previous major release.  Only bug-fixes will be accepted.
300
301Merging Patches
302^^^^^^^^^^^^^^^
303
304The ``utils/release/merge.sh`` script can be used to merge individual revisions
305into any one of the llvm projects. To merge revision ``$N`` into project
306``$PROJ``, do:
307
308#. ``svn co https://llvm.org/svn/llvm-project/$PROJ/branches/release_XX
309   $PROJ.src``
310
311#. ``$PROJ.src/utils/release/merge.sh --proj $PROJ --rev $N``
312
313#. Run regression tests.
314
315#. ``cd $PROJ.src``. Run the ``svn commit`` command printed out by ``merge.sh``
316   in step 2.
317
318Release Final Tasks
319-------------------
320
321The final stages of the release process involves tagging the "final" release
322branch, updating documentation that refers to the release, and updating the
323demo page.
324
325Update Documentation
326^^^^^^^^^^^^^^^^^^^^
327
328Review the documentation and ensure that it is up to date.  The "Release Notes"
329must be updated to reflect new features, bug fixes, new known issues, and
330changes in the list of supported platforms.  The "Getting Started Guide" should
331be updated to reflect the new release version number tag available from
332Subversion and changes in basic system requirements.  Merge both changes from
333mainline into the release branch.
334
335.. _tag:
336
337Tag the LLVM Final Release
338^^^^^^^^^^^^^^^^^^^^^^^^^^
339
340Tag the final release sources using the tag.sh script in utils/release.
341
342::
343
344  $ ./tag.sh -release X.Y.Z -final
345
346Update the LLVM Demo Page
347-------------------------
348
349The LLVM demo page must be updated to use the new release.  This consists of
350using the new ``clang`` binary and building LLVM.
351
352Update the LLVM Website
353^^^^^^^^^^^^^^^^^^^^^^^
354
355The website must be updated before the release announcement is sent out.  Here
356is what to do:
357
358#. Check out the ``www`` module from Subversion.
359
360#. Create a new sub-directory ``X.Y`` in the releases directory.
361
362#. Commit the ``llvm``, ``test-suite``, ``clang`` source and binaries in this
363   new directory.
364
365#. Copy and commit the ``llvm/docs`` and ``LICENSE.txt`` files into this new
366   directory.  The docs should be built with ``BUILD_FOR_WEBSITE=1``.
367
368#. Commit the ``index.html`` to the ``release/X.Y`` directory to redirect (use
369   from previous release).
370
371#. Update the ``releases/download.html`` file with the new release.
372
373#. Update the ``releases/index.html`` with the new release and link to release
374   documentation.
375
376#. Finally, update the main page (``index.html`` and sidebar) to point to the
377   new release and release announcement.  Make sure this all gets committed back
378   into Subversion.
379
380Announce the Release
381^^^^^^^^^^^^^^^^^^^^
382
383Send an email to the list announcing the release, pointing people to all the
384relevant documentation, download pages and bugs fixed.
385
386