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
53* Announce bug fix release schedule to the LLVM community and update the website.
54
55* Tag bug fix -rc1 after 4 weeks have passed.
56
57* Tag bug fix -rc2 4 weeks after -rc1.
58
59* Tag additional -rc candidates, if needed, to fix critical issues in
60  previous -rc releases.
61
62* Tag final release.
63
64Release Process
65===============
66
67.. contents::
68   :local:
69
70Release Administrative Tasks
71----------------------------
72
73This section describes a few administrative tasks that need to be done for the
74release process to begin.  Specifically, it involves:
75
76* Updating version numbers,
77
78* Creating the release branch, and
79
80* Tagging release candidates for the release team to begin testing.
81
82Create Release Branch
83^^^^^^^^^^^^^^^^^^^^^
84
85Branch the Git trunk using the following procedure:
86
87#. Remind developers that the release branching is imminent and to refrain from
88   committing patches that might break the build.  E.g., new features, large
89   patches for works in progress, an overhaul of the type system, an exciting
90   new TableGen feature, etc.
91
92#. Verify that the current git trunk is in decent shape by
93   examining nightly tester and buildbot results.
94
95#. Bump the version in trunk to N.0.0git and tag the commit with llvmorg-N-init.
96   If ``X`` is the version to be released, then ``N`` is ``X + 1``.
97
98::
99
100  $ git tag -a llvmorg-N-init
101
102#. Clear the release notes in trunk.
103
104#. Create the release branch from the last known good revision from before the
105   version bump.  The branch's name is release/X.x where ``X`` is the major version
106   number and ``x`` is just the letter ``x``.
107
108#. All tags and branches need to be created in both the llvm/llvm-project and
109   llvm/llvm-test-suite repos.
110
111Update LLVM Version
112^^^^^^^^^^^^^^^^^^^
113
114After creating the LLVM release branch, update the release branches'
115``CMakeLists.txt`` versions from '``X.0.0git``' to '``X.0.0``'.
116
117In addition, the version numbers of all the Bugzilla components must be updated
118for the next release.
119
120Tagging the LLVM Release Candidates
121^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122
123Tag release candidates:
124
125::
126
127  $ git tag -a llvmorg-X.Y.Z-rcN
128
129The Release Manager must supply pre-packaged source tarballs for users.  This can
130be done with the export.sh script in utils/release.
131
132Tarballs, release binaries,  or any other release artifacts must be uploaded to
133GitHub.  This can be done using the github-upload-release.py script in utils/release.
134
135::
136
137  $ github-upload-release.py upload --token <github-token> --release X.Y.Z-rcN --files <release_files>
138
139::
140
141  $ ./export.sh -release X.Y.Z -rc $RC
142
143This will generate source tarballs for each LLVM project being validated, which
144can be uploaded to github for further testing.
145
146Build The Binary Distribution
147^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148
149Creating the binary distribution requires following the instructions
150:doc:`here <ReleaseProcess>`.
151
152That process will perform both Release+Asserts and Release builds but only
153pack the Release build for upload. You should use the Release+Asserts sysroot,
154normally under ``final/Phase3/Release+Asserts/llvmCore-3.8.1-RCn.install/``,
155for test-suite and run-time benchmarks, to make sure nothing serious has
156passed through the net. For compile-time benchmarks, use the Release version.
157
158The minimum required version of the tools you'll need are :doc:`here <GettingStarted>`
159
160Release Qualification Criteria
161------------------------------
162
163There are no official release qualification criteria.  It is up to the
164the release manager to determine when a release is ready.  The release manager
165should pay attention to the results of community testing, the number of outstanding
166bugs, and then number of regressions when determining whether or not to make a
167release.
168
169The community values time based releases, so releases should not be delayed for
170too long unless there are critical issues remaining.  In most cases, the only
171kind of bugs that are critical enough to block a release would be a major regression
172from a previous release.
173
174Official Testing
175----------------
176
177A few developers in the community have dedicated time to validate the release
178candidates and volunteered to be the official release testers for each
179architecture.
180
181These will be the ones testing, generating and uploading the official binaries
182to the server, and will be the minimum tests *necessary* for the release to
183proceed.
184
185This will obviously not cover all OSs and distributions, so additional community
186validation is important. However, if community input is not reached before the
187release is out, all bugs reported will have to go on the next stable release.
188
189The official release managers are:
190
191* Major releases (X.0): Hans Wennborg
192* Stable releases (X.n): Tom Stellard
193
194The official release testers are volunteered from the community and have
195consistently validated and released binaries for their targets/OSs. To contact
196them, you should email the ``[email protected]`` mailing list.
197
198The official testers list is in the file ``RELEASE_TESTERS.TXT``, in the ``LLVM``
199repository.
200
201Community Testing
202-----------------
203
204Once all testing has been completed and appropriate bugs filed, the release
205candidate tarballs are put on the website and the LLVM community is notified.
206
207We ask that all LLVM developers test the release in any the following ways:
208
209#. Download ``llvm-X.Y``, ``llvm-test-X.Y``, and the appropriate ``clang``
210   binary.  Build LLVM.  Run ``make check`` and the full LLVM test suite (``make
211   TEST=nightly report``).
212
213#. Download ``llvm-X.Y``, ``llvm-test-X.Y``, and the ``clang`` sources.  Compile
214   everything.  Run ``make check`` and the full LLVM test suite (``make
215   TEST=nightly report``).
216
217#. Download ``llvm-X.Y``, ``llvm-test-X.Y``, and the appropriate ``clang``
218   binary. Build whole programs with it (ex. Chromium, Firefox, Apache) for
219   your platform.
220
221#. Download ``llvm-X.Y``, ``llvm-test-X.Y``, and the appropriate ``clang``
222   binary. Build *your* programs with it and check for conformance and
223   performance regressions.
224
225#. Run the :doc:`release process <ReleaseProcess>`, if your platform is
226   *different* than that which is officially supported, and report back errors
227   only if they were not reported by the official release tester for that
228   architecture.
229
230We also ask that the OS distribution release managers test their packages with
231the first candidate of every release, and report any *new* errors in Bugzilla.
232If the bug can be reproduced with an unpatched upstream version of the release
233candidate (as opposed to the distribution's own build), the priority should be
234release blocker.
235
236During the first round of testing, all regressions must be fixed before the
237second release candidate is tagged.
238
239In the subsequent stages, the testing is only to ensure that bug
240fixes previously merged in have not created new major problems. *This is not
241the time to solve additional and unrelated bugs!* If no patches are merged in,
242the release is determined to be ready and the release manager may move onto the
243next stage.
244
245Reporting Regressions
246---------------------
247
248Every regression that is found during the tests (as per the criteria above),
249should be filled in a bug in Bugzilla with the priority *release blocker* and
250blocking a specific release.
251
252To help manage all the bugs reported and which ones are blockers or not, a new
253"[meta]" bug should be created and all regressions *blocking* that Meta. Once
254all blockers are done, the Meta can be closed.
255
256If a bug can't be reproduced, or stops being a blocker, it should be removed
257from the Meta and its priority decreased to *normal*. Debugging can continue,
258but on trunk.
259
260Backport Requests
261-----------------
262
263Instructions for requesting a backport to a stable branch can be found :doc:`here <GitHub>`.
264
265Triaging Bug Reports for Releases
266---------------------------------
267
268This section describes how to triage bug reports:
269
270#. Search for bugs with a Release Milestone that have not been added to the
271   "Release Status" github project:
272
273   https://github.com/llvm/llvm-project/issues?q=is%3Aissue+milestone%3A%22LLVM+14.0.5+Release%22+no%3Aproject+
274
275   Replace 14.0.5 in this query with the version from the Release Milestone being
276   targeted.
277
278   Add these bugs to the "Release Status" project.
279
280#. Navigate to the `Release Status project <https://github.com/orgs/llvm/projects/3>`_
281   to see the list of bugs that are being considered for the release.
282
283#. Review each bug and first check if it has been fixed in main.  If it has, update
284   its status to "Needs Pull Request", and create a pull request for the fix
285   using the /cherry-pick or /branch comments if this has not been done already.
286
287#. If a bug has been fixed and has a pull request created for backporting it,
288   then update its status to "Needs Review" and notify a knowledgeable reviewer.
289   Usually you will want to notify the person who approved the patch in Phabricator,
290   but you may use your best judgement on who a good reviewer would be.  Once
291   you have identified the reviewer(s), assign the issue to them and mention
292   them (i.e @username) in a comment and ask them if the patch is safe to backport.
293   You should also review the bug yourself to ensure that it meets the requirements
294   for committing to the release branch.
295
296#. Once a bug has been reviewed, add the release:reviewed label and update the
297   issue's status to "Needs Merge".  Check the pull request associated with the
298   issue.  If all the tests pass, then the pull request can be merged.  If not,
299   then add a comment on the issue asking someone to take a look at the failures.
300
301#. Once the pull request has been merged push it to the official release branch:
302
303   ::
304
305      git checkout release/XX.x
306      git pull --ff-only https://github.com/llvm/llvm-project-release-prs release/XX.x
307      git push https://github.com/llvm/llvm-project release/XX.x:release/XX.x
308
309   Then add a comment to the issue stating that the fix has been merged along with
310   the git hashes from the release branch.  Add the release:merged label to the issue
311   and close it.
312
313
314Release Patch Rules
315-------------------
316
317Below are the rules regarding patching the release branch:
318
319#. Patches applied to the release branch may only be applied by the release
320   manager, the official release testers or the code owners with approval from
321   the release manager.
322
323#. Release managers are encouraged, but not required, to get approval from code
324   owners before approving patches.  If there is no code owner or the code owner
325   is unreachable then release managers can ask approval from patch reviewers or
326   other developers active in that area.
327
328#. *Before RC1* Patches should be limited to bug fixes, important optimization
329   improvements, or completion of features that were started before the branch
330   was created.  As with all phases, release managers and code owners can reject
331   patches that are deemed too invasive.
332
333#. *Before RC2* Patches should be limited to bug fixes or backend specific
334   improvements that are determined to be very safe.
335
336#. *Before RC3/Final Major Release* Patches should be limited to critical
337   bugs or regressions.
338
339#. *Bug fix releases* Patches should be limited to bug fixes or very safe
340   and critical performance improvements.  Patches must maintain both API and
341   ABI compatibility with the previous major release.
342
343
344Merging Patches
345^^^^^^^^^^^^^^^
346
347Use the ``git cherry-pick -x`` command to merge patches to the release branch:
348
349#. ``git cherry-pick -x abcdef0``
350
351#. Run regression tests.
352
353Release Final Tasks
354-------------------
355
356The final stages of the release process involves tagging the "final" release
357branch, updating documentation that refers to the release, and updating the
358demo page.
359
360Update Documentation
361^^^^^^^^^^^^^^^^^^^^
362
363Review the documentation in the release branch and ensure that it is up
364to date.  The "Release Notes" must be updated to reflect new features, bug
365fixes, new known issues, and changes in the list of supported platforms.
366The "Getting Started Guide" should be updated to reflect the new release
367version number tag available from Subversion and changes in basic system
368requirements.
369
370.. _tag:
371
372Tag the LLVM Final Release
373^^^^^^^^^^^^^^^^^^^^^^^^^^
374
375Tag the final release sources:
376
377::
378
379  $ git tag -a llvmorg-X.Y.Z
380  $ git push https://github.com/llvm/llvm-project.git llvmorg-X.Y.Z
381
382Update the LLVM Website
383^^^^^^^^^^^^^^^^^^^^^^^
384
385The website must be updated before the release announcement is sent out.  Here
386is what to do:
387
388#. Check out the ``www-releases`` module from GitHub.
389
390#. Create a new sub-directory ``X.Y.Z`` in the releases directory.
391
392#. Copy and commit the ``llvm/docs`` and ``LICENSE.txt`` files into this new
393   directory.
394
395#. Update the ``releases/download.html`` file with links to the release
396   binaries on GitHub.
397
398#. Update the ``releases/index.html`` with the new release and link to release
399   documentation.
400
401#. Finally checkout the llvm-www repo and update the main page
402   (``index.html`` and sidebar) to point to the new release and release
403   announcement.
404
405Announce the Release
406^^^^^^^^^^^^^^^^^^^^
407
408Send an email to the list announcing the release, pointing people to all the
409relevant documentation, download pages and bugs fixed.
410