maint.rst 7.2 KB

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