maint.rst 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. To merge some ``$topic`` branch into ``release``, first create the local
  40. branch:
  41. .. code-block:: shell
  42. git fetch origin
  43. git checkout -b release-$ver origin/release
  44. Merge the ``$topic`` branch into the local ``release-$ver`` branch:
  45. .. code-block:: shell
  46. git merge --no-ff $topic
  47. Merge the ``release-$ver`` branch to ``master``:
  48. .. code-block:: shell
  49. git checkout master
  50. git pull
  51. git merge --no-ff release-$ver
  52. Review new ancestry to ensure nothing unexpected was merged to either branch:
  53. .. code-block:: shell
  54. git log --graph --boundary origin/master..master
  55. git log --graph --boundary origin/release..release-$ver
  56. Publish both ``master`` and ``release`` simultaneously:
  57. .. code-block:: shell
  58. git push --atomic origin master release-$ver:release
  59. .. _`CMake Review Process`: review.rst
  60. .. _`CMake CDash Page`: https://open.cdash.org/index.php?project=CMake
  61. Branch a New Release
  62. ====================
  63. This section covers how to start a new ``release`` branch for a major or
  64. minor version bump (patch releases remain on their existing branch).
  65. In the following we use the placeholder ``$ver`` to represent the
  66. version number of the new release with the form ``$major.$minor``,
  67. and ``$prev`` to represent the version number of the prior release.
  68. Review Prior Release
  69. --------------------
  70. Review the history around the prior release branch:
  71. .. code-block:: shell
  72. git log --graph --boundary \
  73. ^$(git rev-list --grep="Merge topic 'doc-.*-relnotes'" -n 1 master)~1 \
  74. $(git rev-list --grep="Begin post-.* development" -n 1 master) \
  75. $(git tag --list *-rc1| tail -1)
  76. Consolidate Release Notes
  77. -------------------------
  78. Starting from a clean work tree on ``master``, create a topic branch to
  79. use for consolidating the release notes:
  80. .. code-block:: shell
  81. git checkout -b doc-$ver-relnotes
  82. Run the `consolidate-relnotes.bash`_ script:
  83. .. code-block:: shell
  84. Utilities/Release/consolidate-relnotes.bash $ver $prev
  85. .. _`consolidate-relnotes.bash`: ../../Utilities/Release/consolidate-relnotes.bash
  86. This moves notes from the ``Help/release/dev/*.rst`` files into a versioned
  87. ``Help/release/$ver.rst`` file and updates ``Help/release/index.rst`` to
  88. link to the new document. Commit the changes with a message such as::
  89. Help: Consolidate $ver release notes
  90. Run the `Utilities/Release/consolidate-relnotes.bash` script to move
  91. notes from `Help/release/dev/*` into `Help/release/$ver.rst`.
  92. Manually edit ``Help/release/$ver.rst`` to add section headers, organize
  93. the notes, and revise wording. Then commit with a message such as::
  94. Help: Organize and revise $ver release notes
  95. Add section headers similar to the $prev release notes and move each
  96. individual bullet into an appropriate section. Revise a few bullets.
  97. Open a merge request with the ``doc-$ver-relnotes`` branch for review
  98. and integration. Further steps may proceed after this has been merged
  99. to ``master``.
  100. Update 'release' Branch
  101. -----------------------
  102. Starting from a clean work tree on ``master``, create a new ``release-$ver``
  103. branch locally:
  104. .. code-block:: shell
  105. git checkout -b release-$ver origin/master
  106. Remove the development branch release note infrastructure:
  107. .. code-block:: shell
  108. git rm Help/release/dev/0-sample-topic.rst
  109. sed -i '/^\.\. include:: dev.txt/ {N;d}' Help/release/index.rst
  110. Commit with a message such as::
  111. Help: Drop development topic notes to prepare release
  112. Release versions do not have the development topic section of
  113. the CMake Release Notes index page.
  114. Update ``Source/CMakeVersion.cmake`` to set the version to
  115. ``$major.$minor.0-rc1``:
  116. .. code-block:: cmake
  117. # CMake version number components.
  118. set(CMake_VERSION_MAJOR $major)
  119. set(CMake_VERSION_MINOR $minor)
  120. set(CMake_VERSION_PATCH 0)
  121. set(CMake_VERSION_RC 1)
  122. Update ``Utilities/Release/upload_release.cmake``:
  123. .. code-block:: cmake
  124. set(VERSION $ver)
  125. Update uses of ``DEVEL_CMAKE_VERSION`` in the source tree to mention the
  126. actual version number:
  127. .. code-block:: shell
  128. $EDITOR $(git grep -l DEVEL_CMAKE_VERSION)
  129. Commit with a message such as::
  130. CMake $major.$minor.0-rc1 version update
  131. Merge the ``release-$ver`` branch to ``master``:
  132. .. code-block:: shell
  133. git checkout master
  134. git pull
  135. git merge --no-ff release-$ver
  136. Begin post-release development by restoring the development branch release
  137. note infrastructure and the version date from ``origin/master``:
  138. .. code-block:: shell
  139. git checkout origin/master -- \
  140. Source/CMakeVersion.cmake Help/release/dev/0-sample-topic.rst
  141. sed -i $'/^Releases/ i\\\n.. include:: dev.txt\\\n' Help/release/index.rst
  142. Update ``Source/CMakeVersion.cmake`` to set the version to
  143. ``$major.$minor.$date``:
  144. .. code-block:: cmake
  145. # CMake version number components.
  146. set(CMake_VERSION_MAJOR $major)
  147. set(CMake_VERSION_MINOR $minor)
  148. set(CMake_VERSION_PATCH $date)
  149. #set(CMake_VERSION_RC 1)
  150. Commit with a message such as::
  151. Begin post-$ver development
  152. Push the update to the ``master`` and ``release`` branches:
  153. .. code-block:: shell
  154. git push --atomic origin master release-$ver:release
  155. Announce 'release' Branch
  156. -------------------------
  157. Send email to the ``cmake-developers@cmake.org`` mailing list (perhaps
  158. in reply to a release preparation thread) announcing that post-release
  159. development is open::
  160. I've branched 'release' for $ver. The repository is now open for
  161. post-$ver development. Please rebase open merge requests on 'master'
  162. before staging or merging.