From fc9c1d83bf23852bfeb280aac2890b5b3fc94414 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Mar 2021 16:35:16 -0500 Subject: Tests: Add RunCMake helper to run a plain script Many tests covering CMake scripting commands can work without initializing a full generator. --- Tests/RunCMake/RunCMake.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index cb20fb1..042770c 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -205,6 +205,11 @@ function(run_cmake_command test) run_cmake(${test}) endfunction() +function(run_cmake_script test) + set(RunCMake_TEST_COMMAND ${CMAKE_COMMAND} ${ARGN} -P ${RunCMake_SOURCE_DIR}/${test}.cmake) + run_cmake(${test}) +endfunction() + function(run_cmake_with_options test) set(RunCMake_TEST_OPTIONS "${ARGN}") run_cmake(${test}) -- cgit v0.12 From 0237eba318b52720f07b69c3d5df0fcb90c75c66 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 30 Mar 2021 07:52:36 -0400 Subject: Utilities/Release: Add script to generate a table of files Fixes: #22002 --- Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/CMakeRelease/FileTable-stdout.txt | 36 ++++++ Tests/RunCMake/CMakeRelease/FileTable.cmake | 20 +++ Tests/RunCMake/CMakeRelease/RunCMakeTest.cmake | 10 ++ Utilities/Release/README.rst | 11 ++ Utilities/Release/files-sign.bash | 5 + Utilities/Release/files-v1.json.in | 80 ++++++++++++ Utilities/Release/files-v1.rst | 157 +++++++++++++++++++++++ Utilities/Release/files.bash | 84 ++++++++++++ 9 files changed, 404 insertions(+) create mode 100644 Tests/RunCMake/CMakeRelease/FileTable-stdout.txt create mode 100644 Tests/RunCMake/CMakeRelease/FileTable.cmake create mode 100644 Tests/RunCMake/CMakeRelease/RunCMakeTest.cmake create mode 100755 Utilities/Release/files-sign.bash create mode 100644 Utilities/Release/files-v1.json.in create mode 100644 Utilities/Release/files-v1.rst create mode 100755 Utilities/Release/files.bash diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 36409d8..2a39e73 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -197,6 +197,7 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja") add_RunCMake_test(Byproducts) endif() add_RunCMake_test(CMakeRoleGlobalProperty) +add_RunCMake_test(CMakeRelease -DCMake_TEST_JQ=${CMake_TEST_JQ}) if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja") add_RunCMake_test(CompilerChange) endif() diff --git a/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt b/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt new file mode 100644 index 0000000..441e9b0 --- /dev/null +++ b/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt @@ -0,0 +1,36 @@ +^-- query: \.version \| \.major , \.minor , \.patch , \.suffix, \.string +1 +2 +3 +"rc4" +"@version@" +-- query: \.files\[\]\.name +"cmake-@version@-Linux-x86_64\.sh" +"cmake-@version@-Linux-x86_64\.tar\.gz" +"cmake-@version@-Darwin-x86_64\.dmg" +"cmake-@version@-Darwin-x86_64\.tar\.gz" +"cmake-@version@-win32-x86\.msi" +"cmake-@version@-win32-x86\.zip" +"cmake-@version@-win64-x64\.msi" +"cmake-@version@-win64-x64\.zip" +"cmake-@version@\.tar\.gz" +"cmake-@version@\.zip" +-- query: \.files\[\] \| select\(\.os\[\] \| \. == "source"\) \| \.name +"cmake-@version@\.tar\.gz" +"cmake-@version@\.zip" +-- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "macOS"\) and \(\.class == "volume"\)\) \| \.name +"cmake-@version@-Darwin-x86_64\.dmg" +-- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "windows"\) and \(\.architecture\[\] \| \. == "i386"\) and \(\.class == "installer"\)\) \| \.name +"cmake-@version@-win32-x86\.msi" +-- query: \.files\[\] \| select\(\.architecture\[\] \| \. == "x86_64"\) \| \.name +"cmake-@version@-Linux-x86_64\.sh" +"cmake-@version@-Linux-x86_64\.tar\.gz" +"cmake-@version@-Darwin-x86_64\.dmg" +"cmake-@version@-Darwin-x86_64\.tar\.gz" +"cmake-@version@-win64-x64\.msi" +"cmake-@version@-win64-x64\.zip" +-- query: \.files\[\] \| select\(\[\.macOSmin\] \| inside\(\["10\.7", "10\.8", "10\.9"\]\)\) \| \.name +"cmake-@version@-Darwin-x86_64\.dmg" +"cmake-@version@-Darwin-x86_64\.tar\.gz" +-- query: \.hashFiles\[\] \| select\(\.algorithm\[\] \| \. == "SHA-256"\) \| \.name +"cmake-@version@-SHA-256\.txt"$ diff --git a/Tests/RunCMake/CMakeRelease/FileTable.cmake b/Tests/RunCMake/CMakeRelease/FileTable.cmake new file mode 100644 index 0000000..1bddeb8 --- /dev/null +++ b/Tests/RunCMake/CMakeRelease/FileTable.cmake @@ -0,0 +1,20 @@ +set(version "@version@") +set(version_major "1") +set(version_minor "2") +set(version_patch "3") +set(maybe_version_suffix "\"suffix\": \"rc4\",") +configure_file("${CMAKE_CURRENT_LIST_DIR}/../../../Utilities/Release/files-v1.json.in" "files-v1.json" @ONLY) + +foreach(query + ".version | .major , .minor , .patch , .suffix, .string" + ".files[].name" + ".files[] | select(.os[] | . == \"source\") | .name" + ".files[] | select((.os[] | . == \"macOS\") and (.class == \"volume\")) | .name" + ".files[] | select((.os[] | . == \"windows\") and (.architecture[] | . == \"i386\") and (.class == \"installer\")) | .name" + ".files[] | select(.architecture[] | . == \"x86_64\") | .name" + ".files[] | select([.macOSmin] | inside([\"10.7\", \"10.8\", \"10.9\"])) | .name" + ".hashFiles[] | select(.algorithm[] | . == \"SHA-256\") | .name" + ) + message(STATUS "query: ${query}") + execute_process(COMMAND ${JQ} "${query}" files-v1.json) +endforeach() diff --git a/Tests/RunCMake/CMakeRelease/RunCMakeTest.cmake b/Tests/RunCMake/CMakeRelease/RunCMakeTest.cmake new file mode 100644 index 0000000..9a08ff3 --- /dev/null +++ b/Tests/RunCMake/CMakeRelease/RunCMakeTest.cmake @@ -0,0 +1,10 @@ +include(RunCMake) + +if(CMake_TEST_JQ) + set(JQ "${CMake_TEST_JQ}") +else() + find_program(JQ NAMES jq) +endif() +if(JQ) + run_cmake_script(FileTable -DJQ=${JQ}) +endif() diff --git a/Utilities/Release/README.rst b/Utilities/Release/README.rst index 9993afa..cbe6033 100644 --- a/Utilities/Release/README.rst +++ b/Utilities/Release/README.rst @@ -6,6 +6,17 @@ on ``cmake.org``. See also the `CMake Source Code Guide`_. .. _`CMake Source Code Guide`: ../../Help/dev/source.rst +File Table +---------- + +The set of package files distributed on ``cmake.org`` varies by CMake version. +Clients providing automatic download functionality may query the set of +package files available using a special file that lists them: + +* `File Table v1`_ Documentation + +.. _`File Table v1`: files-v1.rst + Docker ------ diff --git a/Utilities/Release/files-sign.bash b/Utilities/Release/files-sign.bash new file mode 100755 index 0000000..414859d --- /dev/null +++ b/Utilities/Release/files-sign.bash @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +gpg --armor --detach-sign cmake-*-SHA-256.txt diff --git a/Utilities/Release/files-v1.json.in b/Utilities/Release/files-v1.json.in new file mode 100644 index 0000000..8fef411 --- /dev/null +++ b/Utilities/Release/files-v1.json.in @@ -0,0 +1,80 @@ +{ + "version": { + "major": @version_major@, + "minor": @version_minor@, + "patch": @version_patch@, + @maybe_version_suffix@ + "string": "@version@" + }, + "files": [ + { + "os": ["linux", "Linux"], + "architecture": ["x86_64"], + "class": "installer", + "name": "cmake-@version@-Linux-x86_64.sh" + }, + { + "os": ["linux", "Linux"], + "architecture": ["x86_64"], + "class": "archive", + "name": "cmake-@version@-Linux-x86_64.tar.gz" + }, + { + "os": ["macos", "macOS"], + "architecture": ["x86_64"], + "class": "volume", + "name": "cmake-@version@-Darwin-x86_64.dmg", + "macOSmin": "10.7" + }, + { + "os": ["macos", "macOS"], + "architecture": ["x86_64"], + "class": "archive", + "name": "cmake-@version@-Darwin-x86_64.tar.gz", + "macOSmin": "10.7" + }, + { + "os": ["windows", "Windows"], + "architecture": ["i386"], + "class": "installer", + "name": "cmake-@version@-win32-x86.msi" + }, + { + "os": ["windows", "Windows"], + "architecture": ["i386"], + "class": "archive", + "name": "cmake-@version@-win32-x86.zip" + }, + { + "os": ["windows", "Windows"], + "architecture": ["x86_64"], + "class": "installer", + "name": "cmake-@version@-win64-x64.msi" + }, + { + "os": ["windows", "Windows"], + "architecture": ["x86_64"], + "class": "archive", + "name": "cmake-@version@-win64-x64.zip" + }, + { + "os": ["source"], + "architecture": [], + "class": "archive", + "name": "cmake-@version@.tar.gz" + }, + { + "os": ["source"], + "architecture": [], + "class": "archive", + "name": "cmake-@version@.zip" + } + ], + "hashFiles": [ + { + "algorithm": ["sha256", "SHA-256"], + "name": "cmake-@version@-SHA-256.txt", + "signature": ["cmake-@version@-SHA-256.txt.asc"] + } + ] +} diff --git a/Utilities/Release/files-v1.rst b/Utilities/Release/files-v1.rst new file mode 100644 index 0000000..4ee50df --- /dev/null +++ b/Utilities/Release/files-v1.rst @@ -0,0 +1,157 @@ +File Table v1 +************* + +The set of package files distributed on ``cmake.org`` varies by CMake version. +One file, named ``cmake--files-v1.json``, contains a table of the package +files available for a given version. Clients may use this to find other files. + +Format +------ + +The format is a JSON object: + +.. code-block:: json + + { + "version": { + "major": 3, "minor": 18, "patch": 6, + "string": "3.18.6" + }, + "files": [ + { + "os": ["...", "..."], + "architecture": ["...", "..."], + "class": "...", + "name": "..." + } + ], + "hashFiles": [ + { + "algorithm": ["...", "..."], + "name": "cmake--.txt", + "signature": ["cmake--.txt.asc"] + } + ] + } + +The members are: + +``version`` + A JSON object specifying the version of CMake with members: + + ``major``, ``minor``, ``patch`` + Integer values specifying the major, minor, and patch version components. + + ``suffix`` + A string specifying the version suffix, if any, e.g. ``rc1``. + + ``string`` + A string specifying the full version in the format + ``..[-]``. + +``files`` + A JSON array of entries corresponding to available package files. + Each entry is a JSON object containing members: + + ``os`` + A JSON array of strings naming the operating system for which the + package file is built, possibly using multiple alternative spellings. + Possible names include: + + ``source`` + Source packages. + + ``Linux``, ``linux`` + Linux packages. + + ``macOS``, ``macos`` + macOS packages. + + ``Windows``, ``windows`` + Windows packages. + + ``architecture`` + A JSON array of strings naming the architecture(s) for which the + package file is built, possibly using multiple alternative spellings. + Source packages have an empty list of architectures (``[]``). + Binary packages have a non-empty list of architectures, with at least + one name matching the output of ``uname -m`` on corresponding hosts. + On Windows, architecture names include ``x86_64`` and ``i386``. + + ``class`` + A JSON string naming the class of package. The value is one of: + + ``archive`` + A tarball or zip archive. + The extension, such as ``.tar.gz`` or ``.zip``, indicates the format. + The rest of the file name matches the top-level directory in the archive. + + ``installer`` + An interactive installer. + + ``volume`` + A disk image (``.dmg`` on macOS). + + ``name`` + A JSON string specifying the name of the package file. + + ``macOSmin`` + Optional member that is present on package files for macOS. + The value is a JSON string specifying the minimum version of macOS + required to run the binary, e.g. ``"10.7"``. + +``hashFiles`` + A JSON array of entries corresponding to files containing cryptographic + hashes of the package file contents. Each entry is a JSON object + containing members: + + ``algorithm`` + A JSON array of strings naming a cryptographic hash algorithm, possibly + using multiple alternative spellings, e.g. ``["sha256", "SHA-256"]``. + + ``name`` + A JSON string specifying the name of the file containing hashes, + e.g. ``"cmake--SHA-256.txt"``. + + ``signature`` + A JSON array of strings naming files containing a cryptographic + signature of the hash file specified by ``name``, e.g. + ``["cmake--SHA-256.txt.asc"]``. + +The table and hash files are generated by `files.bash`_ from +the `files-v1.json.in`_ template and the package files themselves. + +.. _`files.bash`: files.bash +.. _`files-v1.json.in`: files-v1.json.in + +Queries +------- + +Clients may download the `File Table v1`_ file ``cmake--files-v1.json`` +and query it to get the name(s) of specific package files adjacent to it. +Make queries as specific as possible in order to account for additional +alternative binaries in future CMake versions. + +For example, one may use ``jq`` queries: + +* To select a Windows binary archive supporting ``x86_64`` hosts:: + + .files[] | select((.os[] | . == "windows") and + (.architecture[] | . == "x86_64") and + (.class == "archive")) | .name + +* To select a Linux binary archive supporting ``x86_64`` hosts:: + + .files[] | select((.os[] | . == "linux") and + (.architecture[] | . == "x86_64") and + (.class == "archive")) | .name + +* To select a macOS binary archive supporting ``x86_64`` hosts:: + + .files[] | select((.os[] | . == "macos") and + (.architecture[] | . == "x86_64") and + (.class == "archive")) | .name + +* To select a SHA-256 hash file:: + + .hashFiles[] | select(.algorithm[] | . == "SHA-256") | .name diff --git a/Utilities/Release/files.bash b/Utilities/Release/files.bash new file mode 100755 index 0000000..28ca8f1 --- /dev/null +++ b/Utilities/Release/files.bash @@ -0,0 +1,84 @@ +#!/usr/bin/env bash + +set -e + +usage='usage: files.bash [] [--] + +Options: + + --version CMake . version number to push. + Defaults to version of source tree. +' + +die() { + echo "$@" 1>&2; exit 1 +} + +readonly cmake_source_dir="${BASH_SOURCE%/*}/../.." + +cmake_version_component() +{ + sed -n " +/^set(CMake_VERSION_${1}/ {s/set(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;} +" "${cmake_source_dir}/Source/CMakeVersion.cmake" +} + + +version='' +while test "$#" != 0; do + case "$1" in + --version) shift; version="$1" ;; + --) shift ; break ;; + -*) die "$usage" ;; + *) break ;; + esac + shift +done +test "$#" = 0 || die "$usage" + +if test -z "$version"; then + cmake_version_major="$(cmake_version_component MAJOR)" + cmake_version_minor="$(cmake_version_component MINOR)" + cmake_version_patch="$(cmake_version_component PATCH)" + cmake_version_rc="$(cmake_version_component RC)" + version="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}" + if test -n "$cmake_version_rc"; then + version="$version-rc$cmake_version_rc" + fi +fi +readonly version + +IFS='.-' read version_major version_minor version_patch version_suffix <<< "$version" +readonly version_major +readonly version_minor +readonly version_patch +readonly version_suffix + +if test -n "$version_suffix"; then + maybe_version_suffix='"suffix": "'"$version_suffix"'",' +else + maybe_version_suffix='' +fi +readonly maybe_version_suffix + +readonly files_v1_in="${BASH_SOURCE%/*}/files-v1.json.in" +sed " + s/@version@/$version/g + s/@version_major@/$version_major/g + s/@version_minor@/$version_minor/g + s/@version_patch@/$version_patch/g + s/@maybe_version_suffix@/$maybe_version_suffix/g +" "$files_v1_in" \ + | jq . \ + > "cmake-$version-files-v1.json" + +readonly algos=' + 256 +' +for algo in $algos; do + shasum -a $algo \ + "cmake-$version-files-v1.json" \ + $(jq -r '.files[].name' "cmake-$version-files-v1.json") \ + | LC_ALL=C sort -k 2 \ + > "cmake-$version-SHA-$algo.txt" +done -- cgit v0.12 From 004dbbaddd1a040b44cb637e298997e332f40f11 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 31 Mar 2021 12:10:34 -0400 Subject: Utilities/Release: Update file table for 3.19.2 --- Tests/RunCMake/CMakeRelease/FileTable-stdout.txt | 16 ++++++++-------- Tests/RunCMake/CMakeRelease/FileTable.cmake | 2 +- Utilities/Release/files-v1.json.in | 12 ++++++------ Utilities/Release/files-v1.rst | 8 +++++--- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt b/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt index 441e9b0..50b3711 100644 --- a/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt +++ b/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt @@ -7,8 +7,8 @@ -- query: \.files\[\]\.name "cmake-@version@-Linux-x86_64\.sh" "cmake-@version@-Linux-x86_64\.tar\.gz" -"cmake-@version@-Darwin-x86_64\.dmg" -"cmake-@version@-Darwin-x86_64\.tar\.gz" +"cmake-@version@-macos-universal\.dmg" +"cmake-@version@-macos-universal\.tar\.gz" "cmake-@version@-win32-x86\.msi" "cmake-@version@-win32-x86\.zip" "cmake-@version@-win64-x64\.msi" @@ -19,18 +19,18 @@ "cmake-@version@\.tar\.gz" "cmake-@version@\.zip" -- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "macOS"\) and \(\.class == "volume"\)\) \| \.name -"cmake-@version@-Darwin-x86_64\.dmg" +"cmake-@version@-macos-universal\.dmg" -- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "windows"\) and \(\.architecture\[\] \| \. == "i386"\) and \(\.class == "installer"\)\) \| \.name "cmake-@version@-win32-x86\.msi" -- query: \.files\[\] \| select\(\.architecture\[\] \| \. == "x86_64"\) \| \.name "cmake-@version@-Linux-x86_64\.sh" "cmake-@version@-Linux-x86_64\.tar\.gz" -"cmake-@version@-Darwin-x86_64\.dmg" -"cmake-@version@-Darwin-x86_64\.tar\.gz" +"cmake-@version@-macos-universal\.dmg" +"cmake-@version@-macos-universal\.tar\.gz" "cmake-@version@-win64-x64\.msi" "cmake-@version@-win64-x64\.zip" --- query: \.files\[\] \| select\(\[\.macOSmin\] \| inside\(\["10\.7", "10\.8", "10\.9"\]\)\) \| \.name -"cmake-@version@-Darwin-x86_64\.dmg" -"cmake-@version@-Darwin-x86_64\.tar\.gz" +-- query: \.files\[\] \| select\(\[\.macOSmin\] \| inside\(\["10\.10", "10\.11", "10\.12"\]\)\) \| \.name +"cmake-@version@-macos-universal\.dmg" +"cmake-@version@-macos-universal\.tar\.gz" -- query: \.hashFiles\[\] \| select\(\.algorithm\[\] \| \. == "SHA-256"\) \| \.name "cmake-@version@-SHA-256\.txt"$ diff --git a/Tests/RunCMake/CMakeRelease/FileTable.cmake b/Tests/RunCMake/CMakeRelease/FileTable.cmake index 1bddeb8..55e6955 100644 --- a/Tests/RunCMake/CMakeRelease/FileTable.cmake +++ b/Tests/RunCMake/CMakeRelease/FileTable.cmake @@ -12,7 +12,7 @@ foreach(query ".files[] | select((.os[] | . == \"macOS\") and (.class == \"volume\")) | .name" ".files[] | select((.os[] | . == \"windows\") and (.architecture[] | . == \"i386\") and (.class == \"installer\")) | .name" ".files[] | select(.architecture[] | . == \"x86_64\") | .name" - ".files[] | select([.macOSmin] | inside([\"10.7\", \"10.8\", \"10.9\"])) | .name" + ".files[] | select([.macOSmin] | inside([\"10.10\", \"10.11\", \"10.12\"])) | .name" ".hashFiles[] | select(.algorithm[] | . == \"SHA-256\") | .name" ) message(STATUS "query: ${query}") diff --git a/Utilities/Release/files-v1.json.in b/Utilities/Release/files-v1.json.in index 8fef411..4d6b875 100644 --- a/Utilities/Release/files-v1.json.in +++ b/Utilities/Release/files-v1.json.in @@ -21,17 +21,17 @@ }, { "os": ["macos", "macOS"], - "architecture": ["x86_64"], + "architecture": ["arm64", "x86_64"], "class": "volume", - "name": "cmake-@version@-Darwin-x86_64.dmg", - "macOSmin": "10.7" + "name": "cmake-@version@-macos-universal.dmg", + "macOSmin": "10.10" }, { "os": ["macos", "macOS"], - "architecture": ["x86_64"], + "architecture": ["arm64", "x86_64"], "class": "archive", - "name": "cmake-@version@-Darwin-x86_64.tar.gz", - "macOSmin": "10.7" + "name": "cmake-@version@-macos-universal.tar.gz", + "macOSmin": "10.10" }, { "os": ["windows", "Windows"], diff --git a/Utilities/Release/files-v1.rst b/Utilities/Release/files-v1.rst index 4ee50df..b7ca2fd 100644 --- a/Utilities/Release/files-v1.rst +++ b/Utilities/Release/files-v1.rst @@ -77,6 +77,8 @@ The members are: Binary packages have a non-empty list of architectures, with at least one name matching the output of ``uname -m`` on corresponding hosts. On Windows, architecture names include ``x86_64`` and ``i386``. + On macOS, universal binary packages list all architectures, + e.g. ``["arm64","x86_64"]``. ``class`` A JSON string naming the class of package. The value is one of: @@ -98,7 +100,7 @@ The members are: ``macOSmin`` Optional member that is present on package files for macOS. The value is a JSON string specifying the minimum version of macOS - required to run the binary, e.g. ``"10.7"``. + required to run the binary, e.g. ``"10.10"``. ``hashFiles`` A JSON array of entries corresponding to files containing cryptographic @@ -146,10 +148,10 @@ For example, one may use ``jq`` queries: (.architecture[] | . == "x86_64") and (.class == "archive")) | .name -* To select a macOS binary archive supporting ``x86_64`` hosts:: +* To select a macOS binary archive supporting ``arm64`` hosts:: .files[] | select((.os[] | . == "macos") and - (.architecture[] | . == "x86_64") and + (.architecture[] | . == "arm64") and (.class == "archive")) | .name * To select a SHA-256 hash file:: -- cgit v0.12 From 30959aec8f1347ac2098f85824fe6777dae627b5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 31 Mar 2021 12:24:35 -0400 Subject: Utilities/Release: Update file table for 3.19.3 --- Tests/RunCMake/CMakeRelease/FileTable-stdout.txt | 12 ++++++++-- Tests/RunCMake/CMakeRelease/FileTable.cmake | 1 + Utilities/Release/files-v1.json.in | 28 +++++++++++++++++++++++- Utilities/Release/files-v1.rst | 13 ++++++++--- 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt b/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt index 50b3711..011673f 100644 --- a/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt +++ b/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt @@ -5,10 +5,14 @@ "rc4" "@version@" -- query: \.files\[\]\.name +"cmake-@version@-Linux-aarch64\.sh" +"cmake-@version@-Linux-aarch64\.tar\.gz" "cmake-@version@-Linux-x86_64\.sh" "cmake-@version@-Linux-x86_64\.tar\.gz" "cmake-@version@-macos-universal\.dmg" "cmake-@version@-macos-universal\.tar\.gz" +"cmake-@version@-macos10\.10-universal\.dmg" +"cmake-@version@-macos10\.10-universal\.tar\.gz" "cmake-@version@-win32-x86\.msi" "cmake-@version@-win32-x86\.zip" "cmake-@version@-win64-x64\.msi" @@ -20,6 +24,8 @@ "cmake-@version@\.zip" -- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "macOS"\) and \(\.class == "volume"\)\) \| \.name "cmake-@version@-macos-universal\.dmg" +-- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "macos10\.10"\) and \(\.class == "archive"\)\) \| \.name +"cmake-@version@-macos10\.10-universal\.tar\.gz" -- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "windows"\) and \(\.architecture\[\] \| \. == "i386"\) and \(\.class == "installer"\)\) \| \.name "cmake-@version@-win32-x86\.msi" -- query: \.files\[\] \| select\(\.architecture\[\] \| \. == "x86_64"\) \| \.name @@ -27,10 +33,12 @@ "cmake-@version@-Linux-x86_64\.tar\.gz" "cmake-@version@-macos-universal\.dmg" "cmake-@version@-macos-universal\.tar\.gz" +"cmake-@version@-macos10\.10-universal\.dmg" +"cmake-@version@-macos10\.10-universal\.tar\.gz" "cmake-@version@-win64-x64\.msi" "cmake-@version@-win64-x64\.zip" -- query: \.files\[\] \| select\(\[\.macOSmin\] \| inside\(\["10\.10", "10\.11", "10\.12"\]\)\) \| \.name -"cmake-@version@-macos-universal\.dmg" -"cmake-@version@-macos-universal\.tar\.gz" +"cmake-@version@-macos10\.10-universal\.dmg" +"cmake-@version@-macos10\.10-universal\.tar\.gz" -- query: \.hashFiles\[\] \| select\(\.algorithm\[\] \| \. == "SHA-256"\) \| \.name "cmake-@version@-SHA-256\.txt"$ diff --git a/Tests/RunCMake/CMakeRelease/FileTable.cmake b/Tests/RunCMake/CMakeRelease/FileTable.cmake index 55e6955..f46535c 100644 --- a/Tests/RunCMake/CMakeRelease/FileTable.cmake +++ b/Tests/RunCMake/CMakeRelease/FileTable.cmake @@ -10,6 +10,7 @@ foreach(query ".files[].name" ".files[] | select(.os[] | . == \"source\") | .name" ".files[] | select((.os[] | . == \"macOS\") and (.class == \"volume\")) | .name" + ".files[] | select((.os[] | . == \"macos10.10\") and (.class == \"archive\")) | .name" ".files[] | select((.os[] | . == \"windows\") and (.architecture[] | . == \"i386\") and (.class == \"installer\")) | .name" ".files[] | select(.architecture[] | . == \"x86_64\") | .name" ".files[] | select([.macOSmin] | inside([\"10.10\", \"10.11\", \"10.12\"])) | .name" diff --git a/Utilities/Release/files-v1.json.in b/Utilities/Release/files-v1.json.in index 4d6b875..6bafa69 100644 --- a/Utilities/Release/files-v1.json.in +++ b/Utilities/Release/files-v1.json.in @@ -9,6 +9,18 @@ "files": [ { "os": ["linux", "Linux"], + "architecture": ["aarch64"], + "class": "installer", + "name": "cmake-@version@-Linux-aarch64.sh" + }, + { + "os": ["linux", "Linux"], + "architecture": ["aarch64"], + "class": "archive", + "name": "cmake-@version@-Linux-aarch64.tar.gz" + }, + { + "os": ["linux", "Linux"], "architecture": ["x86_64"], "class": "installer", "name": "cmake-@version@-Linux-x86_64.sh" @@ -24,13 +36,27 @@ "architecture": ["arm64", "x86_64"], "class": "volume", "name": "cmake-@version@-macos-universal.dmg", - "macOSmin": "10.10" + "macOSmin": "10.13" }, { "os": ["macos", "macOS"], "architecture": ["arm64", "x86_64"], "class": "archive", "name": "cmake-@version@-macos-universal.tar.gz", + "macOSmin": "10.13" + }, + { + "os": ["macos10.10", "macOS10.10"], + "architecture": ["arm64", "x86_64"], + "class": "volume", + "name": "cmake-@version@-macos10.10-universal.dmg", + "macOSmin": "10.10" + }, + { + "os": ["macos10.10", "macOS10.10"], + "architecture": ["arm64", "x86_64"], + "class": "archive", + "name": "cmake-@version@-macos10.10-universal.tar.gz", "macOSmin": "10.10" }, { diff --git a/Utilities/Release/files-v1.rst b/Utilities/Release/files-v1.rst index b7ca2fd..3b916d4 100644 --- a/Utilities/Release/files-v1.rst +++ b/Utilities/Release/files-v1.rst @@ -100,7 +100,7 @@ The members are: ``macOSmin`` Optional member that is present on package files for macOS. The value is a JSON string specifying the minimum version of macOS - required to run the binary, e.g. ``"10.10"``. + required to run the binary, e.g. ``"10.13"``. ``hashFiles`` A JSON array of entries corresponding to files containing cryptographic @@ -142,10 +142,10 @@ For example, one may use ``jq`` queries: (.architecture[] | . == "x86_64") and (.class == "archive")) | .name -* To select a Linux binary archive supporting ``x86_64`` hosts:: +* To select a Linux binary archive supporting ``aarch64`` hosts:: .files[] | select((.os[] | . == "linux") and - (.architecture[] | . == "x86_64") and + (.architecture[] | . == "aarch64") and (.class == "archive")) | .name * To select a macOS binary archive supporting ``arm64`` hosts:: @@ -154,6 +154,13 @@ For example, one may use ``jq`` queries: (.architecture[] | . == "arm64") and (.class == "archive")) | .name +* To select a macOS binary archive supporting macOS 10.12 on ``x86_64`` hosts:: + + .files[] | select((.os[] | contains("macOS")) and + (.architecture[] | . == "x86_64") and + ([.macOSmin] | inside(["10.10", "10.11", "10.12"])) + ) | .name + * To select a SHA-256 hash file:: .hashFiles[] | select(.algorithm[] | . == "SHA-256") | .name -- cgit v0.12 From 89ab6132480df326fed311449245433ea0836b7a Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 31 Mar 2021 12:51:56 -0400 Subject: Utilities/Release: Update file table for 3.20.0 --- Tests/RunCMake/CMakeRelease/FileTable-stdout.txt | 26 ++++++++++++------------ Utilities/Release/files-v1.json.in | 16 +++++++-------- Utilities/Release/files-v1.rst | 4 ++-- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt b/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt index 011673f..37eb91e 100644 --- a/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt +++ b/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt @@ -5,18 +5,18 @@ "rc4" "@version@" -- query: \.files\[\]\.name -"cmake-@version@-Linux-aarch64\.sh" -"cmake-@version@-Linux-aarch64\.tar\.gz" -"cmake-@version@-Linux-x86_64\.sh" -"cmake-@version@-Linux-x86_64\.tar\.gz" +"cmake-@version@-linux-aarch64\.sh" +"cmake-@version@-linux-aarch64\.tar\.gz" +"cmake-@version@-linux-x86_64\.sh" +"cmake-@version@-linux-x86_64\.tar\.gz" "cmake-@version@-macos-universal\.dmg" "cmake-@version@-macos-universal\.tar\.gz" "cmake-@version@-macos10\.10-universal\.dmg" "cmake-@version@-macos10\.10-universal\.tar\.gz" -"cmake-@version@-win32-x86\.msi" -"cmake-@version@-win32-x86\.zip" -"cmake-@version@-win64-x64\.msi" -"cmake-@version@-win64-x64\.zip" +"cmake-@version@-windows-i386\.msi" +"cmake-@version@-windows-i386\.zip" +"cmake-@version@-windows-x86_64\.msi" +"cmake-@version@-windows-x86_64\.zip" "cmake-@version@\.tar\.gz" "cmake-@version@\.zip" -- query: \.files\[\] \| select\(\.os\[\] \| \. == "source"\) \| \.name @@ -27,16 +27,16 @@ -- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "macos10\.10"\) and \(\.class == "archive"\)\) \| \.name "cmake-@version@-macos10\.10-universal\.tar\.gz" -- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "windows"\) and \(\.architecture\[\] \| \. == "i386"\) and \(\.class == "installer"\)\) \| \.name -"cmake-@version@-win32-x86\.msi" +"cmake-@version@-windows-i386\.msi" -- query: \.files\[\] \| select\(\.architecture\[\] \| \. == "x86_64"\) \| \.name -"cmake-@version@-Linux-x86_64\.sh" -"cmake-@version@-Linux-x86_64\.tar\.gz" +"cmake-@version@-linux-x86_64\.sh" +"cmake-@version@-linux-x86_64\.tar\.gz" "cmake-@version@-macos-universal\.dmg" "cmake-@version@-macos-universal\.tar\.gz" "cmake-@version@-macos10\.10-universal\.dmg" "cmake-@version@-macos10\.10-universal\.tar\.gz" -"cmake-@version@-win64-x64\.msi" -"cmake-@version@-win64-x64\.zip" +"cmake-@version@-windows-x86_64\.msi" +"cmake-@version@-windows-x86_64\.zip" -- query: \.files\[\] \| select\(\[\.macOSmin\] \| inside\(\["10\.10", "10\.11", "10\.12"\]\)\) \| \.name "cmake-@version@-macos10\.10-universal\.dmg" "cmake-@version@-macos10\.10-universal\.tar\.gz" diff --git a/Utilities/Release/files-v1.json.in b/Utilities/Release/files-v1.json.in index 6bafa69..aa6b15d 100644 --- a/Utilities/Release/files-v1.json.in +++ b/Utilities/Release/files-v1.json.in @@ -11,25 +11,25 @@ "os": ["linux", "Linux"], "architecture": ["aarch64"], "class": "installer", - "name": "cmake-@version@-Linux-aarch64.sh" + "name": "cmake-@version@-linux-aarch64.sh" }, { "os": ["linux", "Linux"], "architecture": ["aarch64"], "class": "archive", - "name": "cmake-@version@-Linux-aarch64.tar.gz" + "name": "cmake-@version@-linux-aarch64.tar.gz" }, { "os": ["linux", "Linux"], "architecture": ["x86_64"], "class": "installer", - "name": "cmake-@version@-Linux-x86_64.sh" + "name": "cmake-@version@-linux-x86_64.sh" }, { "os": ["linux", "Linux"], "architecture": ["x86_64"], "class": "archive", - "name": "cmake-@version@-Linux-x86_64.tar.gz" + "name": "cmake-@version@-linux-x86_64.tar.gz" }, { "os": ["macos", "macOS"], @@ -63,25 +63,25 @@ "os": ["windows", "Windows"], "architecture": ["i386"], "class": "installer", - "name": "cmake-@version@-win32-x86.msi" + "name": "cmake-@version@-windows-i386.msi" }, { "os": ["windows", "Windows"], "architecture": ["i386"], "class": "archive", - "name": "cmake-@version@-win32-x86.zip" + "name": "cmake-@version@-windows-i386.zip" }, { "os": ["windows", "Windows"], "architecture": ["x86_64"], "class": "installer", - "name": "cmake-@version@-win64-x64.msi" + "name": "cmake-@version@-windows-x86_64.msi" }, { "os": ["windows", "Windows"], "architecture": ["x86_64"], "class": "archive", - "name": "cmake-@version@-win64-x64.zip" + "name": "cmake-@version@-windows-x86_64.zip" }, { "os": ["source"], diff --git a/Utilities/Release/files-v1.rst b/Utilities/Release/files-v1.rst index 3b916d4..9586668 100644 --- a/Utilities/Release/files-v1.rst +++ b/Utilities/Release/files-v1.rst @@ -14,8 +14,8 @@ The format is a JSON object: { "version": { - "major": 3, "minor": 18, "patch": 6, - "string": "3.18.6" + "major": 3, "minor": 20, "patch": 0, + "string": "3.20.0" }, "files": [ { -- cgit v0.12 From e17006c497acc3c8d37a9cd854c6ef451db7df9e Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 1 Apr 2021 11:12:00 -0400 Subject: Utilities/Release: Add deprecation fields to File Table v1 Provide a field for clients to check now so that we can deprecate things later. --- Utilities/Release/files-v1.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Utilities/Release/files-v1.rst b/Utilities/Release/files-v1.rst index 9586668..ceebecc 100644 --- a/Utilities/Release/files-v1.rst +++ b/Utilities/Release/files-v1.rst @@ -102,6 +102,13 @@ The members are: The value is a JSON string specifying the minimum version of macOS required to run the binary, e.g. ``"10.13"``. + ``deprecated`` + Optional member that is present when the package file is deprecated + and may be removed from the set of package files in later versions. + The value is a string containing a deprecation message. + Clients should check this field to warn users when they are using + a deprecated package file. + ``hashFiles`` A JSON array of entries corresponding to files containing cryptographic hashes of the package file contents. Each entry is a JSON object @@ -120,6 +127,19 @@ The members are: signature of the hash file specified by ``name``, e.g. ``["cmake--SHA-256.txt.asc"]``. + ``deprecated`` + Optional member that is present when the hash algorithm is deprecated + and may be removed from the set of hash files in later versions. + The value is a string containing a deprecation message. + Clients that rely on a specific hash algorithm should check this + field to determine whether an update is needed. + +``deprecated`` + Optional member that is present when `File Table v1`_ has been + deprecated in favor of a newer alternative. The value is a string + containing a deprecation message. Clients should check this field + to determine whether they need an update to use a newer alternative. + The table and hash files are generated by `files.bash`_ from the `files-v1.json.in`_ template and the package files themselves. -- cgit v0.12