maint.rst 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. CMake Maintainer Guide
  2. **********************
  3. The following is a guide to CMake maintenance processes.
  4. See documentation on `CMake Development`_ for more information.
  5. .. _`CMake Development`: README.rst
  6. .. contents:: Maintainer Processes:
  7. Review a Merge Request
  8. ======================
  9. The `CMake Review Process`_ requires a maintainer to issue the ``Do: merge``
  10. command to integrate a merge request. Please check at least the following:
  11. * If the MR source branch (or part of it) should be backported
  12. to the ``release`` branch (and is already based on a commit
  13. contained in the ``release`` branch), add a ``Backport: release`` or
  14. ``Backport: release:<commit-ish>`` trailing line to the MR description.
  15. * If the MR source branch is not named well for the change it makes
  16. (e.g. it is just ``master`` or the patch changed during review),
  17. add a ``Topic-rename: <topic>`` trailing line to the MR description
  18. to provide a better topic name.
  19. * If the MR introduces a new feature or a user-facing behavior change,
  20. such as a policy, ensure that a ``Help/release/dev/$topic.rst`` file
  21. is added with a release note.
  22. * If a commit changes a specific area, such as a module, its commit
  23. message should have an ``area:`` prefix on its first line.
  24. * If a commit fixes a tracked issue, its commit message should have
  25. a trailing line such as ``Fixes: #00000``.
  26. * Ensure that the MR adds sufficient documentation and test cases.
  27. * Ensure that the MR has been tested sufficiently. Typically it should
  28. be staged for nightly testing with ``Do: stage``. Then manually
  29. review the `CMake CDash Page`_ to verify that no regressions were
  30. introduced. (Learn to tolerate spurious failures due to idiosyncrasies
  31. of various nightly builders.)
  32. * Ensure that the MR targets the ``master`` branch. A MR intended for
  33. the ``release`` branch should be based on ``release`` but still target
  34. ``master``. Use the above-mentioned ``Backport: release`` line to tell
  35. ``Do: merge`` to merge to both. If a MR is merged without the backport
  36. line, a maintainer may still merge the MR topic to ``release`` manually.
  37. Maintain Current Release
  38. ========================
  39. The ``release`` branch is used to maintain the current release or release
  40. candidate. The branch is published with no version number but maintained
  41. using a local branch named ``release-$ver``, where ``$ver`` is the version
  42. number of the current release in the form ``$major.$minor``. It is always
  43. merged into ``master`` before publishing.
  44. To merge an open MR to the ``release`` branch, edit its description to
  45. use the ``Backport: release`` line mentioned above and then ``Do: merge``
  46. normally. To update the ``release`` branch manually (e.g. to merge a
  47. ``$topic`` branch that was merged without the backport line), use the
  48. following procedure.
  49. Before merging a ``$topic`` branch into ``release``, verify that the
  50. ``$topic`` branch has already been merged to ``master`` via the usual
  51. ``Do: merge`` process. Then, to merge the ``$topic`` branch into
  52. ``release``, start by creating the local branch:
  53. .. code-block:: shell
  54. git fetch origin
  55. git checkout -b release-$ver origin/release
  56. Merge the ``$topic`` branch into the local ``release-$ver`` branch, making
  57. sure to include a ``Merge-request: !xxxx`` footer in the commit message:
  58. .. code-block:: shell
  59. git merge --no-ff $topic
  60. Merge the ``release-$ver`` branch to ``master``:
  61. .. code-block:: shell
  62. git checkout master
  63. git pull
  64. git merge --no-ff release-$ver
  65. Review new ancestry to ensure nothing unexpected was merged to either branch:
  66. .. code-block:: shell
  67. git log --graph --boundary origin/master..master
  68. git log --graph --boundary origin/release..release-$ver
  69. Publish both ``master`` and ``release`` simultaneously:
  70. .. code-block:: shell
  71. git push --atomic origin master release-$ver:release
  72. .. _`CMake Review Process`: review.rst
  73. .. _`CMake CDash Page`: https://open.cdash.org/index.php?project=CMake
  74. Create Release Version
  75. ======================
  76. When the ``release`` branch is ready to create a new release, follow the
  77. steps in the above `Maintain Current Release`_ section to checkout a local
  78. ``release-$ver`` branch, where ``$ver`` is the version number of the
  79. current release in the form ``$major.$minor``.
  80. Edit ``Source/CMakeVersion.cmake`` to set the full version:
  81. .. code-block:: cmake
  82. # CMake version number components.
  83. set(CMake_VERSION_MAJOR $major)
  84. set(CMake_VERSION_MINOR $minor)
  85. set(CMake_VERSION_PATCH $patch)
  86. #set(CMake_VERSION_RC $rc) # uncomment for release candidates
  87. In the following we use the placeholder ``$fullver`` for the full version
  88. number of the new release with the form ``$major.$minor.$patch[-rc$rc]``.
  89. If the version is not a release candidate, comment out the RC version
  90. component above and leave off the ``-rc$rc`` suffix from ``$fullver``.
  91. Commit the release version with the **exact** message ``CMake $fullver``:
  92. .. code-block:: shell
  93. git commit -m "CMake $fullver"
  94. Tag the release using an annotated tag with the same message as the
  95. commit and named with the **exact** form ``v$fullver``:
  96. .. code-block:: shell
  97. git tag -s -m "CMake $fullver" "v$fullver"
  98. Follow the steps in the above `Maintain Current Release`_ section to
  99. merge the ``release-$ver`` branch into ``master`` and publish both.
  100. Branch a New Release
  101. ====================
  102. This section covers how to start a new ``release`` branch for a major or
  103. minor version bump (patch releases remain on their existing branch).
  104. In the following we use the placeholder ``$ver`` to represent the
  105. version number of the new release with the form ``$major.$minor``,
  106. and ``$prev`` to represent the version number of the prior release.
  107. Review Prior Release
  108. --------------------
  109. Review the history around the prior release branch:
  110. .. code-block:: shell
  111. git log --graph --boundary \
  112. ^$(git rev-list --grep="Merge topic 'doc-.*-relnotes'" -n 1 master)~1 \
  113. $(git rev-list --grep="Begin post-.* development" -n 1 master) \
  114. $(git tag --list *-rc1| tail -1)
  115. Consolidate Release Notes
  116. -------------------------
  117. Starting from a clean work tree on ``master``, create a topic branch to
  118. use for consolidating the release notes:
  119. .. code-block:: shell
  120. git checkout -b doc-$ver-relnotes
  121. Run the `consolidate-relnotes.bash`_ script:
  122. .. code-block:: shell
  123. Utilities/Release/consolidate-relnotes.bash $ver $prev
  124. .. _`consolidate-relnotes.bash`: ../../Utilities/Release/consolidate-relnotes.bash
  125. This moves notes from the ``Help/release/dev/*.rst`` files into a versioned
  126. ``Help/release/$ver.rst`` file and updates ``Help/release/index.rst`` to
  127. link to the new document. Commit the changes with a message such as::
  128. Help: Consolidate $ver release notes
  129. Run the `Utilities/Release/consolidate-relnotes.bash` script to move
  130. notes from `Help/release/dev/*` into `Help/release/$ver.rst`.
  131. Manually edit ``Help/release/$ver.rst`` to add section headers, organize
  132. the notes, and revise wording. Then commit with a message such as::
  133. Help: Organize and revise $ver release notes
  134. Add section headers similar to the $prev release notes and move each
  135. individual bullet into an appropriate section. Revise a few bullets.
  136. Open a merge request with the ``doc-$ver-relnotes`` branch for review
  137. and integration. Further steps may proceed after this has been merged
  138. to ``master``.
  139. Update 'release' Branch
  140. -----------------------
  141. Starting from a clean work tree on ``master``, create a new ``release-$ver``
  142. branch locally:
  143. .. code-block:: shell
  144. git checkout -b release-$ver origin/master
  145. Remove the development branch release note infrastructure:
  146. .. code-block:: shell
  147. git rm Help/release/dev/0-sample-topic.rst
  148. sed -i '/^\.\. include:: dev.txt/ {N;d}' Help/release/index.rst
  149. Commit with a message such as::
  150. Help: Drop development topic notes to prepare release
  151. Release versions do not have the development topic section of
  152. the CMake Release Notes index page.
  153. Update ``Source/CMakeVersion.cmake`` to set the version to
  154. ``$major.$minor.0-rc0``:
  155. .. code-block:: cmake
  156. # CMake version number components.
  157. set(CMake_VERSION_MAJOR $major)
  158. set(CMake_VERSION_MINOR $minor)
  159. set(CMake_VERSION_PATCH 0)
  160. set(CMake_VERSION_RC 0)
  161. Update uses of ``DEVEL_CMAKE_VERSION`` in the source tree to mention the
  162. actual version number:
  163. .. code-block:: shell
  164. $EDITOR $(git grep -l DEVEL_CMAKE_VERSION)
  165. Commit with a message such as::
  166. Begin $ver release versioning
  167. Merge the ``release-$ver`` branch to ``master``:
  168. .. code-block:: shell
  169. git checkout master
  170. git pull
  171. git merge --no-ff release-$ver
  172. Begin post-release development by restoring the development branch release
  173. note infrastructure and the version date from ``origin/master``:
  174. .. code-block:: shell
  175. git checkout origin/master -- \
  176. Source/CMakeVersion.cmake Help/release/dev/0-sample-topic.rst
  177. sed -i $'/^Releases/ i\\\n.. include:: dev.txt\\\n' Help/release/index.rst
  178. Update ``Source/CMakeVersion.cmake`` to set the version to
  179. ``$major.$minor.$date``:
  180. .. code-block:: cmake
  181. # CMake version number components.
  182. set(CMake_VERSION_MAJOR $major)
  183. set(CMake_VERSION_MINOR $minor)
  184. set(CMake_VERSION_PATCH $date)
  185. #set(CMake_VERSION_RC 0)
  186. Commit with a message such as::
  187. Begin post-$ver development
  188. Push the update to the ``master`` and ``release`` branches:
  189. .. code-block:: shell
  190. git push --atomic origin master release-$ver:release
  191. Announce 'release' Branch
  192. -------------------------
  193. Post a topic to the `CMake Discourse Forum Development Category`_
  194. announcing that post-release development is open::
  195. I've branched `release` for $ver. The repository is now open for
  196. post-$ver development. Please rebase open merge requests on `master`
  197. before staging or merging.
  198. .. _`CMake Discourse Forum Development Category`: https://discourse.cmake.org/c/development