maint.rst 8.9 KB

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