1
0

maint.rst 7.7 KB

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