files-v1.rst 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. File Table v1
  2. *************
  3. The set of package files distributed on ``cmake.org`` varies by CMake version.
  4. One file, named ``cmake-<ver>-files-v1.json``, contains a table of the package
  5. files available for a given version. Clients may use this to find other files.
  6. Format
  7. ------
  8. The format is a JSON object:
  9. .. code-block:: json
  10. {
  11. "version": {
  12. "major": 3, "minor": 20, "patch": 0,
  13. "string": "3.20.0"
  14. },
  15. "files": [
  16. {
  17. "os": ["...", "..."],
  18. "architecture": ["...", "..."],
  19. "class": "...",
  20. "name": "..."
  21. }
  22. ],
  23. "hashFiles": [
  24. {
  25. "algorithm": ["...", "..."],
  26. "name": "cmake-<version>-<algo>.txt",
  27. "signature": ["cmake-<version>-<algo>.txt.asc"]
  28. }
  29. ]
  30. }
  31. The members are:
  32. ``version``
  33. A JSON object specifying the version of CMake with members:
  34. ``major``, ``minor``, ``patch``
  35. Integer values specifying the major, minor, and patch version components.
  36. ``suffix``
  37. A string specifying the version suffix, if any, e.g. ``rc1``.
  38. ``string``
  39. A string specifying the full version in the format
  40. ``<major>.<minor>.<patch>[-<suffix>]``.
  41. ``files``
  42. A JSON array of entries corresponding to available package files.
  43. Each entry is a JSON object containing members:
  44. ``os``
  45. A JSON array of strings naming the operating system for which the
  46. package file is built, possibly using multiple alternative spellings.
  47. Possible names include:
  48. ``source``
  49. Source packages.
  50. ``Linux``, ``linux``
  51. Linux packages.
  52. ``macOS``, ``macos``
  53. macOS packages.
  54. ``Windows``, ``windows``
  55. Windows packages.
  56. ``architecture``
  57. A JSON array of strings naming the architecture(s) for which the
  58. package file is built, possibly using multiple alternative spellings.
  59. Source packages have an empty list of architectures (``[]``).
  60. Binary packages have a non-empty list of architectures, with at least
  61. one name matching the output of ``uname -m`` on corresponding hosts.
  62. On Windows, architecture names include ``x86_64`` and ``i386``.
  63. On macOS, universal binary packages list all architectures,
  64. e.g. ``["arm64","x86_64"]``.
  65. ``class``
  66. A JSON string naming the class of package. The value is one of:
  67. ``archive``
  68. A tarball or zip archive.
  69. The extension, such as ``.tar.gz`` or ``.zip``, indicates the format.
  70. The rest of the file name matches the top-level directory in the archive.
  71. ``installer``
  72. An interactive installer.
  73. ``volume``
  74. A disk image (``.dmg`` on macOS).
  75. ``name``
  76. A JSON string specifying the name of the package file.
  77. ``macOSmin``
  78. Optional member that is present on package files for macOS.
  79. The value is a JSON string specifying the minimum version of macOS
  80. required to run the binary, e.g. ``"10.13"``.
  81. ``deprecated``
  82. Optional member that is present when the package file is deprecated
  83. and may be removed from the set of package files in later versions.
  84. The value is a string containing a deprecation message.
  85. Clients should check this field to warn users when they are using
  86. a deprecated package file.
  87. ``hashFiles``
  88. A JSON array of entries corresponding to files containing cryptographic
  89. hashes of the package file contents. Each entry is a JSON object
  90. containing members:
  91. ``algorithm``
  92. A JSON array of strings naming a cryptographic hash algorithm, possibly
  93. using multiple alternative spellings, e.g. ``["sha256", "SHA-256"]``.
  94. ``name``
  95. A JSON string specifying the name of the file containing hashes,
  96. e.g. ``"cmake-<version>-SHA-256.txt"``.
  97. ``signature``
  98. A JSON array of strings naming files containing a cryptographic
  99. signature of the hash file specified by ``name``, e.g.
  100. ``["cmake-<version>-SHA-256.txt.asc"]``.
  101. ``deprecated``
  102. Optional member that is present when the hash algorithm is deprecated
  103. and may be removed from the set of hash files in later versions.
  104. The value is a string containing a deprecation message.
  105. Clients that rely on a specific hash algorithm should check this
  106. field to determine whether an update is needed.
  107. ``deprecated``
  108. Optional member that is present when `File Table v1`_ has been
  109. deprecated in favor of a newer alternative. The value is a string
  110. containing a deprecation message. Clients should check this field
  111. to determine whether they need an update to use a newer alternative.
  112. The table and hash files are generated by `files.bash`_ from
  113. the `files-v1.json.in`_ template and the package files themselves.
  114. .. _`files.bash`: files.bash
  115. .. _`files-v1.json.in`: files-v1.json.in
  116. Queries
  117. -------
  118. Clients may download the `File Table v1`_ file ``cmake-<ver>-files-v1.json``
  119. and query it to get the name(s) of specific package files adjacent to it.
  120. Make queries as specific as possible in order to account for additional
  121. alternative binaries in future CMake versions.
  122. For example, one may use ``jq`` queries:
  123. * To select a Windows binary archive supporting ``x86_64`` hosts::
  124. .files[] | select((.os[] | . == "windows") and
  125. (.architecture[] | . == "x86_64") and
  126. (.class == "archive")) | .name
  127. * To select a Linux binary archive supporting ``aarch64`` hosts::
  128. .files[] | select((.os[] | . == "linux") and
  129. (.architecture[] | . == "aarch64") and
  130. (.class == "archive")) | .name
  131. * To select a macOS binary archive supporting ``arm64`` hosts::
  132. .files[] | select((.os[] | . == "macos") and
  133. (.architecture[] | . == "arm64") and
  134. (.class == "archive")) | .name
  135. * To select a macOS binary archive supporting macOS 10.12 on ``x86_64`` hosts::
  136. .files[] | select((.os[] | contains("macOS")) and
  137. (.architecture[] | . == "x86_64") and
  138. ([.macOSmin] | inside(["10.10", "10.11", "10.12"]))
  139. ) | .name
  140. * To select a SHA-256 hash file::
  141. .hashFiles[] | select(.algorithm[] | . == "SHA-256") | .name