From f9e62c7c6e4536c191e691f3930e6a08a118648f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 16 Feb 2015 05:29:54 -0500 Subject: [PATCH 01/64] Add travis dashboard script --- .github/dashboard/python_common.cmake | 409 +++++++++++++++++++++++ .github/dashboard/travis_dashboard.cmake | 36 ++ 2 files changed, 445 insertions(+) create mode 100644 .github/dashboard/python_common.cmake create mode 100644 .github/dashboard/travis_dashboard.cmake diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake new file mode 100644 index 000000000..e04cc56cd --- /dev/null +++ b/.github/dashboard/python_common.cmake @@ -0,0 +1,409 @@ +# Python Common Dashboard Script +# +# This script contains basic dashboard driver code common to all +# clients. +# +# Put this script in a directory such as "~/Dashboards/Scripts" or +# "c:/Dashboards/Scripts". Create a file next to this script, say +# 'my_dashboard.cmake', with code of the following form: +# +# # Client maintainer: me@mydomain.net +# set(CTEST_SITE "machine.site") +# set(CTEST_BUILD_NAME "Platform-Compiler") +# set(CTEST_CONFIGURATION_TYPE Debug) +# set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +# include(${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) +# +# Then run a scheduled task (cron job) with a command line such as +# +# ctest -S ~/Dashboards/Scripts/my_dashboard.cmake -V +# +# By default the source and build trees will be placed in the path +# "../My Tests/" relative to your script location. +# +# The following variables may be set before including this script +# to configure it: +# +# dashboard_model = Nightly | Experimental | Continuous +# dashboard_track = Optional track to submit dashboard to +# dashboard_disable_loop = For continuous dashboards, disable loop. +# dashboard_root_name = Change name of "My Tests" directory +# dashboard_source_name = Name of source directory (python-cmake-buildsystem) +# dashboard_binary_name = Name of binary directory (python-cmake-buildsystem-build) +# dashboard_cache = Initial CMakeCache.txt file content +# dashboard_do_coverage = True to enable coverage (ex: gcov) +# dashboard_do_memcheck = True to enable memcheck (ex: valgrind) +# CTEST_GIT_COMMAND = path to git command-line client +# CTEST_BUILD_FLAGS = build tool arguments (ex: -j2) +# CTEST_DASHBOARD_ROOT = Where to put source and build trees +# CTEST_TEST_CTEST = Whether to run long CTestTest* tests +# CTEST_TEST_TIMEOUT = Per-test timeout length +# CTEST_TEST_ARGS = ctest_test args (ex: PARALLEL_LEVEL 4) +# CMAKE_MAKE_PROGRAM = Path to "make" tool to use +# +# Options to configure builds from experimental git repository: +# dashboard_git_url = Custom git clone url +# dashboard_git_branch = Custom remote branch to track +# dashboard_git_crlf = Value of core.autocrlf for repository +# +# For Makefile generators the script may be executed from an +# environment already configured to use the desired compilers. +# Alternatively the environment may be set at the top of the script: +# +# set(ENV{CC} /path/to/cc) # C compiler +# set(ENV{CXX} /path/to/cxx) # C++ compiler +# set(ENV{FC} /path/to/fc) # Fortran compiler (optional) +# set(ENV{LD_LIBRARY_PATH} /path/to/vendor/lib) # (if necessary) + +#============================================================================= +# Copyright 2010-2015 Kitware, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) + +set(CTEST_PROJECT_NAME CPython) +set(dashboard_user_home "$ENV{HOME}") + +# Select the top dashboard directory. +if(NOT DEFINED dashboard_root_name) + set(dashboard_root_name "My Tests") +endif() +if(NOT DEFINED CTEST_DASHBOARD_ROOT) + get_filename_component(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}/../${dashboard_root_name}" ABSOLUTE) +endif() + +# Select the model (Nightly, Experimental, Continuous). +if(NOT DEFINED dashboard_model) + set(dashboard_model Nightly) +endif() +if(NOT "${dashboard_model}" MATCHES "^(Nightly|Experimental|Continuous)$") + message(FATAL_ERROR "dashboard_model must be Nightly, Experimental, or Continuous") +endif() + +# Default to a Debug build. +if(NOT DEFINED CTEST_CONFIGURATION_TYPE AND DEFINED CTEST_BUILD_CONFIGURATION) + set(CTEST_CONFIGURATION_TYPE ${CTEST_BUILD_CONFIGURATION}) +endif() + +if(NOT DEFINED CTEST_CONFIGURATION_TYPE) + set(CTEST_CONFIGURATION_TYPE Debug) +endif() + +# Choose CTest reporting mode. +if(dashboard_bootstrap) + # Launchers do not work during bootstrap: no ctest available. + set(CTEST_USE_LAUNCHERS 0) +elseif(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make") + # Launchers work only with Makefile generators. + set(CTEST_USE_LAUNCHERS 0) +elseif(NOT DEFINED CTEST_USE_LAUNCHERS) + # The setting is ignored by CTest < 2.8 so we need no version test. + set(CTEST_USE_LAUNCHERS 1) +endif() + +# Configure testing. +if(NOT DEFINED CTEST_TEST_CTEST) + set(CTEST_TEST_CTEST 1) +endif() +if(NOT CTEST_TEST_TIMEOUT) + set(CTEST_TEST_TIMEOUT 1500) +endif() + +# Select Git source to use. +if(NOT DEFINED dashboard_git_url) + set(dashboard_git_url "git://github.com/jcfr/python-cmake-buildsystem.git") +endif() +if(NOT DEFINED dashboard_git_branch) + set(dashboard_git_branch master) + #if("${dashboard_model}" STREQUAL "Nightly") + # set(dashboard_git_branch nightly) + #else() + # set(dashboard_git_branch next) + #endif() +endif() +if(NOT DEFINED dashboard_git_crlf) + if(UNIX) + set(dashboard_git_crlf false) + else(UNIX) + set(dashboard_git_crlf true) + endif(UNIX) +endif() + +# Look for a GIT command-line client. +if(NOT DEFINED CTEST_GIT_COMMAND) + find_program(CTEST_GIT_COMMAND + NAMES git git.cmd + PATH_SUFFIXES Git/cmd Git/bin + ) +endif() +if(NOT CTEST_GIT_COMMAND) + message(FATAL_ERROR "CTEST_GIT_COMMAND not available!") +endif() + +# Select a source directory name. +if(NOT DEFINED CTEST_SOURCE_DIRECTORY) + if(DEFINED dashboard_source_name) + set(CTEST_SOURCE_DIRECTORY ${CTEST_DASHBOARD_ROOT}/${dashboard_source_name}) + else() + set(CTEST_SOURCE_DIRECTORY ${CTEST_DASHBOARD_ROOT}/python-cmake-buildsystem) + endif() +endif() + +# Select a build directory name. +if(NOT DEFINED CTEST_BINARY_DIRECTORY) + if(DEFINED dashboard_binary_name) + set(CTEST_BINARY_DIRECTORY ${CTEST_DASHBOARD_ROOT}/${dashboard_binary_name}) + else() + set(CTEST_BINARY_DIRECTORY ${CTEST_SOURCE_DIRECTORY}-build) + endif() +endif() + +# Delete source tree if it is incompatible with current VCS. +if(EXISTS ${CTEST_SOURCE_DIRECTORY}) + if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/.git") + set(vcs_refresh "because it is not managed by git.") + else() + execute_process( + COMMAND ${CTEST_GIT_COMMAND} reset --hard + WORKING_DIRECTORY "${CTEST_SOURCE_DIRECTORY}" + OUTPUT_VARIABLE output + ERROR_VARIABLE output + RESULT_VARIABLE failed + ) + if(failed) + set(vcs_refresh "because its .git may be corrupted.") + endif() + endif() + if(vcs_refresh AND "${CTEST_SOURCE_DIRECTORY}" MATCHES "/CMake[^/]*") + message("Deleting source tree\n ${CTEST_SOURCE_DIRECTORY}\n${vcs_refresh}") + file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + endif() +endif() + +# Support initial checkout if necessary. +if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}" + AND NOT DEFINED CTEST_CHECKOUT_COMMAND) + get_filename_component(_name "${CTEST_SOURCE_DIRECTORY}" NAME) + + # Generate an initial checkout script. + set(ctest_checkout_script ${CTEST_DASHBOARD_ROOT}/${_name}-init.cmake) + file(WRITE ${ctest_checkout_script} "# git repo init script for ${_name} +execute_process( + COMMAND \"${CTEST_GIT_COMMAND}\" clone -n -b ${dashboard_git_branch} -- \"${dashboard_git_url}\" + \"${CTEST_SOURCE_DIRECTORY}\" + ) +if(EXISTS \"${CTEST_SOURCE_DIRECTORY}/.git\") + execute_process( + COMMAND \"${CTEST_GIT_COMMAND}\" config core.autocrlf ${dashboard_git_crlf} + WORKING_DIRECTORY \"${CTEST_SOURCE_DIRECTORY}\" + ) + execute_process( + COMMAND \"${CTEST_GIT_COMMAND}\" checkout + WORKING_DIRECTORY \"${CTEST_SOURCE_DIRECTORY}\" + ) +endif() +") + set(CTEST_CHECKOUT_COMMAND "\"${CMAKE_COMMAND}\" -P \"${ctest_checkout_script}\"") +endif() + +#----------------------------------------------------------------------------- + +# Send the main script as a note. +list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + ) + +# Check for required variables. +foreach(req + CTEST_CMAKE_GENERATOR + CTEST_SITE + CTEST_BUILD_NAME + ) + if(NOT DEFINED ${req}) + message(FATAL_ERROR "The containing script must set ${req}") + endif() +endforeach(req) + +# Print summary information. +set(vars "") +foreach(v + CTEST_SITE + CTEST_BUILD_NAME + CTEST_SOURCE_DIRECTORY + CTEST_BINARY_DIRECTORY + CTEST_CMAKE_GENERATOR + CTEST_CONFIGURATION_TYPE + CTEST_GIT_COMMAND + CTEST_CHECKOUT_COMMAND + CTEST_CONFIGURE_COMMAND + CTEST_SCRIPT_DIRECTORY + CTEST_USE_LAUNCHERS + ) + if (DEFINED ${v}) + set(vars "${vars} ${v}=[${${v}}]\n") + endif() +endforeach(v) +message("Dashboard script configuration:\n${vars}\n") + +# Avoid non-ascii characters in tool output. +set(ENV{LC_ALL} C) + +# Helper macro to write the initial cache. +macro(write_cache) + set(cache_build_type "") + set(cache_make_program "") + if(CTEST_CMAKE_GENERATOR MATCHES "Make") + set(cache_build_type CMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}) + if(CMAKE_MAKE_PROGRAM) + set(cache_make_program CMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}) + endif() + endif() + file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt " +SITE:STRING=${CTEST_SITE} +BUILDNAME:STRING=${CTEST_BUILD_NAME} +CTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS} +DART_TESTING_TIMEOUT:STRING=${CTEST_TEST_TIMEOUT} +${cache_build_type} +${cache_make_program} +${dashboard_cache} +") +endmacro(write_cache) + +# Start with a fresh build tree. +file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +if(NOT "${CTEST_SOURCE_DIRECTORY}" STREQUAL "${CTEST_BINARY_DIRECTORY}") + message("Clearing build tree...") + ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) +endif() + +set(dashboard_continuous 0) +if("${dashboard_model}" STREQUAL "Continuous") + set(dashboard_continuous 1) +endif() + +# CTest 2.6 crashes with message() after ctest_test. +macro(safe_message) + if(NOT "${CMAKE_VERSION}" VERSION_LESS 2.8 OR NOT safe_message_skip) + message(${ARGN}) + endif() +endmacro() + +if(COMMAND dashboard_hook_init) + dashboard_hook_init() +endif() + +set(dashboard_done 0) +while(NOT dashboard_done) + if(dashboard_continuous) + set(START_TIME ${CTEST_ELAPSED_TIME}) + endif() + set(ENV{HOME} "${dashboard_user_home}") + + # Start a new submission. + if(COMMAND dashboard_hook_start) + dashboard_hook_start() + endif() + if(dashboard_track) + ctest_start(${dashboard_model} TRACK ${dashboard_track}) + else() + ctest_start(${dashboard_model}) + endif() + if(COMMAND dashboard_hook_started) + dashboard_hook_started() + endif() + + # Always build if the tree is fresh. + set(dashboard_fresh 0) + if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt") + set(dashboard_fresh 1) + safe_message("Starting fresh build...") + write_cache() + endif() + + # Look for updates. + ctest_update(RETURN_VALUE count) + set(CTEST_CHECKOUT_COMMAND) # checkout on first iteration only + safe_message("Found ${count} changed files") + + if(dashboard_fresh OR NOT dashboard_continuous OR count GREATER 0) + + ctest_configure() + + ctest_submit(PARTS Update Configure Notes) + ctest_read_custom_files(${CTEST_BINARY_DIRECTORY}) + + if(COMMAND dashboard_hook_build) + dashboard_hook_build() + endif() + ctest_build(APPEND) + ctest_submit(PARTS Build) + + if(COMMAND dashboard_hook_test) + dashboard_hook_test() + endif() + ctest_test(${CTEST_TEST_ARGS} APPEND) + ctest_submit(PARTS Test) + set(safe_message_skip 1) # Block further messages + + if(dashboard_do_coverage) + ctest_coverage() + ctest_submit(PARTS Coverage) + endif() + + if(dashboard_do_memcheck) + ctest_memcheck(${CTEST_TEST_ARGS}) + ctest_submit(PARTS MemCheck) + endif() + + if(COMMAND dashboard_hook_submit) + dashboard_hook_submit() + endif() + + if(COMMAND dashboard_hook_end) + dashboard_hook_end() + endif() + + endif() + + if(dashboard_continuous AND NOT dashboard_disable_loop) + # Delay until at least 5 minutes past START_TIME + ctest_sleep(${START_TIME} 300 ${CTEST_ELAPSED_TIME}) + if(${CTEST_ELAPSED_TIME} GREATER 57600) + set(dashboard_done 1) + endif() + else() + # Not continuous, so we are done. + set(dashboard_done 1) + endif() +endwhile() + diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake new file mode 100644 index 000000000..ea5ed1595 --- /dev/null +++ b/.github/dashboard/travis_dashboard.cmake @@ -0,0 +1,36 @@ +# Client maintainer: jchris.fillionr@kitware.com +execute_process(COMMAND hostname OUTPUT_VARIABLE hostname OUTPUT_STRIP_TRAILING_WHITESPACE) +set(CTEST_SITE "${hostname}") +set(CTEST_DASHBOARD_ROOT $ENV{TRAVIS_BUILD_DIR}/..) +get_filename_component(compiler_name $ENV{CC} NAME) +string(SUBSTRING $ENV{TRAVIS_COMMIT} 0 7 commit) +set(CTEST_BUILD_NAME "$ENV{TRAVIS_OS_NAME}-${compiler_name}_$ENV{TRAVIS_BRANCH}_${commit}") +set(CTEST_CONFIGURATION_TYPE Release) +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_BUILD_FLAGS "-j4") +set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) + +set(dashboard_model Experimental) +set(dashboard_track Travis-CI) + +function(downloadFile url dest) + file(DOWNLOAD ${url} ${dest} STATUS status) + list(GET status 0 error_code) + list(GET status 1 error_msg) + if(error_code) + message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}") + endif() +endfunction() + +# Download and include driver script +set(url https://raw.githubusercontent.com/davidsansome/python-cmake-buildsystem/dashboard/python_common.cmake) +set(dest ${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) +downloadfile(${url} ${dest}) +include(${dest}) + +# Upload link to travis +set(travis_url "/tmp/travis.url") +file(WRITE ${travis_url} "https://travis-ci.org/$ENV{TRAVIS_REPO_SLUG}/builds/$ENV{TRAVIS_BUILD_ID}") +ctest_upload(FILES ${travis_url}) +ctest_submit(PARTS Upload) +file(REMOVE ${travis_url}) From c412fa4e4a6af30a1c67f83e2f22572bff5688a0 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 18 Feb 2015 03:17:20 -0500 Subject: [PATCH 02/64] Add appveyor dashboard script Tweak "python_common.cmake" script to fix the error reported below. Since "ctest_empty_binary_directory" returns: (1) true if the directory does not exist (3) false if the directory exists and does NOT contain a CMakeCache.txt this commit moves the directory creation after the "ctest_empty_binary_directory" call. //------------ Clearing build tree... CMake Error at scratch/python_common.cmake:306 (ctest_empty_binary_directory): ctest_empty_binary_directory problem removing the binary directory: C:\projects\python-cmake-buildsystem/../python-cmake-buildsystem/build Call Stack (most recent call first): scratch/appveyor_dashboard.cmake:31 (include) //------------ --- .github/dashboard/appveyor_dashboard.cmake | 41 ++++++++++++++++++++++ .github/dashboard/python_common.cmake | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/dashboard/appveyor_dashboard.cmake diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake new file mode 100644 index 000000000..08e765a41 --- /dev/null +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -0,0 +1,41 @@ +# Client maintainer: jchris.fillionr@kitware.com +set(CTEST_SITE "appveyor") +set(CTEST_DASHBOARD_ROOT $ENV{APPVEYOR_BUILD_FOLDER}/..) +string(SUBSTRING $ENV{APPVEYOR_REPO_COMMIT} 0 7 commit) +set(CTEST_BUILD_NAME "VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_$ENV{APPVEYOR_REPO_BRANCH}_${commit}") +set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) +set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008") +if("$ENV{platform}" STREQUAL "x64") + set(CTEST_CMAKE_GENERATOR "${CTEST_CMAKE_GENERATOR} Win64") +endif() +set(CTEST_BUILD_FLAGS "") +set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) + +set(dashboard_binary_name "python-cmake-buildsystem/build") +set(dashboard_model Experimental) +set(dashboard_track AppVeyor-CI) + +set(dashboard_cache "BUILD_SHARED:BOOL=ON +BUILD_STATIC:BOOL=OFF") + +function(downloadFile url dest) + file(DOWNLOAD ${url} ${dest} STATUS status) + list(GET status 0 error_code) + list(GET status 1 error_msg) + if(error_code) + message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}") + endif() +endfunction() + +# Download and include driver script +set(url https://raw.githubusercontent.com/davidsansome/python-cmake-buildsystem/dashboard/python_common.cmake) +set(dest ${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) +downloadfile(${url} ${dest}) +include(${dest}) + +# Upload link to appveyor +set(url "${CTEST_DASHBOARD_ROOT}/python-cmake-buildsystem/scratch/appveyor.url") +file(WRITE ${url} "https://ci.appveyor.com/project/$ENV{APPVEYOR_REPO_NAME}/build/$ENV{APPVEYOR_BUILD_VERSION}") +ctest_upload(FILES ${url}) +ctest_submit(PARTS Upload) +file(REMOVE ${url}) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index e04cc56cd..64360c56d 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -300,11 +300,11 @@ ${dashboard_cache} endmacro(write_cache) # Start with a fresh build tree. -file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") if(NOT "${CTEST_SOURCE_DIRECTORY}" STREQUAL "${CTEST_BINARY_DIRECTORY}") message("Clearing build tree...") ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) endif() +file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") set(dashboard_continuous 0) if("${dashboard_model}" STREQUAL "Continuous") From 5eb8f9dd22a2013aed052b7b8d9e9c8846eb0917 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 23 Jul 2015 01:35:20 -0400 Subject: [PATCH 03/64] Update travis and appveyor scripts to support PY_VERSION_PATCH env variable If not set, it default to 8. In both case build name will be prepended with "2.7.-". --- .github/dashboard/appveyor_dashboard.cmake | 10 ++++++++-- .github/dashboard/travis_dashboard.cmake | 9 ++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index 08e765a41..2266e03bb 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -2,7 +2,11 @@ set(CTEST_SITE "appveyor") set(CTEST_DASHBOARD_ROOT $ENV{APPVEYOR_BUILD_FOLDER}/..) string(SUBSTRING $ENV{APPVEYOR_REPO_COMMIT} 0 7 commit) -set(CTEST_BUILD_NAME "VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_$ENV{APPVEYOR_REPO_BRANCH}_${commit}") +set(PY_VERSION_PATCH 8) # Value should match the default set in CMakeLists.txt +if(NOT "$ENV{PY_VERSION_PATCH}" STREQUAL "") + set(PY_VERSION_PATCH "$ENV{PY_VERSION_PATCH}") +endif() +set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_$ENV{APPVEYOR_REPO_BRANCH}_${commit}") set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008") if("$ENV{platform}" STREQUAL "x64") @@ -16,7 +20,9 @@ set(dashboard_model Experimental) set(dashboard_track AppVeyor-CI) set(dashboard_cache "BUILD_SHARED:BOOL=ON -BUILD_STATIC:BOOL=OFF") +BUILD_STATIC:BOOL=OFF +PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} +") function(downloadFile url dest) file(DOWNLOAD ${url} ${dest} STATUS status) diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index ea5ed1595..65c8dd670 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -4,7 +4,11 @@ set(CTEST_SITE "${hostname}") set(CTEST_DASHBOARD_ROOT $ENV{TRAVIS_BUILD_DIR}/..) get_filename_component(compiler_name $ENV{CC} NAME) string(SUBSTRING $ENV{TRAVIS_COMMIT} 0 7 commit) -set(CTEST_BUILD_NAME "$ENV{TRAVIS_OS_NAME}-${compiler_name}_$ENV{TRAVIS_BRANCH}_${commit}") +set(PY_VERSION_PATCH 8) # Value should match the default set in CMakeLists.txt +if(NOT "$ENV{PY_VERSION_PATCH}" STREQUAL "") + set(PY_VERSION_PATCH "$ENV{PY_VERSION_PATCH}") +endif() +set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_$ENV{TRAVIS_BRANCH}_${commit}") set(CTEST_CONFIGURATION_TYPE Release) set(CTEST_CMAKE_GENERATOR "Unix Makefiles") set(CTEST_BUILD_FLAGS "-j4") @@ -13,6 +17,9 @@ set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) set(dashboard_model Experimental) set(dashboard_track Travis-CI) +set(dashboard_cache "PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} +") + function(downloadFile url dest) file(DOWNLOAD ${url} ${dest} STATUS status) list(GET status 0 error_code) From 2d3d866d7eeb987afe4f3ca3906ec2cfcc3d2c86 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 24 Aug 2015 15:20:44 -0400 Subject: [PATCH 04/64] Indicate pull request source in CDash Build Name. The pull request number is added as documented for Travis at http://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables The pull request title and number is added as documented for Appveyor at http://www.appveyor.com/docs/environment-variables --- .github/dashboard/appveyor_dashboard.cmake | 2 +- .github/dashboard/travis_dashboard.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index 2266e03bb..92d177d17 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -6,7 +6,7 @@ set(PY_VERSION_PATCH 8) # Value should match the default set in CMakeLists.txt if(NOT "$ENV{PY_VERSION_PATCH}" STREQUAL "") set(PY_VERSION_PATCH "$ENV{PY_VERSION_PATCH}") endif() -set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_$ENV{APPVEYOR_REPO_BRANCH}_${commit}") +set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}_${commit}") set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008") if("$ENV{platform}" STREQUAL "x64") diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index 65c8dd670..8f9ab08a9 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -8,7 +8,7 @@ set(PY_VERSION_PATCH 8) # Value should match the default set in CMakeLists.txt if(NOT "$ENV{PY_VERSION_PATCH}" STREQUAL "") set(PY_VERSION_PATCH "$ENV{PY_VERSION_PATCH}") endif() -set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_$ENV{TRAVIS_BRANCH}_${commit}") +set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_#$ENV{TRAVIS_PULL_REQUEST}_${commit}") set(CTEST_CONFIGURATION_TYPE Release) set(CTEST_CMAKE_GENERATOR "Unix Makefiles") set(CTEST_BUILD_FLAGS "-j4") From 1eba88ceff73466a27ac9597b874556ea82651c7 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 27 Aug 2015 23:54:49 -0400 Subject: [PATCH 05/64] Update travis and appveyor script to support both PR and branch. See #83 --- .github/dashboard/appveyor_dashboard.cmake | 6 +++++- .github/dashboard/travis_dashboard.cmake | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index 92d177d17..5ea18763f 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -6,7 +6,11 @@ set(PY_VERSION_PATCH 8) # Value should match the default set in CMakeLists.txt if(NOT "$ENV{PY_VERSION_PATCH}" STREQUAL "") set(PY_VERSION_PATCH "$ENV{PY_VERSION_PATCH}") endif() -set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}_${commit}") +set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}") +if($ENV{APPVEYOR_PULL_REQUEST_NUMBER} STREQUAL "") + set(what "$ENV{APPVEYOR_REPO_BRANCH}") +endif() +set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_${what}_${commit}") set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008") if("$ENV{platform}" STREQUAL "x64") diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index 8f9ab08a9..9001e94af 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -8,7 +8,11 @@ set(PY_VERSION_PATCH 8) # Value should match the default set in CMakeLists.txt if(NOT "$ENV{PY_VERSION_PATCH}" STREQUAL "") set(PY_VERSION_PATCH "$ENV{PY_VERSION_PATCH}") endif() -set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_#$ENV{TRAVIS_PULL_REQUEST}_${commit}") +set(what "#$ENV{TRAVIS_PULL_REQUEST}") +if($ENV{TRAVIS_PULL_REQUEST} STREQUAL "false") + set(what "$ENV{TRAVIS_BRANCH}") +endif() +set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_${what}_${commit}") set(CTEST_CONFIGURATION_TYPE Release) set(CTEST_CMAKE_GENERATOR "Unix Makefiles") set(CTEST_BUILD_FLAGS "-j4") From 95e984794c3d7c6d3306dc8d930142ac296ea7a4 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 3 Sep 2015 14:00:24 -0400 Subject: [PATCH 06/64] Teach driver script to use CMake directive added in commit msg If the last commit topic includes the special comments of the form "[cmake ]" without trailing spaces, the project will be configured using all extracted arguments. For example, using these comments: [cmake -DFOO:STRING=Hello] [cmake -DBAR:STRING=World] [cmake -DANSWER=42 -DGOOD:STRING=Day] The project will be built with -DFOO:STRING=Hello -DBAR=World -DANSWER=42 -DGOOD:STRING=Day --- .github/dashboard/python_common.cmake | 42 ++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 64360c56d..e3095821d 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -355,9 +355,49 @@ while(NOT dashboard_done) set(CTEST_CHECKOUT_COMMAND) # checkout on first iteration only safe_message("Found ${count} changed files") + # Additional CMake configure options can be specified in a commit message + # using one or multiple line of the form "[cmake ...]". + # + # If multiple matching lines are found, the project will be configured passing + # all without doing any particular filtering. + + # 1) Extract additional CMake configure option from last commit message + execute_process( + COMMAND ${CTEST_GIT_COMMAND} log -1 --pretty=%B + WORKING_DIRECTORY "${CTEST_SOURCE_DIRECTORY}" + OUTPUT_VARIABLE output + ERROR_VARIABLE output + RESULT_VARIABLE failed + ) + if(failed) + message(FATAL_ERROR "Failed to extract last commit message from git history !") + endif() + + # 2) Split by newlines + # Copied from http://www.cmake.org/pipermail/cmake/2007-May/014222.html + string(REGEX REPLACE ";" "\\\\;" output "${output}") + string(REGEX REPLACE "\n" ";" output "${output}") + + # 3) Loop over all lines, match "[cmake ...] and extract + set(CMAKE_CONFIGURE_ARGS_FROM_COMMITMSG ) + foreach(line ${output}) + string(REGEX MATCH "^\\[cmake (.+)\\]" raw_cmake_comment ${line}) + if(raw_cmake_comment) + list(APPEND CMAKE_CONFIGURE_ARGS_FROM_COMMITMSG ${CMAKE_MATCH_1}) + endif() + endforeach() + + set(ctest_configure_options) + if(CMAKE_CONFIGURE_ARGS_FROM_COMMITMSG) + set(ctest_configure_options OPTIONS ${CMAKE_CONFIGURE_ARGS_FROM_COMMITMSG}) + message("CMake configure options from commit msg: ${CMAKE_CONFIGURE_ARGS_FROM_COMMITMSG}") + else() + message("CMake configure options from commit msg: Didn't find any [cmake ] directives in commit message.") + endif() + if(dashboard_fresh OR NOT dashboard_continuous OR count GREATER 0) - ctest_configure() + ctest_configure(${ctest_configure_options}) ctest_submit(PARTS Update Configure Notes) ctest_read_custom_files(${CTEST_BINARY_DIRECTORY}) From 77f34794b7b2c42f9b686791ce3630dcdab9b3dd Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 3 Sep 2015 17:21:52 -0400 Subject: [PATCH 07/64] Fix driver script to ensure Experimental build do not reset checkout This commit will ensure CI builds (which are of type Experimental) do not reset the source checkout to origin/master --- .github/dashboard/python_common.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index e3095821d..8815c994c 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -311,6 +311,10 @@ if("${dashboard_model}" STREQUAL "Continuous") set(dashboard_continuous 1) endif() +if("${dashboard_model}" STREQUAL "Experimental") + set(CTEST_UPDATE_VERSION_ONLY 1) +endif() + # CTest 2.6 crashes with message() after ctest_test. macro(safe_message) if(NOT "${CMAKE_VERSION}" VERSION_LESS 2.8 OR NOT safe_message_skip) From 60afaa4a35ac47dd38cd907f3b3851894c9f12f4 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 3 Sep 2015 18:28:38 -0400 Subject: [PATCH 08/64] Update driver script to extract commit message from the first no merge commit This will allow CMake comment used in #98 to effectively be considered when configuring the project. --- .github/dashboard/python_common.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 8815c994c..594d1d739 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -366,8 +366,9 @@ while(NOT dashboard_done) # all without doing any particular filtering. # 1) Extract additional CMake configure option from last commit message + # that is not associated with a merge commit. execute_process( - COMMAND ${CTEST_GIT_COMMAND} log -1 --pretty=%B + COMMAND ${CTEST_GIT_COMMAND} log -1 --pretty=%B --max-parents=1 WORKING_DIRECTORY "${CTEST_SOURCE_DIRECTORY}" OUTPUT_VARIABLE output ERROR_VARIABLE output From 7e11eb92707babd32f61cbe0357a4a61b12d850b Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 3 Sep 2015 20:40:51 -0400 Subject: [PATCH 09/64] Ensure Experimental build do not reset the local repo when using CMake < 3.1.0 This commit improve the fix introduced in 77f3479 to also work for older version of CMake. --- .github/dashboard/python_common.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 594d1d739..61ad8e2cf 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -312,7 +312,7 @@ if("${dashboard_model}" STREQUAL "Continuous") endif() if("${dashboard_model}" STREQUAL "Experimental") - set(CTEST_UPDATE_VERSION_ONLY 1) + set(CTEST_UPDATE_VERSION_ONLY 1) # Introduced in CMake >= 3.1.0 endif() # CTest 2.6 crashes with message() after ctest_test. @@ -355,7 +355,14 @@ while(NOT dashboard_done) endif() # Look for updates. - ctest_update(RETURN_VALUE count) + set(count 0) + set(_skip_ctest_update 0) # XXX Required for CMake < 3.1.0 + if(CMAKE_VERSION VERSION_LESS "3.1.0" AND CTEST_UPDATE_VERSION_ONLY) + set(_skip_ctest_update 1) + endif() + if(NOT _skip_ctest_update) + ctest_update(RETURN_VALUE count) + endif() set(CTEST_CHECKOUT_COMMAND) # checkout on first iteration only safe_message("Found ${count} changed files") From 82ba8e74da5762843157e4f9cb15da5083d456ba Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 4 Sep 2015 00:14:08 -0400 Subject: [PATCH 10/64] Do not use space in default dashboard_root_name As explained in [1], for legacy reason setting variable like LD_LIBRARY_PATH with paths containing spaces will not work even if the spaces are escaped. For that reason, prefer build path without spaces. [1] http://ubuntuforums.org/showthread.php?t=1142062 --- .github/dashboard/python_common.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 61ad8e2cf..a1d25c654 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -19,7 +19,7 @@ # ctest -S ~/Dashboards/Scripts/my_dashboard.cmake -V # # By default the source and build trees will be placed in the path -# "../My Tests/" relative to your script location. +# "../MyTests/" relative to your script location. # # The following variables may be set before including this script # to configure it: @@ -27,7 +27,7 @@ # dashboard_model = Nightly | Experimental | Continuous # dashboard_track = Optional track to submit dashboard to # dashboard_disable_loop = For continuous dashboards, disable loop. -# dashboard_root_name = Change name of "My Tests" directory +# dashboard_root_name = Change name of "MyTests" directory # dashboard_source_name = Name of source directory (python-cmake-buildsystem) # dashboard_binary_name = Name of binary directory (python-cmake-buildsystem-build) # dashboard_cache = Initial CMakeCache.txt file content @@ -95,7 +95,7 @@ set(dashboard_user_home "$ENV{HOME}") # Select the top dashboard directory. if(NOT DEFINED dashboard_root_name) - set(dashboard_root_name "My Tests") + set(dashboard_root_name "MyTests") endif() if(NOT DEFINED CTEST_DASHBOARD_ROOT) get_filename_component(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}/../${dashboard_root_name}" ABSOLUTE) From dfa19a487b6d4e406860f51cec5eb9ab4e07bc38 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 4 Sep 2015 01:04:56 -0400 Subject: [PATCH 11/64] Properly handle case where multiple CMake arguments are specified in commit msg --- .github/dashboard/python_common.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index a1d25c654..04ed28fa9 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -367,7 +367,7 @@ while(NOT dashboard_done) safe_message("Found ${count} changed files") # Additional CMake configure options can be specified in a commit message - # using one or multiple line of the form "[cmake ...]". + # using one or multiple line of the form "[cmake ;;...]". # # If multiple matching lines are found, the project will be configured passing # all without doing any particular filtering. @@ -401,7 +401,7 @@ while(NOT dashboard_done) set(ctest_configure_options) if(CMAKE_CONFIGURE_ARGS_FROM_COMMITMSG) - set(ctest_configure_options OPTIONS ${CMAKE_CONFIGURE_ARGS_FROM_COMMITMSG}) + set(ctest_configure_options ${CMAKE_CONFIGURE_ARGS_FROM_COMMITMSG}) message("CMake configure options from commit msg: ${CMAKE_CONFIGURE_ARGS_FROM_COMMITMSG}") else() message("CMake configure options from commit msg: Didn't find any [cmake ] directives in commit message.") @@ -409,7 +409,11 @@ while(NOT dashboard_done) if(dashboard_fresh OR NOT dashboard_continuous OR count GREATER 0) - ctest_configure(${ctest_configure_options}) + if(ctest_configure_options) + ctest_configure(OPTIONS "${ctest_configure_options}") + else() + ctest_configure() + endif() ctest_submit(PARTS Update Configure Notes) ctest_read_custom_files(${CTEST_BINARY_DIRECTORY}) From ae9de1182fb7182b85a168fe8e2d195b1cb56b4e Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 4 Sep 2015 03:02:52 -0400 Subject: [PATCH 12/64] Fix appveyor dashboard script error happening when building a branch This commit fixes the following error: //------------ ctest -V -C %configuration% -S "%APPVEYOR_BUILD_FOLDER%\\scripts\\appveyor_dashboard.cmake" CMake Error at scripts/appveyor_dashboard.cmake:10 (if): if given arguments: "STREQUAL" "" Unknown arguments specified Error in read script: C:/projects/python-cmake-buildsystem/scripts/appveyor_dashboard.cmake Command exited with code -1 //------------ --- .github/dashboard/appveyor_dashboard.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index 5ea18763f..8d6eef612 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -7,7 +7,7 @@ if(NOT "$ENV{PY_VERSION_PATCH}" STREQUAL "") set(PY_VERSION_PATCH "$ENV{PY_VERSION_PATCH}") endif() set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}") -if($ENV{APPVEYOR_PULL_REQUEST_NUMBER} STREQUAL "") +if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "") set(what "$ENV{APPVEYOR_REPO_BRANCH}") endif() set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_${what}_${commit}") From f94ec62f6b680fe07a1e435d2e65bbc08bf3c670 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 10 Mar 2016 05:32:52 -0500 Subject: [PATCH 13/64] Update appveyor and travis script to expect major/minor/patch env variables --- .github/dashboard/appveyor_dashboard.cmake | 18 +++++++++++++++--- .github/dashboard/travis_dashboard.cmake | 20 ++++++++++++++++---- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index 8d6eef612..9bae26a58 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -2,10 +2,20 @@ set(CTEST_SITE "appveyor") set(CTEST_DASHBOARD_ROOT $ENV{APPVEYOR_BUILD_FOLDER}/..) string(SUBSTRING $ENV{APPVEYOR_REPO_COMMIT} 0 7 commit) -set(PY_VERSION_PATCH 8) # Value should match the default set in CMakeLists.txt -if(NOT "$ENV{PY_VERSION_PATCH}" STREQUAL "") - set(PY_VERSION_PATCH "$ENV{PY_VERSION_PATCH}") + +# Extract major/minor/patch python versions +if("$ENV{PY_VERSION}" STREQUAL "") + message(FATAL_ERROR "Environment variable 'PY_VERSION' is not set") +endif() +set(PY_VERSION $ENV{PY_VERSION}) +string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) +if(_match STREQUAL "") + message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") endif() +set(PY_VERSION_MAJOR ${CMAKE_MATCH_1}) +set(PY_VERSION_MINOR ${CMAKE_MATCH_2}) +set(PY_VERSION_PATCH ${CMAKE_MATCH_3}) + set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}") if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "") set(what "$ENV{APPVEYOR_REPO_BRANCH}") @@ -25,6 +35,8 @@ set(dashboard_track AppVeyor-CI) set(dashboard_cache "BUILD_SHARED:BOOL=ON BUILD_STATIC:BOOL=OFF +PY_VERSION_MAJOR:STRING=${PY_VERSION_MAJOR} +PY_VERSION_MINOR:STRING=${PY_VERSION_MINOR} PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} ") diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index 9001e94af..ae2e6c314 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -4,10 +4,20 @@ set(CTEST_SITE "${hostname}") set(CTEST_DASHBOARD_ROOT $ENV{TRAVIS_BUILD_DIR}/..) get_filename_component(compiler_name $ENV{CC} NAME) string(SUBSTRING $ENV{TRAVIS_COMMIT} 0 7 commit) -set(PY_VERSION_PATCH 8) # Value should match the default set in CMakeLists.txt -if(NOT "$ENV{PY_VERSION_PATCH}" STREQUAL "") - set(PY_VERSION_PATCH "$ENV{PY_VERSION_PATCH}") + +# Extract major/minor/patch python versions +if("$ENV{PY_VERSION}" STREQUAL "") + message(FATAL_ERROR "Environment variable 'PY_VERSION' is not set") +endif() +set(PY_VERSION $ENV{PY_VERSION}) +string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) +if(_match STREQUAL "") + message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") endif() +set(PY_VERSION_MAJOR ${CMAKE_MATCH_1}) +set(PY_VERSION_MINOR ${CMAKE_MATCH_2}) +set(PY_VERSION_PATCH ${CMAKE_MATCH_3}) + set(what "#$ENV{TRAVIS_PULL_REQUEST}") if($ENV{TRAVIS_PULL_REQUEST} STREQUAL "false") set(what "$ENV{TRAVIS_BRANCH}") @@ -21,7 +31,9 @@ set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) set(dashboard_model Experimental) set(dashboard_track Travis-CI) -set(dashboard_cache "PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} +set(dashboard_cache "PY_VERSION_MAJOR:STRING=${PY_VERSION_MAJOR} +PY_VERSION_MINOR:STRING=${PY_VERSION_MINOR} +PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} ") function(downloadFile url dest) From e5bc492f9aa858ab8c632f3ea9e2cf62c57ebfcd Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 25 Mar 2016 13:57:20 -0400 Subject: [PATCH 14/64] Correctly set CTest build name major/minor python version for appveyor and travis. --- .github/dashboard/appveyor_dashboard.cmake | 2 +- .github/dashboard/travis_dashboard.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index 9bae26a58..9c9e988aa 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -20,7 +20,7 @@ set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "") set(what "$ENV{APPVEYOR_REPO_BRANCH}") endif() -set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_${what}_${commit}") +set(CTEST_BUILD_NAME "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${PY_VERSION_PATCH}-VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_${what}_${commit}") set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008") if("$ENV{platform}" STREQUAL "x64") diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index ae2e6c314..f32c7c462 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -22,7 +22,7 @@ set(what "#$ENV{TRAVIS_PULL_REQUEST}") if($ENV{TRAVIS_PULL_REQUEST} STREQUAL "false") set(what "$ENV{TRAVIS_BRANCH}") endif() -set(CTEST_BUILD_NAME "2.7.${PY_VERSION_PATCH}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_${what}_${commit}") +set(CTEST_BUILD_NAME "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${PY_VERSION_PATCH}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_${what}_${commit}") set(CTEST_CONFIGURATION_TYPE Release) set(CTEST_CMAKE_GENERATOR "Unix Makefiles") set(CTEST_BUILD_FLAGS "-j4") From b90e150257c1ba11161b0665a0c57d1c43fdd51e Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 25 Mar 2016 18:13:39 -0400 Subject: [PATCH 15/64] appveyor: Support custom generator Default remains "Visual Studio 9 2008" --- .github/dashboard/appveyor_dashboard.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index 9c9e988aa..929f0de2d 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -22,7 +22,10 @@ if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "") endif() set(CTEST_BUILD_NAME "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${PY_VERSION_PATCH}-VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_${what}_${commit}") set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) -set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008") +set(CTEST_CMAKE_GENERATOR "$ENV{GENERATOR}") +if("${CTEST_CMAKE_GENERATOR}" STREQUAL "") + set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008") +endif() if("$ENV{platform}" STREQUAL "x64") set(CTEST_CMAKE_GENERATOR "${CTEST_CMAKE_GENERATOR} Win64") endif() From 7a15d5d5f387d3d5891fb1de063a7b0b03c64b8d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 25 Mar 2016 18:14:57 -0400 Subject: [PATCH 16/64] appveyor: Platform is expected to be upper-cased See http://www.appveyor.com/docs/environment-variables --- .github/dashboard/appveyor_dashboard.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index 929f0de2d..e31b9958c 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -26,7 +26,7 @@ set(CTEST_CMAKE_GENERATOR "$ENV{GENERATOR}") if("${CTEST_CMAKE_GENERATOR}" STREQUAL "") set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008") endif() -if("$ENV{platform}" STREQUAL "x64") +if("$ENV{PLATFORM}" STREQUAL "x64") set(CTEST_CMAKE_GENERATOR "${CTEST_CMAKE_GENERATOR} Win64") endif() set(CTEST_BUILD_FLAGS "") From e46a1a98bed3de63caef184a2aed4fdfc3529437 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 26 Mar 2016 04:05:44 -0400 Subject: [PATCH 17/64] appveyor: Set platform to "x64" if generator includes "Win64" --- .github/dashboard/appveyor_dashboard.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index e31b9958c..7629cd161 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -20,15 +20,18 @@ set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "") set(what "$ENV{APPVEYOR_REPO_BRANCH}") endif() -set(CTEST_BUILD_NAME "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${PY_VERSION_PATCH}-VS-$ENV{PLATFORM}-$ENV{CONFIGURATION}_${what}_${commit}") set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) set(CTEST_CMAKE_GENERATOR "$ENV{GENERATOR}") if("${CTEST_CMAKE_GENERATOR}" STREQUAL "") set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008") endif() -if("$ENV{PLATFORM}" STREQUAL "x64") +set(platform $ENV{PLATFORM}) +if(platform STREQUAL "x64") set(CTEST_CMAKE_GENERATOR "${CTEST_CMAKE_GENERATOR} Win64") +elseif(CTEST_CMAKE_GENERATOR MATCHES "Win64") + set(platform "x64") endif() +set(CTEST_BUILD_NAME "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${PY_VERSION_PATCH}-VS-${platform}-$ENV{CONFIGURATION}_${what}_${commit}") set(CTEST_BUILD_FLAGS "") set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) From 2682ac43fea98c97bf1e27bbe51a5292d21aba8f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 13 Apr 2016 06:00:55 -0400 Subject: [PATCH 18/64] circle: Add script to run configure/build/test from within a docker container --- .github/dashboard/circle_dashboard.cmake | 64 ++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/dashboard/circle_dashboard.cmake diff --git a/.github/dashboard/circle_dashboard.cmake b/.github/dashboard/circle_dashboard.cmake new file mode 100644 index 000000000..f87ae95a2 --- /dev/null +++ b/.github/dashboard/circle_dashboard.cmake @@ -0,0 +1,64 @@ +# Client maintainer: jchris.fillionr@kitware.com +set(CTEST_SITE "docker-thewtex-crosscompilers") +set(CTEST_DASHBOARD_ROOT /usr) +string(SUBSTRING $ENV{CIRCLE_SHA1} 0 7 commit) + +# Extract major/minor/patch python versions +if("$ENV{PY_VERSION}" STREQUAL "") + message(FATAL_ERROR "Environment variable 'PY_VERSION' is not set") +endif() +set(PY_VERSION $ENV{PY_VERSION}) +string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) +if(_match STREQUAL "") + message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") +endif() +set(PY_VERSION_MAJOR ${CMAKE_MATCH_1}) +set(PY_VERSION_MINOR ${CMAKE_MATCH_2}) +set(PY_VERSION_PATCH ${CMAKE_MATCH_3}) + +set(what "#$ENV{CIRCLE_PR_NUMBER}") +if($ENV{CIRCLE_PR_NUMBER} STREQUAL "") + set(what "$ENV{CIRCLE_BRANCH}") +endif() +set(CTEST_BUILD_NAME "${PY_VERSION}-$ENV{CROSS_TRIPLE}_${what}_${commit}") +set(CTEST_CONFIGURATION_TYPE Release) +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_BUILD_FLAGS "-j4") +set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) + +set(dashboard_model Experimental) +set(dashboard_track Circle-CI) + +set(dashboard_cache "PY_VERSION_MAJOR:STRING=${PY_VERSION_MAJOR} +PY_VERSION_MINOR:STRING=${PY_VERSION_MINOR} +PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} +") + +# Toolchain +if(EXISTS $ENV{CMAKE_TOOLCHAIN_FILE}) + set(dashboard_cache "${dashboard_cache} +CMAKE_TOOLCHAIN_FILE:FILEPATH=$ENV{CMAKE_TOOLCHAIN_FILE} +") +endif() + +function(downloadFile url dest) + file(DOWNLOAD ${url} ${dest} STATUS status) + list(GET status 0 error_code) + list(GET status 1 error_msg) + if(error_code) + message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}") + endif() +endfunction() + +# Download and include driver script +set(url https://raw.githubusercontent.com/python-cmake-buildsystem/python-cmake-buildsystem/dashboard/python_common.cmake) +set(dest ${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) +downloadfile(${url} ${dest}) +include(${dest}) + +# Upload link to travis +#set(travis_url "/tmp/travis.url") +#file(WRITE ${travis_url} "https://travis-ci.org/$ENV{TRAVIS_REPO_SLUG}/builds/$ENV{TRAVIS_BUILD_ID}") +#ctest_upload(FILES ${travis_url}) +#ctest_submit(PARTS Upload) +#file(REMOVE ${travis_url}) From 4a0071b957e8c4caa82d4f81b67fa66be8983758 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 13 Apr 2016 06:04:46 -0400 Subject: [PATCH 19/64] circle: Skip download of driver script. This is not required since the dashboard branch is checked out within circle.yml --- .github/dashboard/circle_dashboard.cmake | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/dashboard/circle_dashboard.cmake b/.github/dashboard/circle_dashboard.cmake index f87ae95a2..2a193666a 100644 --- a/.github/dashboard/circle_dashboard.cmake +++ b/.github/dashboard/circle_dashboard.cmake @@ -41,20 +41,8 @@ CMAKE_TOOLCHAIN_FILE:FILEPATH=$ENV{CMAKE_TOOLCHAIN_FILE} ") endif() -function(downloadFile url dest) - file(DOWNLOAD ${url} ${dest} STATUS status) - list(GET status 0 error_code) - list(GET status 1 error_msg) - if(error_code) - message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}") - endif() -endfunction() - -# Download and include driver script -set(url https://raw.githubusercontent.com/python-cmake-buildsystem/python-cmake-buildsystem/dashboard/python_common.cmake) -set(dest ${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) -downloadfile(${url} ${dest}) -include(${dest}) +# Include driver script +include(${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) # Upload link to travis #set(travis_url "/tmp/travis.url") From d5eb6784c66307928c07e44727a188ccecd06993 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 18 Apr 2016 22:20:21 -0400 Subject: [PATCH 20/64] circle: Fix CMake error when directly testing a branch (e.g master) --- .github/dashboard/circle_dashboard.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dashboard/circle_dashboard.cmake b/.github/dashboard/circle_dashboard.cmake index 2a193666a..ca8d0ef1b 100644 --- a/.github/dashboard/circle_dashboard.cmake +++ b/.github/dashboard/circle_dashboard.cmake @@ -17,7 +17,7 @@ set(PY_VERSION_MINOR ${CMAKE_MATCH_2}) set(PY_VERSION_PATCH ${CMAKE_MATCH_3}) set(what "#$ENV{CIRCLE_PR_NUMBER}") -if($ENV{CIRCLE_PR_NUMBER} STREQUAL "") +if("$ENV{CIRCLE_PR_NUMBER}" STREQUAL "") set(what "$ENV{CIRCLE_BRANCH}") endif() set(CTEST_BUILD_NAME "${PY_VERSION}-$ENV{CROSS_TRIPLE}_${what}_${commit}") From 84f4ab6be8aa83534bc6208bdb08c2f925b62223 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 18 Apr 2016 22:39:54 -0400 Subject: [PATCH 21/64] appveyor/travis: Download script from updated location --- .github/dashboard/appveyor_dashboard.cmake | 2 +- .github/dashboard/travis_dashboard.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index 7629cd161..ce713342c 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -56,7 +56,7 @@ function(downloadFile url dest) endfunction() # Download and include driver script -set(url https://raw.githubusercontent.com/davidsansome/python-cmake-buildsystem/dashboard/python_common.cmake) +set(url https://raw.githubusercontent.com/python-cmake-buildsystem/python-cmake-buildsystem/dashboard/python_common.cmake) set(dest ${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) downloadfile(${url} ${dest}) include(${dest}) diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index f32c7c462..ebd083dc3 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -46,7 +46,7 @@ function(downloadFile url dest) endfunction() # Download and include driver script -set(url https://raw.githubusercontent.com/davidsansome/python-cmake-buildsystem/dashboard/python_common.cmake) +set(url https://raw.githubusercontent.com/python-cmake-buildsystem/python-cmake-buildsystem/dashboard/python_common.cmake) set(dest ${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) downloadfile(${url} ${dest}) include(${dest}) From d0698413509faaa9e1a1667efe1f231b226e23ce Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 18 Apr 2016 22:40:34 -0400 Subject: [PATCH 22/64] appveyor/travis: Simplify code using PY_VERSION variable --- .github/dashboard/appveyor_dashboard.cmake | 2 +- .github/dashboard/travis_dashboard.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index ce713342c..b37ca232c 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -31,7 +31,7 @@ if(platform STREQUAL "x64") elseif(CTEST_CMAKE_GENERATOR MATCHES "Win64") set(platform "x64") endif() -set(CTEST_BUILD_NAME "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${PY_VERSION_PATCH}-VS-${platform}-$ENV{CONFIGURATION}_${what}_${commit}") +set(CTEST_BUILD_NAME "${PY_VERSION}-VS-${platform}-$ENV{CONFIGURATION}_${what}_${commit}") set(CTEST_BUILD_FLAGS "") set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index ebd083dc3..41d353cd6 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -22,7 +22,7 @@ set(what "#$ENV{TRAVIS_PULL_REQUEST}") if($ENV{TRAVIS_PULL_REQUEST} STREQUAL "false") set(what "$ENV{TRAVIS_BRANCH}") endif() -set(CTEST_BUILD_NAME "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${PY_VERSION_PATCH}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_${what}_${commit}") +set(CTEST_BUILD_NAME "${PY_VERSION}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_${what}_${commit}") set(CTEST_CONFIGURATION_TYPE Release) set(CTEST_CMAKE_GENERATOR "Unix Makefiles") set(CTEST_BUILD_FLAGS "-j4") From a2e1a6f337d3868f8ae2e121cf41bb4a3f22c444 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 21 Apr 2016 02:12:29 -0400 Subject: [PATCH 23/64] appveyor: Use option BUILD_LIBPYTHON_SHARED introduced in #127 --- .github/dashboard/appveyor_dashboard.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index b37ca232c..fef345eec 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -39,8 +39,7 @@ set(dashboard_binary_name "python-cmake-buildsystem/build") set(dashboard_model Experimental) set(dashboard_track AppVeyor-CI) -set(dashboard_cache "BUILD_SHARED:BOOL=ON -BUILD_STATIC:BOOL=OFF +set(dashboard_cache "BUILD_LIBPYTHON_SHARED:BOOL=ON PY_VERSION_MAJOR:STRING=${PY_VERSION_MAJOR} PY_VERSION_MINOR:STRING=${PY_VERSION_MINOR} PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} From 274bdc9453d49926772d28499e56f189f3fca7c2 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 21 Apr 2016 02:20:22 -0400 Subject: [PATCH 24/64] circle: Exclude dashboard branch --- .github/dashboard/circle.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/dashboard/circle.yml diff --git a/.github/dashboard/circle.yml b/.github/dashboard/circle.yml new file mode 100644 index 000000000..a1dbbafeb --- /dev/null +++ b/.github/dashboard/circle.yml @@ -0,0 +1,4 @@ +general: + branches: + ignore: + - dashboard From cf4bec5754a3e92dce297feb87cf431eae67aaf6 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 12 Jul 2016 02:07:38 -0400 Subject: [PATCH 25/64] travis: Expect newer OpenSSL when building python > 3.5.0 on osx --- .github/dashboard/travis_dashboard.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index 41d353cd6..b162d4422 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -35,6 +35,13 @@ set(dashboard_cache "PY_VERSION_MAJOR:STRING=${PY_VERSION_MAJOR} PY_VERSION_MINOR:STRING=${PY_VERSION_MINOR} PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} ") +if($ENV{TRAVIS_OS_NAME} STREQUAL "osx" AND ${PY_VERSION} VERSION_GREATER "3.5.0") + set(dashboard_cache "${dashboard_cache} +OPENSSL_ROOT_DIR:PATH=/usr/local/opt/openssl +") +endif() + +message("dashboard_cache:${dashboard_cache}") function(downloadFile url dest) file(DOWNLOAD ${url} ${dest} STATUS status) From 99cb03a740a6efb30a11f835113ad69ba1024f47 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 25 Aug 2016 09:40:43 -0400 Subject: [PATCH 26/64] Update python version configuration based on #150 --- .github/dashboard/appveyor_dashboard.cmake | 7 +------ .github/dashboard/circle_dashboard.cmake | 7 +------ .github/dashboard/travis_dashboard.cmake | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index fef345eec..beeecbed6 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -12,9 +12,6 @@ string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) if(_match STREQUAL "") message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") endif() -set(PY_VERSION_MAJOR ${CMAKE_MATCH_1}) -set(PY_VERSION_MINOR ${CMAKE_MATCH_2}) -set(PY_VERSION_PATCH ${CMAKE_MATCH_3}) set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}") if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "") @@ -40,9 +37,7 @@ set(dashboard_model Experimental) set(dashboard_track AppVeyor-CI) set(dashboard_cache "BUILD_LIBPYTHON_SHARED:BOOL=ON -PY_VERSION_MAJOR:STRING=${PY_VERSION_MAJOR} -PY_VERSION_MINOR:STRING=${PY_VERSION_MINOR} -PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} +PY_VERSION:STRING=${PY_VERSION} ") function(downloadFile url dest) diff --git a/.github/dashboard/circle_dashboard.cmake b/.github/dashboard/circle_dashboard.cmake index ca8d0ef1b..5bf8afb31 100644 --- a/.github/dashboard/circle_dashboard.cmake +++ b/.github/dashboard/circle_dashboard.cmake @@ -12,9 +12,6 @@ string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) if(_match STREQUAL "") message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") endif() -set(PY_VERSION_MAJOR ${CMAKE_MATCH_1}) -set(PY_VERSION_MINOR ${CMAKE_MATCH_2}) -set(PY_VERSION_PATCH ${CMAKE_MATCH_3}) set(what "#$ENV{CIRCLE_PR_NUMBER}") if("$ENV{CIRCLE_PR_NUMBER}" STREQUAL "") @@ -29,9 +26,7 @@ set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) set(dashboard_model Experimental) set(dashboard_track Circle-CI) -set(dashboard_cache "PY_VERSION_MAJOR:STRING=${PY_VERSION_MAJOR} -PY_VERSION_MINOR:STRING=${PY_VERSION_MINOR} -PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} +set(dashboard_cache "PY_VERSION:STRING=${PY_VERSION} ") # Toolchain diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index b162d4422..13162b6d5 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -14,9 +14,6 @@ string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) if(_match STREQUAL "") message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") endif() -set(PY_VERSION_MAJOR ${CMAKE_MATCH_1}) -set(PY_VERSION_MINOR ${CMAKE_MATCH_2}) -set(PY_VERSION_PATCH ${CMAKE_MATCH_3}) set(what "#$ENV{TRAVIS_PULL_REQUEST}") if($ENV{TRAVIS_PULL_REQUEST} STREQUAL "false") @@ -31,9 +28,7 @@ set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) set(dashboard_model Experimental) set(dashboard_track Travis-CI) -set(dashboard_cache "PY_VERSION_MAJOR:STRING=${PY_VERSION_MAJOR} -PY_VERSION_MINOR:STRING=${PY_VERSION_MINOR} -PY_VERSION_PATCH:STRING=${PY_VERSION_PATCH} +set(dashboard_cache "PY_VERSION:STRING=${PY_VERSION} ") if($ENV{TRAVIS_OS_NAME} STREQUAL "osx" AND ${PY_VERSION} VERSION_GREATER "3.5.0") set(dashboard_cache "${dashboard_cache} From de409ea2312f9b72e2b47ffdcf9c2daef323529a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 4 Nov 2016 01:36:17 -0400 Subject: [PATCH 27/64] circle_dashboard: Attempt to speed up build using Ninja. See #164 --- .github/dashboard/circle_dashboard.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dashboard/circle_dashboard.cmake b/.github/dashboard/circle_dashboard.cmake index 5bf8afb31..aa7d39223 100644 --- a/.github/dashboard/circle_dashboard.cmake +++ b/.github/dashboard/circle_dashboard.cmake @@ -19,7 +19,7 @@ if("$ENV{CIRCLE_PR_NUMBER}" STREQUAL "") endif() set(CTEST_BUILD_NAME "${PY_VERSION}-$ENV{CROSS_TRIPLE}_${what}_${commit}") set(CTEST_CONFIGURATION_TYPE Release) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_CMAKE_GENERATOR "Ninja") set(CTEST_BUILD_FLAGS "-j4") set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) From 69dd11d2aa69a05d21bc119dd49ab3d901ee9fca Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 19 Nov 2016 20:30:34 -0500 Subject: [PATCH 28/64] circle_dashboard: Update to work with dockcross images --- .github/dashboard/circle_dashboard.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/dashboard/circle_dashboard.cmake b/.github/dashboard/circle_dashboard.cmake index aa7d39223..c753e6891 100644 --- a/.github/dashboard/circle_dashboard.cmake +++ b/.github/dashboard/circle_dashboard.cmake @@ -1,6 +1,10 @@ # Client maintainer: jchris.fillionr@kitware.com -set(CTEST_SITE "docker-thewtex-crosscompilers") -set(CTEST_DASHBOARD_ROOT /usr) +if("$ENV{DEFAULT_DOCKCROSS_IMAGE}" STREQUAL "") + message(FATAL_ERROR "Environment variable 'DEFAULT_DOCKCROSS_IMAGE' is not set") +endif() +set(CTEST_SITE "$ENV{DEFAULT_DOCKCROSS_IMAGE}") +set(CTEST_DASHBOARD_ROOT /work) +set(CTEST_SOURCE_DIRECTORY /work) string(SUBSTRING $ENV{CIRCLE_SHA1} 0 7 commit) # Extract major/minor/patch python versions @@ -23,6 +27,7 @@ set(CTEST_CMAKE_GENERATOR "Ninja") set(CTEST_BUILD_FLAGS "-j4") set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) +set(dashboard_binary_name build) set(dashboard_model Experimental) set(dashboard_track Circle-CI) From 10a43b0e2b1d02a8ffb12303c8a705fcc8e78fab Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sun, 20 Nov 2016 02:33:47 -0500 Subject: [PATCH 29/64] [appveyor|circle|travis]_dashboard: Fix version selection setting PYTHON_VERSION This commit fixes regression introduced in 99cb03a (Update python version configuration based on #150) --- .github/dashboard/appveyor_dashboard.cmake | 2 +- .github/dashboard/circle_dashboard.cmake | 2 +- .github/dashboard/travis_dashboard.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index beeecbed6..0d6dad38d 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -37,7 +37,7 @@ set(dashboard_model Experimental) set(dashboard_track AppVeyor-CI) set(dashboard_cache "BUILD_LIBPYTHON_SHARED:BOOL=ON -PY_VERSION:STRING=${PY_VERSION} +PYTHON_VERSION:STRING=${PY_VERSION} ") function(downloadFile url dest) diff --git a/.github/dashboard/circle_dashboard.cmake b/.github/dashboard/circle_dashboard.cmake index c753e6891..573d3c7d6 100644 --- a/.github/dashboard/circle_dashboard.cmake +++ b/.github/dashboard/circle_dashboard.cmake @@ -31,7 +31,7 @@ set(dashboard_binary_name build) set(dashboard_model Experimental) set(dashboard_track Circle-CI) -set(dashboard_cache "PY_VERSION:STRING=${PY_VERSION} +set(dashboard_cache "PYTHON_VERSION:STRING=${PY_VERSION} ") # Toolchain diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index 13162b6d5..e12149261 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -28,7 +28,7 @@ set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) set(dashboard_model Experimental) set(dashboard_track Travis-CI) -set(dashboard_cache "PY_VERSION:STRING=${PY_VERSION} +set(dashboard_cache "PYTHON_VERSION:STRING=${PY_VERSION} ") if($ENV{TRAVIS_OS_NAME} STREQUAL "osx" AND ${PY_VERSION} VERSION_GREATER "3.5.0") set(dashboard_cache "${dashboard_cache} From ac0791d100ba28c2a24f5d9468b093672d0d8781 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 28 Dec 2021 21:47:53 -0500 Subject: [PATCH 30/64] Re-organize script to streamline maintenance - Add env. variables check section - Group variables specific to "Build name" --- .github/dashboard/appveyor_dashboard.cmake | 45 ++++++++++++++-------- .github/dashboard/circle_dashboard.cmake | 36 ++++++++++------- .github/dashboard/travis_dashboard.cmake | 35 +++++++++++------ 3 files changed, 73 insertions(+), 43 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index 0d6dad38d..d98564773 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -1,22 +1,25 @@ # Client maintainer: jchris.fillionr@kitware.com -set(CTEST_SITE "appveyor") -set(CTEST_DASHBOARD_ROOT $ENV{APPVEYOR_BUILD_FOLDER}/..) -string(SUBSTRING $ENV{APPVEYOR_REPO_COMMIT} 0 7 commit) + +# Sanity checks +foreach(name IN ITEMS + CONFIGURATION + PY_VERSION + ) + if("$ENV{${name}}" STREQUAL "") + message(FATAL_ERROR "Environment variable '${name}' is not set") + endif() +endforeach() # Extract major/minor/patch python versions -if("$ENV{PY_VERSION}" STREQUAL "") - message(FATAL_ERROR "Environment variable 'PY_VERSION' is not set") -endif() set(PY_VERSION $ENV{PY_VERSION}) string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) if(_match STREQUAL "") message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") endif() -set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}") -if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "") - set(what "$ENV{APPVEYOR_REPO_BRANCH}") -endif() +set(CTEST_SITE "appveyor") +set(CTEST_DASHBOARD_ROOT $ENV{APPVEYOR_BUILD_FOLDER}/..) + set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) set(CTEST_CMAKE_GENERATOR "$ENV{GENERATOR}") if("${CTEST_CMAKE_GENERATOR}" STREQUAL "") @@ -28,10 +31,18 @@ if(platform STREQUAL "x64") elseif(CTEST_CMAKE_GENERATOR MATCHES "Win64") set(platform "x64") endif() -set(CTEST_BUILD_NAME "${PY_VERSION}-VS-${platform}-$ENV{CONFIGURATION}_${what}_${commit}") + set(CTEST_BUILD_FLAGS "") set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) +# Build name +string(SUBSTRING $ENV{APPVEYOR_REPO_COMMIT} 0 7 commit) +set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}") +if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "") + set(what "$ENV{APPVEYOR_REPO_BRANCH}") +endif() +set(CTEST_BUILD_NAME "${PY_VERSION}-VS-${platform}-$ENV{CONFIGURATION}_${what}_${commit}") + set(dashboard_binary_name "python-cmake-buildsystem/build") set(dashboard_model Experimental) set(dashboard_track AppVeyor-CI) @@ -55,9 +66,9 @@ set(dest ${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) downloadfile(${url} ${dest}) include(${dest}) -# Upload link to appveyor -set(url "${CTEST_DASHBOARD_ROOT}/python-cmake-buildsystem/scratch/appveyor.url") -file(WRITE ${url} "https://ci.appveyor.com/project/$ENV{APPVEYOR_REPO_NAME}/build/$ENV{APPVEYOR_BUILD_VERSION}") -ctest_upload(FILES ${url}) -ctest_submit(PARTS Upload) -file(REMOVE ${url}) +# Upload link to CDash +#set(url "${CTEST_DASHBOARD_ROOT}/python-cmake-buildsystem/scratch/appveyor.url") +#file(WRITE ${url} "https://ci.appveyor.com/project/$ENV{APPVEYOR_REPO_NAME}/build/$ENV{APPVEYOR_BUILD_VERSION}") +#ctest_upload(FILES ${url}) +#ctest_submit(PARTS Upload) +#file(REMOVE ${url}) diff --git a/.github/dashboard/circle_dashboard.cmake b/.github/dashboard/circle_dashboard.cmake index 573d3c7d6..f7d0dfc94 100644 --- a/.github/dashboard/circle_dashboard.cmake +++ b/.github/dashboard/circle_dashboard.cmake @@ -1,31 +1,39 @@ # Client maintainer: jchris.fillionr@kitware.com -if("$ENV{DEFAULT_DOCKCROSS_IMAGE}" STREQUAL "") - message(FATAL_ERROR "Environment variable 'DEFAULT_DOCKCROSS_IMAGE' is not set") -endif() -set(CTEST_SITE "$ENV{DEFAULT_DOCKCROSS_IMAGE}") -set(CTEST_DASHBOARD_ROOT /work) -set(CTEST_SOURCE_DIRECTORY /work) -string(SUBSTRING $ENV{CIRCLE_SHA1} 0 7 commit) + +# Sanity checks +foreach(name IN ITEMS + DEFAULT_DOCKCROSS_IMAGE + PY_VERSION + ) + if("$ENV{${name}}" STREQUAL "") + message(FATAL_ERROR "Environment variable '${name}' is not set") + endif() +endforeach() # Extract major/minor/patch python versions -if("$ENV{PY_VERSION}" STREQUAL "") - message(FATAL_ERROR "Environment variable 'PY_VERSION' is not set") -endif() set(PY_VERSION $ENV{PY_VERSION}) string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) if(_match STREQUAL "") message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") endif() +set(CTEST_SITE "$ENV{DEFAULT_DOCKCROSS_IMAGE}") +set(CTEST_DASHBOARD_ROOT /work) +set(CTEST_SOURCE_DIRECTORY /work) + +set(CTEST_CONFIGURATION_TYPE Release) +set(CTEST_CMAKE_GENERATOR "Ninja") + +set(CTEST_BUILD_FLAGS "-j4") +set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) + +# Build name +string(SUBSTRING $ENV{CIRCLE_SHA1} 0 7 commit) set(what "#$ENV{CIRCLE_PR_NUMBER}") if("$ENV{CIRCLE_PR_NUMBER}" STREQUAL "") set(what "$ENV{CIRCLE_BRANCH}") endif() set(CTEST_BUILD_NAME "${PY_VERSION}-$ENV{CROSS_TRIPLE}_${what}_${commit}") -set(CTEST_CONFIGURATION_TYPE Release) -set(CTEST_CMAKE_GENERATOR "Ninja") -set(CTEST_BUILD_FLAGS "-j4") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) set(dashboard_binary_name build) set(dashboard_model Experimental) diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake index e12149261..7d4b836e1 100644 --- a/.github/dashboard/travis_dashboard.cmake +++ b/.github/dashboard/travis_dashboard.cmake @@ -1,29 +1,40 @@ # Client maintainer: jchris.fillionr@kitware.com -execute_process(COMMAND hostname OUTPUT_VARIABLE hostname OUTPUT_STRIP_TRAILING_WHITESPACE) -set(CTEST_SITE "${hostname}") -set(CTEST_DASHBOARD_ROOT $ENV{TRAVIS_BUILD_DIR}/..) -get_filename_component(compiler_name $ENV{CC} NAME) -string(SUBSTRING $ENV{TRAVIS_COMMIT} 0 7 commit) + +# Sanity checks +foreach(name IN ITEMS + DEFAULT_DOCKCROSS_IMAGE + PY_VERSION + ) + if("$ENV{${name}}" STREQUAL "") + message(FATAL_ERROR "Environment variable '${name}' is not set") + endif() +endforeach() # Extract major/minor/patch python versions -if("$ENV{PY_VERSION}" STREQUAL "") - message(FATAL_ERROR "Environment variable 'PY_VERSION' is not set") -endif() set(PY_VERSION $ENV{PY_VERSION}) string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) if(_match STREQUAL "") message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") endif() +execute_process(COMMAND hostname OUTPUT_VARIABLE hostname OUTPUT_STRIP_TRAILING_WHITESPACE) +set(CTEST_SITE "${hostname}") +set(CTEST_DASHBOARD_ROOT $ENV{TRAVIS_BUILD_DIR}/..) + +set(CTEST_CONFIGURATION_TYPE Release) +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + +set(CTEST_BUILD_FLAGS "-j4") +set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) + +# Build name +get_filename_component(compiler_name $ENV{CC} NAME) +string(SUBSTRING $ENV{TRAVIS_COMMIT} 0 7 commit) set(what "#$ENV{TRAVIS_PULL_REQUEST}") if($ENV{TRAVIS_PULL_REQUEST} STREQUAL "false") set(what "$ENV{TRAVIS_BRANCH}") endif() set(CTEST_BUILD_NAME "${PY_VERSION}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_${what}_${commit}") -set(CTEST_CONFIGURATION_TYPE Release) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") -set(CTEST_BUILD_FLAGS "-j4") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) set(dashboard_model Experimental) set(dashboard_track Travis-CI) From ff532789d77da5f0b8939de6dec1bc946c8d405a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 28 Dec 2021 21:53:05 -0500 Subject: [PATCH 31/64] appveyor: Require GENERATOR and PLATFORM env. variables --- .github/dashboard/appveyor_dashboard.cmake | 14 ++++---------- .github/dashboard/python_common.cmake | 1 + 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake index d98564773..592022029 100644 --- a/.github/dashboard/appveyor_dashboard.cmake +++ b/.github/dashboard/appveyor_dashboard.cmake @@ -3,6 +3,8 @@ # Sanity checks foreach(name IN ITEMS CONFIGURATION + GENERATOR + PLATFORM PY_VERSION ) if("$ENV{${name}}" STREQUAL "") @@ -22,15 +24,7 @@ set(CTEST_DASHBOARD_ROOT $ENV{APPVEYOR_BUILD_FOLDER}/..) set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) set(CTEST_CMAKE_GENERATOR "$ENV{GENERATOR}") -if("${CTEST_CMAKE_GENERATOR}" STREQUAL "") - set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008") -endif() -set(platform $ENV{PLATFORM}) -if(platform STREQUAL "x64") - set(CTEST_CMAKE_GENERATOR "${CTEST_CMAKE_GENERATOR} Win64") -elseif(CTEST_CMAKE_GENERATOR MATCHES "Win64") - set(platform "x64") -endif() +set(CTEST_CMAKE_GENERATOR_PLATFORM $ENV{PLATFORM}) set(CTEST_BUILD_FLAGS "") set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) @@ -41,7 +35,7 @@ set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "") set(what "$ENV{APPVEYOR_REPO_BRANCH}") endif() -set(CTEST_BUILD_NAME "${PY_VERSION}-VS-${platform}-$ENV{CONFIGURATION}_${what}_${commit}") +set(CTEST_BUILD_NAME "${PY_VERSION}-VS-${CTEST_CMAKE_GENERATOR_PLATFORM}-${CTEST_CONFIGURATION_TYPE}_${what}_${commit}") set(dashboard_binary_name "python-cmake-buildsystem/build") set(dashboard_model Experimental) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 04ed28fa9..38618560c 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -262,6 +262,7 @@ foreach(v CTEST_SOURCE_DIRECTORY CTEST_BINARY_DIRECTORY CTEST_CMAKE_GENERATOR + CTEST_CMAKE_GENERATOR_PLATFORM CTEST_CONFIGURATION_TYPE CTEST_GIT_COMMAND CTEST_CHECKOUT_COMMAND From 8ef477d0911da7600e0f41558144f2d6b748a8d7 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 28 Dec 2021 21:55:10 -0500 Subject: [PATCH 32/64] Add "Circle-CI-Windows" dashboard script --- .github/dashboard/circle_win_dashboard.cmake | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/dashboard/circle_win_dashboard.cmake diff --git a/.github/dashboard/circle_win_dashboard.cmake b/.github/dashboard/circle_win_dashboard.cmake new file mode 100644 index 000000000..6bb8ccf0e --- /dev/null +++ b/.github/dashboard/circle_win_dashboard.cmake @@ -0,0 +1,51 @@ +# Client maintainer: jchris.fillionr@kitware.com + +# Sanity checks +foreach(name IN ITEMS + CONFIGURATION + GENERATOR + PLATFORM + PY_VERSION + ) + if("$ENV{${name}}" STREQUAL "") + message(FATAL_ERROR "Environment variable '${name}' is not set") + endif() +endforeach() + +# Extract major/minor/patch python versions +set(PY_VERSION $ENV{PY_VERSION}) +string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) +if(_match STREQUAL "") + message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") +endif() + +set(CTEST_SITE "circleci-window") +set(CTEST_DASHBOARD_ROOT $ENV{CIRCLE_WORKING_DIRECTORY}/..) +set(CTEST_SOURCE_DIRECTORY $ENV{CIRCLE_WORKING_DIRECTORY}) + +set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) +set(CTEST_CMAKE_GENERATOR "$ENV{GENERATOR}") +set(CTEST_CMAKE_GENERATOR_PLATFORM $ENV{PLATFORM}) + +set(CTEST_BUILD_FLAGS "/m") +set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) + +# Build name +string(SUBSTRING $ENV{CIRCLE_SHA1} 0 7 commit) +set(what "#$ENV{CIRCLE_PR_NUMBER}") +if("$ENV{CIRCLE_PR_NUMBER}" STREQUAL "") + set(what "$ENV{CIRCLE_BRANCH}") +endif() +set(CTEST_BUILD_NAME "${PY_VERSION}-${CTEST_CMAKE_GENERATOR_PLATFORM}-${CTEST_CONFIGURATION_TYPE}_${what}_${commit}") + +set(dashboard_binary_name build) +set(dashboard_model Experimental) +set(dashboard_track Circle-CI-Windows) + +set(dashboard_cache "BUILD_LIBPYTHON_SHARED:BOOL=ON +PYTHON_VERSION:STRING=${PY_VERSION} +") + +# Include driver script +include(${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) + From fbc3a81dc93680e6031d9b554a35995482b553f7 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 3 Jan 2022 21:27:45 -0500 Subject: [PATCH 33/64] Update minimum required CMake version from 2.8.6 to 3.13.5 See https://github.com/python-cmake-buildsystem/python-cmake-buildsystem/pull/287 --- .github/dashboard/python_common.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 38618560c..66b577487 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -88,7 +88,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= -cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13.5) set(CTEST_PROJECT_NAME CPython) set(dashboard_user_home "$ENV{HOME}") From 85e51bd3e825574be545fbcf5cf13e65d5ed97bc Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 7 Jan 2022 10:59:23 -0500 Subject: [PATCH 34/64] travis_dashboard: Remove obsolete script --- .github/dashboard/travis_dashboard.cmake | 72 ------------------------ 1 file changed, 72 deletions(-) delete mode 100644 .github/dashboard/travis_dashboard.cmake diff --git a/.github/dashboard/travis_dashboard.cmake b/.github/dashboard/travis_dashboard.cmake deleted file mode 100644 index 7d4b836e1..000000000 --- a/.github/dashboard/travis_dashboard.cmake +++ /dev/null @@ -1,72 +0,0 @@ -# Client maintainer: jchris.fillionr@kitware.com - -# Sanity checks -foreach(name IN ITEMS - DEFAULT_DOCKCROSS_IMAGE - PY_VERSION - ) - if("$ENV{${name}}" STREQUAL "") - message(FATAL_ERROR "Environment variable '${name}' is not set") - endif() -endforeach() - -# Extract major/minor/patch python versions -set(PY_VERSION $ENV{PY_VERSION}) -string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) -if(_match STREQUAL "") - message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") -endif() - -execute_process(COMMAND hostname OUTPUT_VARIABLE hostname OUTPUT_STRIP_TRAILING_WHITESPACE) -set(CTEST_SITE "${hostname}") -set(CTEST_DASHBOARD_ROOT $ENV{TRAVIS_BUILD_DIR}/..) - -set(CTEST_CONFIGURATION_TYPE Release) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") - -set(CTEST_BUILD_FLAGS "-j4") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) - -# Build name -get_filename_component(compiler_name $ENV{CC} NAME) -string(SUBSTRING $ENV{TRAVIS_COMMIT} 0 7 commit) -set(what "#$ENV{TRAVIS_PULL_REQUEST}") -if($ENV{TRAVIS_PULL_REQUEST} STREQUAL "false") - set(what "$ENV{TRAVIS_BRANCH}") -endif() -set(CTEST_BUILD_NAME "${PY_VERSION}-$ENV{TRAVIS_OS_NAME}-${compiler_name}_${what}_${commit}") - -set(dashboard_model Experimental) -set(dashboard_track Travis-CI) - -set(dashboard_cache "PYTHON_VERSION:STRING=${PY_VERSION} -") -if($ENV{TRAVIS_OS_NAME} STREQUAL "osx" AND ${PY_VERSION} VERSION_GREATER "3.5.0") - set(dashboard_cache "${dashboard_cache} -OPENSSL_ROOT_DIR:PATH=/usr/local/opt/openssl -") -endif() - -message("dashboard_cache:${dashboard_cache}") - -function(downloadFile url dest) - file(DOWNLOAD ${url} ${dest} STATUS status) - list(GET status 0 error_code) - list(GET status 1 error_msg) - if(error_code) - message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}") - endif() -endfunction() - -# Download and include driver script -set(url https://raw.githubusercontent.com/python-cmake-buildsystem/python-cmake-buildsystem/dashboard/python_common.cmake) -set(dest ${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) -downloadfile(${url} ${dest}) -include(${dest}) - -# Upload link to travis -set(travis_url "/tmp/travis.url") -file(WRITE ${travis_url} "https://travis-ci.org/$ENV{TRAVIS_REPO_SLUG}/builds/$ENV{TRAVIS_BUILD_ID}") -ctest_upload(FILES ${travis_url}) -ctest_submit(PARTS Upload) -file(REMOVE ${travis_url}) From c2e78deae49596fce83151af99830c836a11620c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 7 Jan 2022 11:00:06 -0500 Subject: [PATCH 35/64] Add "Circle-CI-macOS" dashboard script --- .../dashboard/circle_macos_dashboard.cmake | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/dashboard/circle_macos_dashboard.cmake diff --git a/.github/dashboard/circle_macos_dashboard.cmake b/.github/dashboard/circle_macos_dashboard.cmake new file mode 100644 index 000000000..7ca6d6ee8 --- /dev/null +++ b/.github/dashboard/circle_macos_dashboard.cmake @@ -0,0 +1,46 @@ +# Client maintainer: jchris.fillionr@kitware.com + +# Sanity checks +foreach(name IN ITEMS + PY_VERSION + ) + if("$ENV{${name}}" STREQUAL "") + message(FATAL_ERROR "Environment variable '${name}' is not set") + endif() +endforeach() + +# Extract major/minor/patch python versions +set(PY_VERSION $ENV{PY_VERSION}) +string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) +if(_match STREQUAL "") + message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") +endif() + +set(CTEST_SITE "circleci-macos") +set(CTEST_DASHBOARD_ROOT $ENV{CIRCLE_WORKING_DIRECTORY}/..) +set(CTEST_SOURCE_DIRECTORY $ENV{CIRCLE_WORKING_DIRECTORY}) + +set(CTEST_CMAKE_GENERATOR "Ninja") + +set(CTEST_BUILD_FLAGS "-j4") +set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) + +# Build name +string(SUBSTRING $ENV{CIRCLE_SHA1} 0 7 commit) +set(what "#$ENV{CIRCLE_PR_NUMBER}") +if("$ENV{CIRCLE_PR_NUMBER}" STREQUAL "") + set(what "$ENV{CIRCLE_BRANCH}") +endif() +set(CTEST_BUILD_NAME "${PY_VERSION}_x64-${what}_${commit}") + +set(dashboard_binary_name build) +set(dashboard_model Experimental) +set(dashboard_track Circle-CI-macOS) + +set(dashboard_cache "BUILD_LIBPYTHON_SHARED:BOOL=ON +PYTHON_VERSION:STRING=${PY_VERSION} +") + +# Include driver script +include(${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) + From e7e2bb7108f89140772d22b1d980d6bbabfb29a8 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 7 Jan 2022 12:49:18 -0500 Subject: [PATCH 36/64] Add "GitHub-Actions" dashboard script to test macOS --- .../dashboard/github_actions_dashboard.cmake | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/dashboard/github_actions_dashboard.cmake diff --git a/.github/dashboard/github_actions_dashboard.cmake b/.github/dashboard/github_actions_dashboard.cmake new file mode 100644 index 000000000..2a1b28ef0 --- /dev/null +++ b/.github/dashboard/github_actions_dashboard.cmake @@ -0,0 +1,50 @@ +# Client maintainer: jchris.fillionr@kitware.com + +# Sanity checks +foreach(name IN ITEMS + PY_VERSION + RUNNER_OS + RUNNER_ARCH + CC + CXX + ) + if("$ENV{${name}}" STREQUAL "") + message(FATAL_ERROR "Environment variable '${name}' is not set") + endif() +endforeach() + +# Extract major/minor/patch python versions +set(PY_VERSION $ENV{PY_VERSION}) +string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) +if(_match STREQUAL "") + message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") +endif() + +set(CTEST_SITE "$ENV{RUNNER_OS}-$ENV{RUNNER_ARCH}") +set(CTEST_DASHBOARD_ROOT $ENV{GITHUB_WORKSPACE}) +set(CTEST_SOURCE_DIRECTORY $ENV{GITHUB_WORKSPACE}/src) + +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + +set(CTEST_BUILD_FLAGS "-j4") +set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) + +# Build name +string(SUBSTRING $ENV{GITHUB_SHA} 0 7 commit) +set(what "#$ENV{GITHUB_HEAD_REF}") +if("$ENV{GITHUB_HEAD_REF}" STREQUAL "") + set(what "$ENV{GITHUB_REF_NAME}") +endif() +set(CTEST_BUILD_NAME "${PY_VERSION}_x64-${what}_${commit}") + +set(dashboard_binary_name build) +set(dashboard_model Experimental) +set(dashboard_track GitHub-Actions) + +set(dashboard_cache "BUILD_LIBPYTHON_SHARED:BOOL=ON +PYTHON_VERSION:STRING=${PY_VERSION} +") + +# Include driver script +include(${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) + From c495cc7f324e1f114acfe1d43f22ca170e30d9a9 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 7 Jan 2022 20:08:46 -0500 Subject: [PATCH 37/64] github_actions_dashboard: Add support for reading "initial-dashboard-cache.txt" --- .github/dashboard/.gitignore | 1 + .github/dashboard/github_actions_dashboard.cmake | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .github/dashboard/.gitignore diff --git a/.github/dashboard/.gitignore b/.github/dashboard/.gitignore new file mode 100644 index 000000000..e8eeb5120 --- /dev/null +++ b/.github/dashboard/.gitignore @@ -0,0 +1 @@ +initial-dashboard-cache.txt diff --git a/.github/dashboard/github_actions_dashboard.cmake b/.github/dashboard/github_actions_dashboard.cmake index 2a1b28ef0..2e8a0aa33 100644 --- a/.github/dashboard/github_actions_dashboard.cmake +++ b/.github/dashboard/github_actions_dashboard.cmake @@ -41,7 +41,20 @@ set(dashboard_binary_name build) set(dashboard_model Experimental) set(dashboard_track GitHub-Actions) -set(dashboard_cache "BUILD_LIBPYTHON_SHARED:BOOL=ON +# Reading initial dashboard cache +set(_dashboard_cache_path "${CTEST_SCRIPT_DIRECTORY}/initial-dashboard-cache.txt") +set(_msg "Looking for ${_dashboard_cache_path}") +message(STATUS "${_msg}") +if(EXISTS "${_dashboard_cache_path}") + message(STATUS "${_msg} - found") + file(READ "${_dashboard_cache_path}" dashboard_cache) +else() + message(STATUS "${_msg} - not found") + set(dashboard_cache "") +endif() + +set(dashboard_cache "${dashboard_cache} +BUILD_LIBPYTHON_SHARED:BOOL=ON PYTHON_VERSION:STRING=${PY_VERSION} ") From 26b86887eb7736fd6eb6da67ff2c31c76c058f22 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 30 May 2025 23:32:24 -0400 Subject: [PATCH 38/64] chore: remove obsolete appveyor script Follow-up of 6391889 ("cmake: Remove support for building CPython 2.7", 2025-04-28) in which `appveyor.yml` was removed. --- .github/dashboard/appveyor_dashboard.cmake | 68 ---------------------- 1 file changed, 68 deletions(-) delete mode 100644 .github/dashboard/appveyor_dashboard.cmake diff --git a/.github/dashboard/appveyor_dashboard.cmake b/.github/dashboard/appveyor_dashboard.cmake deleted file mode 100644 index 592022029..000000000 --- a/.github/dashboard/appveyor_dashboard.cmake +++ /dev/null @@ -1,68 +0,0 @@ -# Client maintainer: jchris.fillionr@kitware.com - -# Sanity checks -foreach(name IN ITEMS - CONFIGURATION - GENERATOR - PLATFORM - PY_VERSION - ) - if("$ENV{${name}}" STREQUAL "") - message(FATAL_ERROR "Environment variable '${name}' is not set") - endif() -endforeach() - -# Extract major/minor/patch python versions -set(PY_VERSION $ENV{PY_VERSION}) -string(REGEX MATCH "([0-9])\\.([0-9]+)\\.([0-9]+)" _match ${PY_VERSION}) -if(_match STREQUAL "") - message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") -endif() - -set(CTEST_SITE "appveyor") -set(CTEST_DASHBOARD_ROOT $ENV{APPVEYOR_BUILD_FOLDER}/..) - -set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) -set(CTEST_CMAKE_GENERATOR "$ENV{GENERATOR}") -set(CTEST_CMAKE_GENERATOR_PLATFORM $ENV{PLATFORM}) - -set(CTEST_BUILD_FLAGS "") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) - -# Build name -string(SUBSTRING $ENV{APPVEYOR_REPO_COMMIT} 0 7 commit) -set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}") -if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "") - set(what "$ENV{APPVEYOR_REPO_BRANCH}") -endif() -set(CTEST_BUILD_NAME "${PY_VERSION}-VS-${CTEST_CMAKE_GENERATOR_PLATFORM}-${CTEST_CONFIGURATION_TYPE}_${what}_${commit}") - -set(dashboard_binary_name "python-cmake-buildsystem/build") -set(dashboard_model Experimental) -set(dashboard_track AppVeyor-CI) - -set(dashboard_cache "BUILD_LIBPYTHON_SHARED:BOOL=ON -PYTHON_VERSION:STRING=${PY_VERSION} -") - -function(downloadFile url dest) - file(DOWNLOAD ${url} ${dest} STATUS status) - list(GET status 0 error_code) - list(GET status 1 error_msg) - if(error_code) - message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}") - endif() -endfunction() - -# Download and include driver script -set(url https://raw.githubusercontent.com/python-cmake-buildsystem/python-cmake-buildsystem/dashboard/python_common.cmake) -set(dest ${CTEST_SCRIPT_DIRECTORY}/python_common.cmake) -downloadfile(${url} ${dest}) -include(${dest}) - -# Upload link to CDash -#set(url "${CTEST_DASHBOARD_ROOT}/python-cmake-buildsystem/scratch/appveyor.url") -#file(WRITE ${url} "https://ci.appveyor.com/project/$ENV{APPVEYOR_REPO_NAME}/build/$ENV{APPVEYOR_BUILD_VERSION}") -#ctest_upload(FILES ${url}) -#ctest_submit(PARTS Upload) -#file(REMOVE ${url}) From a4d060f9cb95455bc46eade6e17e3c8fcc9b4d14 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 01:20:36 -0400 Subject: [PATCH 39/64] docs(python_common): Improve comments Adapted from: * https://gitlab.kitware.com/cmake/dashboard-scripts/-/blob/79d271a96607c9edb99dd875a50484bcc5caa4f3/cmake_common.cmake * https://github.com/Kitware/TeleSculptor/blob/32378009fe1499811812f1f1be23d30d43369a0a/CMake/dashboard-scripts/TeleSculptor_common.cmake#L60 --- .github/dashboard/python_common.cmake | 30 +++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 66b577487..490a77bb1 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -27,13 +27,15 @@ # dashboard_model = Nightly | Experimental | Continuous # dashboard_track = Optional track to submit dashboard to # dashboard_disable_loop = For continuous dashboards, disable loop. -# dashboard_root_name = Change name of "MyTests" directory -# dashboard_source_name = Name of source directory (python-cmake-buildsystem) -# dashboard_binary_name = Name of binary directory (python-cmake-buildsystem-build) +# dashboard_root_name = Change name of "MyTests" directory. This is +# ignored if CTEST_DASHBOARD_ROOT is set. +# dashboard_source_name = Name of source directory (default: python-cmake-buildsystem) +# dashboard_binary_name = Name of binary directory (default: python-cmake-buildsystem-build) # dashboard_cache = Initial CMakeCache.txt file content # dashboard_do_coverage = True to enable coverage (ex: gcov) # dashboard_do_memcheck = True to enable memcheck (ex: valgrind) -# CTEST_GIT_COMMAND = path to git command-line client +# CTEST_CHECKOUT_COMMAND = Custom source tree checkout comamnd (primarilly +# for if the VCS is not git). # CTEST_BUILD_FLAGS = build tool arguments (ex: -j2) # CTEST_DASHBOARD_ROOT = Where to put source and build trees # CTEST_TEST_CTEST = Whether to run long CTestTest* tests @@ -41,11 +43,22 @@ # CTEST_TEST_ARGS = ctest_test args (ex: PARALLEL_LEVEL 4) # CMAKE_MAKE_PROGRAM = Path to "make" tool to use # -# Options to configure builds from experimental git repository: +# Options to configure Git: +# CTEST_GIT_COMMAND = Path to the git command-line client. # dashboard_git_url = Custom git clone url # dashboard_git_branch = Custom remote branch to track # dashboard_git_crlf = Value of core.autocrlf for repository # +# The following macros will be invoked before the corresponding step if they +# are defined: +# +# dashboard_hook_init = End of initialization, before loop +# dashboard_hook_start = Start of loop body, before ctest_start +# dashboard_hook_started = Start of loop body, after ctest_start +# dashboard_hook_build = Before ctest_build +# dashboard_hook_test = Before ctest_test +# dashboard_hook_end = End of body loop, after ctest_submit. +# # For Makefile generators the script may be executed from an # environment already configured to use the desired compilers. # Alternatively the environment may be set at the top of the script: @@ -70,10 +83,9 @@ # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # -# * Neither the names of Kitware, Inc., the Insight Software Consortium, -# nor the names of their contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. +# * Neither the name of Kitware, Inc. nor the names of its contributors +# may be used to endorse or promote products derived from this +# software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT From d4f26b0f3859191065aba8518d3817d1349a177c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 01:31:23 -0400 Subject: [PATCH 40/64] python_common: Enable launchers and make program for Ninja generator Adapted from cmake/dashboard-scripts@aa51648 ("cmake_common: Enable launchers and make program for Ninja generator", 2014-05-20) See https://gitlab.kitware.com/cmake/dashboard-scripts/-/commit/aa51648 --- .github/dashboard/python_common.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 490a77bb1..b45403443 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -134,8 +134,8 @@ endif() if(dashboard_bootstrap) # Launchers do not work during bootstrap: no ctest available. set(CTEST_USE_LAUNCHERS 0) -elseif(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make") - # Launchers work only with Makefile generators. +elseif(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make|Ninja") + # Launchers work only with Makefile and Ninja generators. set(CTEST_USE_LAUNCHERS 0) elseif(NOT DEFINED CTEST_USE_LAUNCHERS) # The setting is ignored by CTest < 2.8 so we need no version test. @@ -295,7 +295,7 @@ set(ENV{LC_ALL} C) macro(write_cache) set(cache_build_type "") set(cache_make_program "") - if(CTEST_CMAKE_GENERATOR MATCHES "Make") + if(CTEST_CMAKE_GENERATOR MATCHES "Make|Ninja") set(cache_build_type CMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}) if(CMAKE_MAKE_PROGRAM) set(cache_make_program CMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}) From ada85c561b9afff8fd7f6128790ef4c23caeecb8 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 01:44:00 -0400 Subject: [PATCH 41/64] python_common: Restore HOME after each run Adapted from cmake/dashboard-scripts@353a27e ("cmake_common: Restore HOME after each run", 2022-08-05) See https://gitlab.kitware.com/cmake/dashboard-scripts/-/commit/353a27e --- .github/dashboard/python_common.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index b45403443..11103f7bd 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -344,7 +344,6 @@ while(NOT dashboard_done) if(dashboard_continuous) set(START_TIME ${CTEST_ELAPSED_TIME}) endif() - set(ENV{HOME} "${dashboard_user_home}") # Start a new submission. if(COMMAND dashboard_hook_start) @@ -474,5 +473,7 @@ while(NOT dashboard_done) # Not continuous, so we are done. set(dashboard_done 1) endif() + + set(ENV{HOME} "${dashboard_user_home}") endwhile() From 22567a79c11adee301593763886aa231c510dc47 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 02:00:49 -0400 Subject: [PATCH 42/64] python_common: Remove obsolete support for CMake < 3.1.0 Since minimum required CMake version was updated in fbc3a81 ("Update minimum required CMake version from 2.8.6 to 3.13.5", 2022-01-03), this commit partially reverts 7e11eb9 ("Ensure Experimental build do not reset the local repo when using CMake < 3.1.0", 2015-09-03) --- .github/dashboard/python_common.cmake | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 11103f7bd..13615cc89 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -367,14 +367,7 @@ while(NOT dashboard_done) endif() # Look for updates. - set(count 0) - set(_skip_ctest_update 0) # XXX Required for CMake < 3.1.0 - if(CMAKE_VERSION VERSION_LESS "3.1.0" AND CTEST_UPDATE_VERSION_ONLY) - set(_skip_ctest_update 1) - endif() - if(NOT _skip_ctest_update) - ctest_update(RETURN_VALUE count) - endif() + ctest_update(RETURN_VALUE count) set(CTEST_CHECKOUT_COMMAND) # checkout on first iteration only safe_message("Found ${count} changed files") From 3301f6e1dcbd79a00b953d96d587d4da4c4626be Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 02:02:43 -0400 Subject: [PATCH 43/64] python_common: Update before initializing build tree Adapted from cmake/dashboard-scripts@d5bd988 ("cmake_common: Update before initializing build tree", 2025-02-16) See https://gitlab.kitware.com/cmake/dashboard-scripts/-/commit/d5bd988 --- .github/dashboard/python_common.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 13615cc89..c67927660 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -358,6 +358,11 @@ while(NOT dashboard_done) dashboard_hook_started() endif() + # Look for updates. + ctest_update(RETURN_VALUE count) + set(CTEST_CHECKOUT_COMMAND) # checkout on first iteration only + safe_message("Found ${count} changed files") + # Always build if the tree is fresh. set(dashboard_fresh 0) if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt") @@ -366,11 +371,6 @@ while(NOT dashboard_done) write_cache() endif() - # Look for updates. - ctest_update(RETURN_VALUE count) - set(CTEST_CHECKOUT_COMMAND) # checkout on first iteration only - safe_message("Found ${count} changed files") - # Additional CMake configure options can be specified in a commit message # using one or multiple line of the form "[cmake ;;...]". # From 6124794f1aee599a9de1faf8110d193df74cc62d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 09:53:08 -0400 Subject: [PATCH 44/64] python_common: Add support for disabling testing introducing "dashboard_no_test" --- .github/dashboard/python_common.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index c67927660..e82fd3f1c 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -32,6 +32,7 @@ # dashboard_source_name = Name of source directory (default: python-cmake-buildsystem) # dashboard_binary_name = Name of binary directory (default: python-cmake-buildsystem-build) # dashboard_cache = Initial CMakeCache.txt file content +# dashboard_no_test = True to disable tests # dashboard_do_coverage = True to enable coverage (ex: gcov) # dashboard_do_memcheck = True to enable memcheck (ex: valgrind) # CTEST_CHECKOUT_COMMAND = Custom source tree checkout comamnd (primarilly @@ -432,8 +433,10 @@ while(NOT dashboard_done) if(COMMAND dashboard_hook_test) dashboard_hook_test() endif() - ctest_test(${CTEST_TEST_ARGS} APPEND) - ctest_submit(PARTS Test) + if(NOT dashboard_no_test) + ctest_test(${CTEST_TEST_ARGS} APPEND) + ctest_submit(PARTS Test) + endif() set(safe_message_skip 1) # Block further messages if(dashboard_do_coverage) From 7291bfa12aa094903af8d5573135f043904993d5 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 09:56:19 -0400 Subject: [PATCH 45/64] python_common: Remove use of APPEND and submit each report independently --- .github/dashboard/python_common.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index e82fd3f1c..0a7284756 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -427,14 +427,14 @@ while(NOT dashboard_done) if(COMMAND dashboard_hook_build) dashboard_hook_build() endif() - ctest_build(APPEND) + ctest_build() ctest_submit(PARTS Build) if(COMMAND dashboard_hook_test) dashboard_hook_test() endif() if(NOT dashboard_no_test) - ctest_test(${CTEST_TEST_ARGS} APPEND) + ctest_test(${CTEST_TEST_ARGS}) ctest_submit(PARTS Test) endif() set(safe_message_skip 1) # Block further messages From 53e5ce92f0882671b219584a18959bd56a61e53a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 16:04:29 -0400 Subject: [PATCH 46/64] python_common: Report progress early by submitting each part independently --- .github/dashboard/python_common.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 0a7284756..603c7a246 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -364,6 +364,8 @@ while(NOT dashboard_done) set(CTEST_CHECKOUT_COMMAND) # checkout on first iteration only safe_message("Found ${count} changed files") + ctest_submit(PARTS Update) + # Always build if the tree is fresh. set(dashboard_fresh 0) if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt") @@ -421,9 +423,12 @@ while(NOT dashboard_done) ctest_configure() endif() - ctest_submit(PARTS Update Configure Notes) + ctest_submit(PARTS Configure) ctest_read_custom_files(${CTEST_BINARY_DIRECTORY}) + # Submit files associated with the CTEST_NOTES_FILES variables + ctest_submit(PARTS Notes) + if(COMMAND dashboard_hook_build) dashboard_hook_build() endif() From a53403189aa2f6ebd524c058b242f063c3514431 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 16:55:35 -0400 Subject: [PATCH 47/64] python_common: Normalize CTEST_SITE to prevent CDash row splitting CDash misinterprets colons (:) in the `CTEST_SITE` string, causing the "Update" and "Configure/Build/Test" steps to appear as separate rows in the dashboard. This patch replaces colons with underscores as a workaround to ensure all submission parts are grouped correctly. Related issue: https://github.com/Kitware/CDash/issues/2905 --- .github/dashboard/python_common.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 603c7a246..a087b03b3 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -267,6 +267,12 @@ foreach(req endif() endforeach(req) +# Workaround for a CDash issue where colons (:) in CTEST_SITE cause Update and +# Configure/Build/Test submissions to appear as separate rows. Replace colons +# with underscores to ensure all parts are grouped under a single entry. +# See: https://github.com/Kitware/CDash/issues/2905 +string(REPLACE ":" "_" CTEST_SITE "${CTEST_SITE}") + # Print summary information. set(vars "") foreach(v From e5d55307d77efca4b19944e2949c04f56f7d8935 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 17:16:36 -0400 Subject: [PATCH 48/64] python_common: Fix use of ctest_empty_binary_directory Make the build directory after using ctest_empty_binary_directory because the command reports an error if asked to delete a directory that exists but does not contain `CMakeCache.txt`. Adapted from cmake/dashboard-scripts@cb56d71 ("cmake_common: Fix use of ctest_empty_binary_directory", 2016-01-21) See https://gitlab.kitware.com/cmake/dashboard-scripts/-/commit/cb56d71 --- .github/dashboard/python_common.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index a087b03b3..1283584b5 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -320,7 +320,8 @@ ${dashboard_cache} endmacro(write_cache) # Start with a fresh build tree. -if(NOT "${CTEST_SOURCE_DIRECTORY}" STREQUAL "${CTEST_BINARY_DIRECTORY}") +if(EXISTS "${CTEST_BINARY_DIRECTORY}" AND + NOT "${CTEST_SOURCE_DIRECTORY}" STREQUAL "${CTEST_BINARY_DIRECTORY}") message("Clearing build tree...") ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) endif() From c6f023533946820c7d98dd52e57deb589b80ff00 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 17:17:40 -0400 Subject: [PATCH 49/64] python_common: Remove obsolete dashboard_hook_submit Since the submission is done by part, this hook is irrelevant. --- .github/dashboard/python_common.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 1283584b5..96978550b 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -461,10 +461,6 @@ while(NOT dashboard_done) ctest_submit(PARTS MemCheck) endif() - if(COMMAND dashboard_hook_submit) - dashboard_hook_submit() - endif() - if(COMMAND dashboard_hook_end) dashboard_hook_end() endif() From 94ba6e66ec69a3b42fa82bb8613c19e099db39a6 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 31 May 2025 17:20:17 -0400 Subject: [PATCH 50/64] python_common: Store GIT_EXECUTABLE in CMake cache Adapted from cmake/dashboard-scripts@0272ca4 ("Store GIT_EXECUTABLE in CMake cache", 2010-06-15) See https://gitlab.kitware.com/cmake/dashboard-scripts/-/commit/0272ca4 --- .github/dashboard/python_common.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dashboard/python_common.cmake b/.github/dashboard/python_common.cmake index 96978550b..27203df25 100644 --- a/.github/dashboard/python_common.cmake +++ b/.github/dashboard/python_common.cmake @@ -313,6 +313,7 @@ SITE:STRING=${CTEST_SITE} BUILDNAME:STRING=${CTEST_BUILD_NAME} CTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS} DART_TESTING_TIMEOUT:STRING=${CTEST_TEST_TIMEOUT} +GIT_EXECUTABLE:FILEPATH=${CTEST_GIT_COMMAND} ${cache_build_type} ${cache_make_program} ${dashboard_cache} From ec5fb7dab05b2f754ae9a4031c08f6b949abb1da Mon Sep 17 00:00:00 2001 From: O01eg Date: Fri, 30 Jan 2026 07:46:31 +0400 Subject: [PATCH 51/64] Fix and test Android build --- .github/workflows/CI.yml | 71 ++++++++++++++++++++++++++++++++++++ .github/workflows/adb-emu.sh | 9 +++++ 2 files changed, 80 insertions(+) create mode 100755 .github/workflows/adb-emu.sh diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 552b404f7..9a390a3e8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -60,10 +60,81 @@ jobs: CC: ${{ matrix.c-compiler }} CXX: ${{ matrix.cxx-compiler }} + tests-android: + runs-on: ${{ matrix.host }} + strategy: + matrix: + ndk-arch: [x86_64] + arch: [x86_64] + api-level: [21] + target: [default] + host: [ubuntu-24.04] + python-version: [3.11.12] + include: + - ndk-arch: arm64-v8a + arch: x86_64 + api-level: 30 + target: google_apis + host: ubuntu-24.04 + python-version: 3.11.12 + - ndk-arch: x86 + arch: x86 + api-level: 21 + target: default + host: ubuntu-24.04 + python-version: 3.11.12 + - ndk-arch: armeabi-v7a + arch: x86_64 + api-level: 30 + target: google_apis + host: ubuntu-24.04 + python-version: 3.11.12 + name: python-android-${{ matrix.python-version }}-${{ matrix.host }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + path: src + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + - name: Make build and prefix directories + run: | + mkdir build + mkdir install-prefix + - name: run action + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + target: ${{ matrix.target }} + arch: ${{ matrix.arch }} + profile: Galaxy Nexus + cores: 2 + ram-size: 2048M + sdcard-path-or-size: 100M + emulator-build: 7425822 # https://github.com/ReactiveCircus/android-emulator-runner/issues/160 + avd-name: test + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + working-directory: build/ + ndk: 23.0.7421159 + cmake: 3.10.2.4988404 + channel: beta + script: | + adb devices + cmake -DANDROID_NDK=/usr/local/lib/android/sdk/ndk/23.0.7421159/ -DCMAKE_INSTALL_PREFIX:PATH=../install-prefix -DCMAKE_TOOLCHAIN_FILE=/usr/local/lib/android/sdk/ndk/23.0.7421159/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.ndk-arch }} -DCMAKE_CROSSCOMPILING_EMULATOR=$(pwd)/../src/.github/workflows/adb-emu.sh -DANDROID_ALLOW_UNDEFINED_SYMBOLS=On -DENABLE_DECIMAL=Off -DENABLE_CTYPES=Off -DENABLE_CODECS_JP=OFF -DENABLE_CODECS_KR=OFF -DENABLE_CODECS_TW=OFF -DENABLE_MULTIBYTECODEC=OFF -DENABLE_CODECS_CN=OFF -DENABLE_CODECS_HK=OFF -DENABLE_CODECS_ISO2022=OFF -DBUILD_EXTENSIONS_AS_BUILTIN=On -DANDROID_PLATFORM=android-21 -DPYTHON_VERSION=${{ matrix.python-version }} $(pwd)/../src/ + cmake --build . -- VERBOSE=1 + cmake --build . --target install + + pass: # This job does nothing and is only used for the branch protection if: always() needs: - tests + - tests-android runs-on: ubuntu-latest diff --git a/.github/workflows/adb-emu.sh b/.github/workflows/adb-emu.sh new file mode 100755 index 000000000..d5e849f97 --- /dev/null +++ b/.github/workflows/adb-emu.sh @@ -0,0 +1,9 @@ +#!/bin/sh +adb push "$1" /data/local/tmp/ 1>/dev/null 2>/dev/null +if [ $# -eq 1 ]; then + adb shell /data/local/tmp/$(basename $1) +elif [ $# -eq 3 ]; then + adb push "$2" /data/local/tmp/ 1>/dev/null 2>/dev/null + adb shell /data/local/tmp/$(basename $1) /data/local/tmp/$(basename $2) /data/local/tmp/$(basename $3) + adb pull /data/local/tmp/$(basename $3) "$3" 1>/dev/null 2>/dev/null +fi From 79a8d4a488f4b86d5ceb43d5b0ff7def201250c2 Mon Sep 17 00:00:00 2001 From: O01eg Date: Fri, 30 Jan 2026 08:02:45 +0400 Subject: [PATCH 52/64] Make it buildable --- cmake/ConfigureChecks.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 5ed2c5b7a..542dbf543 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -356,7 +356,11 @@ check_include_files(grp.h HAVE_GRP_H) check_include_files(ieeefp.h HAVE_IEEEFP_H) check_include_files(inttypes.h HAVE_INTTYPES_H) # libffi and cpython check_include_files(io.h HAVE_IO_H) -check_include_files(langinfo.h HAVE_LANGINFO_H) +if (ANDROID) + set(HAVE_LANGINFO_H 0) # Android cann't link functions from langinfo.h +else() + check_include_files(langinfo.h HAVE_LANGINFO_H) +endif() check_include_files(libintl.h HAVE_LIBINTL_H) check_include_files(libutil.h HAVE_LIBUTIL_H) check_include_files(linux/tipc.h HAVE_LINUX_TIPC_H) @@ -532,7 +536,7 @@ find_library(HAVE_LIBTERMCAP termcap) set(LIBUTIL_LIBRARIES ) set(LIBUTIL_EXPECTED 1) -if(CMAKE_SYSTEM MATCHES "VxWorks\\-7$") +if(ANDROID OR CMAKE_SYSTEM MATCHES "VxWorks\\-7$") set(LIBUTIL_EXPECTED 0) set(HAVE_LIBUTIL 0) endif() From 6c61e9b85f46d59187a71c1a345f8ca3f9614623 Mon Sep 17 00:00:00 2001 From: O01eg Date: Fri, 30 Jan 2026 08:16:44 +0400 Subject: [PATCH 53/64] Use working Python 3.10 --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9a390a3e8..e9461d6d4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -69,26 +69,26 @@ jobs: api-level: [21] target: [default] host: [ubuntu-24.04] - python-version: [3.11.12] + python-version: [3.10.17] include: - ndk-arch: arm64-v8a arch: x86_64 api-level: 30 target: google_apis host: ubuntu-24.04 - python-version: 3.11.12 + python-version: 3.10.17 - ndk-arch: x86 arch: x86 api-level: 21 target: default host: ubuntu-24.04 - python-version: 3.11.12 + python-version: 3.10.17 - ndk-arch: armeabi-v7a arch: x86_64 api-level: 30 target: google_apis host: ubuntu-24.04 - python-version: 3.11.12 + python-version: 3.10.17 name: python-android-${{ matrix.python-version }}-${{ matrix.host }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 From fbdcfd129ce072eca5246e7a9dc8cd80a5df10d4 Mon Sep 17 00:00:00 2001 From: Victor Paleologue Date: Fri, 17 Apr 2020 18:20:40 +0200 Subject: [PATCH 54/64] Fix floating point endianness checks Translated to CMake from a patch on the Yocto project: http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3/0002-Don-t-do-runtime-test-to-get-float-byte-order.patch?h=zeus It avoids the execution of a program on the target device, and produces a clearer endianness result. --- cmake/ConfigureChecks.cmake | 80 ++++++++++++++----------------------- 1 file changed, 29 insertions(+), 51 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 542dbf543..ecde8b91d 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -1302,60 +1302,38 @@ python_platform_test( # Check for various properties of floating point # ####################################################################### - -# Check whether C doubles are little-endian IEEE 754 binary64 -set(check_src ${PROJECT_BINARY_DIR}/CMakeFiles/ac_cv_little_endian_double.c) -file(WRITE ${check_src} "#include -int main() { - double x = 9006104071832581.0; - if (memcmp(&x, \"\\x05\\x04\\x03\\x02\\x01\\xff\\x3f\\x43\", 8) == 0) - return 0; - else - return 1; -} -") -python_platform_test_run( - DOUBLE_IS_LITTLE_ENDIAN_IEEE754 - "Checking whether C doubles are little-endian IEEE 754 binary64" - ${check_src} - DIRECT - ) - -# Check whether C doubles are big-endian IEEE 754 binary64 set(check_src ${PROJECT_BINARY_DIR}/CMakeFiles/ac_cv_big_endian_double.c) -file(WRITE ${check_src} "#include -int main() { - double x = 9006104071832581.0; - if (memcmp(&x, \"\\x43\\x3f\\xff\\x01\\x02\\x03\\x04\\x05\", 8) == 0) - return 0; - else - return 1; -} +file(WRITE ${check_src} " +double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0; ") -python_platform_test_run( - DOUBLE_IS_BIG_ENDIAN_IEEE754 - "Checking whether C doubles are big-endian IEEE 754 binary64" - ${check_src} - DIRECT - ) -# Check whether C doubles are ARM mixed-endian IEEE 754 binary64 -set(check_src ${PROJECT_BINARY_DIR}/CMakeFiles/ac_cv_mixed_endian_double.c) -file(WRITE ${check_src} "#include -int main() { - double x = 9006104071832581.0; - if (memcmp(&x, \"\\x01\\xff\\x3f\\x43\\x05\\x04\\x03\\x02\", 8) == 0) - return 0; - else - return 1; -} -") -python_platform_test_run( - DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 - "Checking doubles are ARM mixed-endian IEEE 754 binary64" - ${check_src} - DIRECT - ) +# TODO: factorize this try_compile statement +try_compile(DOUBLE_BIG_ENDIAN_TEST_COMPILED + ${CMAKE_CURRENT_BINARY_DIR} + ${check_src} + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}" + "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" + COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/double_big_endian.bin) + +if(DOUBLE_BIG_ENDIAN_TEST_COMPILED) + file(READ ${CMAKE_CURRENT_BINARY_DIR}/double_big_endian.bin DOUBLE_BIG_ENDIAN_DATA) + string(FIND ${DOUBLE_BIG_ENDIAN_DATA} "noonsees" NOONSEES) + if(NOONSEES) + set(DOUBLE_IS_BIG_ENDIAN_IEEE754 1) + set(DOUBLE_IS_LITTLE_ENDIAN_IEEE754 0) + else() + string(FIND ${DOUBLE_BIG_ENDIAN_DATA} "seesnoon" SEESNOON) + if(SEESNOON) + set(DOUBLE_IS_BIG_ENDIAN_IEEE754 0) + set(DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1) + else() + message(WARNING "Could not determine if double precision floats endianness") + endif() + endif() +endif() # The short float repr introduced in Python 3.1 requires the # correctly-rounded string <-> double conversion functions from From 392b46bb6adcfc219145fa2245a66f9eac0ddc26 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sat, 31 Jan 2026 01:13:50 +0400 Subject: [PATCH 55/64] Don't build fcntl and grp extensions for Android --- cmake/extensions/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 10750ccce..4005dead5 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -417,9 +417,11 @@ add_python_extension(_xxsubinterpreters ${WIN32_BUILTIN} _xxsubinterpretersmodule.c ) -# UNIX-only extensions -add_python_extension(fcntl REQUIRES UNIX SOURCES fcntlmodule.c) -add_python_extension(grp REQUIRES UNIX SOURCES grpmodule.c) +if(NOT ANDROID) + # UNIX-only extensions + add_python_extension(fcntl REQUIRES UNIX SOURCES fcntlmodule.c) + add_python_extension(grp REQUIRES UNIX SOURCES grpmodule.c) +endif() set(nis_REQUIRES UNIX HAVE_LIBNSL) set(nis_LIBRARIES ${HAVE_LIBNSL}) From b3ecef464b35972f3cf6037f5ec70ec023dd1994 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sat, 31 Jan 2026 01:16:38 +0400 Subject: [PATCH 56/64] Don't generate sysconfigdata for Android --- cmake/python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/python/CMakeLists.txt b/cmake/python/CMakeLists.txt index cfbe1a11d..60cda177a 100644 --- a/cmake/python/CMakeLists.txt +++ b/cmake/python/CMakeLists.txt @@ -47,7 +47,7 @@ if(WIN32) ) endif() -if(UNIX) +if(UNIX AND NOT ANDROID) # Setup landmark allowing to run the interpreter from a build tree. See 'getpath.c' for details. set(_sysconfigdata_py "_sysconfigdata.py") if("${PY_VERSION}" VERSION_GREATER_EQUAL "3.6.0") From 651dba6dbc26fe5d4658b6ce8f2bef20493079d6 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sat, 31 Jan 2026 01:19:02 +0400 Subject: [PATCH 57/64] Add platform triplets for Android --- cmake/platform.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmake/platform.c b/cmake/platform.c index 4c8278967..7530a33e3 100644 --- a/cmake/platform.c +++ b/cmake/platform.c @@ -18,16 +18,28 @@ char *PLATFORM_TRIPLET = #if defined(__linux__) # if defined(__x86_64__) && defined(__LP64__) +# if defined(__ANDROID_NDK__) + "x86_64-linux-android" +# else "x86_64-linux-gnu" +# endif # elif defined(__x86_64__) && defined(__ILP32__) "x86_64-linux-gnux32" # elif defined(__i386__) +# if defined(__ANDROID_NDK__) + "i686-linux-android" +# else "i386-linux-gnu" +# endif # elif defined(__aarch64__) && defined(__AARCH64EL__) # if defined(__ILP32__) "aarch64_ilp32-linux-gnu" # else +# if defined(__ANDROID_NDK__) + "aarch64-linux-android" +# else "aarch64-linux-gnu" +# endif # endif # elif defined(__aarch64__) && defined(__AARCH64EB__) # if defined(__ILP32__) @@ -45,7 +57,11 @@ char *PLATFORM_TRIPLET = # endif # elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP) # if defined(__ARMEL__) +# if defined(__ANDROID_NDK__) + "arm-linux-androideabi" +# else "arm-linux-gnueabi" +# endif # else "armeb-linux-gnueabi" # endif From 4a8b9d1e9ce1827b010a5148e94a868981eb73da Mon Sep 17 00:00:00 2001 From: O01eg <397177+o01eg@users.noreply.github.com> Date: Wed, 18 Feb 2026 15:51:29 +0400 Subject: [PATCH 58/64] Some more Android fixes --- CMakeLists.txt | 2 +- cmake/Extensions.cmake | 2 +- cmake/extensions/CMakeLists.txt | 1 + cmake/lib/CMakeLists.txt | 34 +++++++++++++++++---------------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 730e0fa21..8ada2539e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -799,7 +799,7 @@ if(UNIX) # Makefile set(MAKEFILE_LDSHARED_FLAGS "-shared") - if(APPLE) + if(APPLE OR ANDROID) set(MAKEFILE_LDSHARED_FLAGS "-dynamiclib -headerpad_max_install_names -undefined dynamic_lookup") endif() configure_file(cmake/makefile-variables.in diff --git a/cmake/Extensions.cmake b/cmake/Extensions.cmake index 45b63f236..c0edc2468 100644 --- a/cmake/Extensions.cmake +++ b/cmake/Extensions.cmake @@ -196,7 +196,7 @@ function(add_python_extension name) ) endif() - if(APPLE) + if(APPLE OR ANDROID) set_target_properties(${target_name} PROPERTIES LINK_FLAGS -Wl,-undefined,dynamic_lookup SUFFIX .so diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 4005dead5..1cd1f6e70 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -836,6 +836,7 @@ elseif(${CMAKE_SIZEOF_VOID_P} EQUAL 4) if(HAVE_GCC_ASM_FOR_X87 AND (CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") AND NOT CMAKE_SYSTEM MATCHES SunOS + AND NOT ANDROID ) # solaris: problems with register allocation. # icc >= 11.0 works as well. diff --git a/cmake/lib/CMakeLists.txt b/cmake/lib/CMakeLists.txt index ac97ab4b3..5f62ecab3 100644 --- a/cmake/lib/CMakeLists.txt +++ b/cmake/lib/CMakeLists.txt @@ -37,20 +37,22 @@ endforeach() # Generate grammar tables in install directory # XXX Should a custom target be added to generate file at built time ? -install(CODE "find_program( - PYTHON_EXECUTABLE python - HINTS \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR} - NO_DEFAULT_PATH) -set(wrapper) -if(UNIX) - set(_envvar LD_LIBRARY_PATH) - if(APPLE) - set(_envvar DYLD_LIBRARY_PATH) - endif() - set(wrapper env \${_envvar}=\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${LIBPYTHON_LIBDIR}) +if(NOT ANDROID) + install(CODE "find_program( + PYTHON_EXECUTABLE python + HINTS \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR} + NO_DEFAULT_PATH) + set(wrapper) + if(UNIX) + set(_envvar LD_LIBRARY_PATH) + if(APPLE) + set(_envvar DYLD_LIBRARY_PATH) + endif() + set(wrapper env \${_envvar}=\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${LIBPYTHON_LIBDIR}) + endif() + execute_process(COMMAND \${wrapper} \${PYTHON_EXECUTABLE} -m lib2to3.pgen2.driver + \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${PYTHONHOME}/lib2to3/Grammar.txt) + execute_process(COMMAND \${wrapper} \${PYTHON_EXECUTABLE} -m lib2to3.pgen2.driver + \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${PYTHONHOME}/lib2to3/PatternGrammar.txt) + ") endif() -execute_process(COMMAND \${wrapper} \${PYTHON_EXECUTABLE} -m lib2to3.pgen2.driver - \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${PYTHONHOME}/lib2to3/Grammar.txt) -execute_process(COMMAND \${wrapper} \${PYTHON_EXECUTABLE} -m lib2to3.pgen2.driver - \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${PYTHONHOME}/lib2to3/PatternGrammar.txt) -") From cc787b00464f55b055f72b92adf6433cd06ea4d1 Mon Sep 17 00:00:00 2001 From: O01eg <397177+o01eg@users.noreply.github.com> Date: Wed, 18 Feb 2026 16:30:33 +0400 Subject: [PATCH 59/64] Reorganize CI for Android --- .github/workflows/CI.yml | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e9461d6d4..79aecb96c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -64,32 +64,10 @@ jobs: runs-on: ${{ matrix.host }} strategy: matrix: - ndk-arch: [x86_64] - arch: [x86_64] - api-level: [21] - target: [default] + ndk-arch: [x86_64, arm64-v8a, x86, armeabi-v7a] host: [ubuntu-24.04] - python-version: [3.10.17] - include: - - ndk-arch: arm64-v8a - arch: x86_64 - api-level: 30 - target: google_apis - host: ubuntu-24.04 - python-version: 3.10.17 - - ndk-arch: x86 - arch: x86 - api-level: 21 - target: default - host: ubuntu-24.04 - python-version: 3.10.17 - - ndk-arch: armeabi-v7a - arch: x86_64 - api-level: 30 - target: google_apis - host: ubuntu-24.04 - python-version: 3.10.17 - name: python-android-${{ matrix.python-version }}-${{ matrix.host }} + python-version: [3.8.20, 3.9.22, 3.10.17] + name: python-android-${{ matrix.ndk-arch }}-${{ matrix.python-version }}-${{ matrix.host }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -107,9 +85,9 @@ jobs: - name: run action uses: reactivecircus/android-emulator-runner@v2 with: - api-level: ${{ matrix.api-level }} - target: ${{ matrix.target }} - arch: ${{ matrix.arch }} + api-level: ${{ startsWith(matrix.ndk-arch, 'x86') && 21 || 30 }} + target: ${{ startsWith(matrix.ndk-arch, 'x86') && 'default' || 'google_apis' }} + arch: ${{ matrix.ndk-arch == 'x86' && 'x86' || 'x86_64' }} profile: Galaxy Nexus cores: 2 ram-size: 2048M From 0ef0e78cce5cb2ecddd058f50ec0cdf78fc52ed8 Mon Sep 17 00:00:00 2001 From: O01eg <397177+o01eg@users.noreply.github.com> Date: Wed, 18 Feb 2026 17:09:33 +0400 Subject: [PATCH 60/64] Don't install old CMake --- .github/workflows/CI.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 79aecb96c..e905b8a41 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -99,7 +99,6 @@ jobs: disable-animations: true working-directory: build/ ndk: 23.0.7421159 - cmake: 3.10.2.4988404 channel: beta script: | adb devices From 19943b8aaa4479bbb90ceac27212e598ed0723b1 Mon Sep 17 00:00:00 2001 From: O01eg <397177+o01eg@users.noreply.github.com> Date: Sun, 3 May 2026 10:22:36 +0400 Subject: [PATCH 61/64] Add Python 3.11.12 to Android CI workflow and fix it --- .github/workflows/CI.yml | 25 +++++++++++++++++++++++-- .github/workflows/adb-emu.sh | 14 +++++++++++--- CMakeLists.txt | 22 ++++++++++++++++++++++ cmake/extensions/CMakeLists.txt | 22 ++++++++++++---------- cmake/libpython/CMakeLists.txt | 4 +++- 5 files changed, 71 insertions(+), 16 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e905b8a41..1275f9938 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -66,7 +66,7 @@ jobs: matrix: ndk-arch: [x86_64, arm64-v8a, x86, armeabi-v7a] host: [ubuntu-24.04] - python-version: [3.8.20, 3.9.22, 3.10.17] + python-version: [3.8.20, 3.9.22, 3.10.17, 3.11.12] name: python-android-${{ matrix.ndk-arch }}-${{ matrix.python-version }}-${{ matrix.host }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -82,6 +82,27 @@ jobs: run: | mkdir build mkdir install-prefix + mkdir bootstrap-build + mkdir bootstrap-install-prefix + - name: Check for bootstrap needed + id: check-bootstrap + shell: cmake -P {0} + run: | + string(REPLACE "." ";" VERSION_LIST "${{ matrix.python-version }}") + list(GET VERSION_LIST 0 PY_VERSION_MAJOR) + list(GET VERSION_LIST 1 PY_VERSION_MINOR) + list(GET VERSION_LIST 2 PY_VERSION_PATCH) + set(PY_VERSION "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.${PY_VERSION_PATCH}") + if(PY_VERSION VERSION_GREATER_EQUAL "3.11") + file(APPEND "$ENV{GITHUB_OUTPUT}" "needed=yes") + endif() + - name: Bootstrap + if: steps.check-bootstrap.outputs.needed == 'yes' + run: | + cd bootstrap-build + cmake -DCMAKE_INSTALL_PREFIX:PATH=../bootstrap-install-prefix -DPYTHON_VERSION=${{ matrix.python-version }} $(pwd)/../src/ + cmake --build . -- VERBOSE=1 + cmake --build . --target install - name: run action uses: reactivecircus/android-emulator-runner@v2 with: @@ -102,7 +123,7 @@ jobs: channel: beta script: | adb devices - cmake -DANDROID_NDK=/usr/local/lib/android/sdk/ndk/23.0.7421159/ -DCMAKE_INSTALL_PREFIX:PATH=../install-prefix -DCMAKE_TOOLCHAIN_FILE=/usr/local/lib/android/sdk/ndk/23.0.7421159/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.ndk-arch }} -DCMAKE_CROSSCOMPILING_EMULATOR=$(pwd)/../src/.github/workflows/adb-emu.sh -DANDROID_ALLOW_UNDEFINED_SYMBOLS=On -DENABLE_DECIMAL=Off -DENABLE_CTYPES=Off -DENABLE_CODECS_JP=OFF -DENABLE_CODECS_KR=OFF -DENABLE_CODECS_TW=OFF -DENABLE_MULTIBYTECODEC=OFF -DENABLE_CODECS_CN=OFF -DENABLE_CODECS_HK=OFF -DENABLE_CODECS_ISO2022=OFF -DBUILD_EXTENSIONS_AS_BUILTIN=On -DANDROID_PLATFORM=android-21 -DPYTHON_VERSION=${{ matrix.python-version }} $(pwd)/../src/ + cmake -DANDROID_NDK=/usr/local/lib/android/sdk/ndk/23.0.7421159/ -DCMAKE_INSTALL_PREFIX:PATH=../install-prefix -DCMAKE_TOOLCHAIN_FILE=/usr/local/lib/android/sdk/ndk/23.0.7421159/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.ndk-arch }} -DCMAKE_CROSSCOMPILING_EMULATOR=$(pwd)/../src/.github/workflows/adb-emu.sh -DANDROID_ALLOW_UNDEFINED_SYMBOLS=On -DENABLE_DECIMAL=Off -DENABLE_CTYPES=Off -DENABLE_CODECS_JP=OFF -DENABLE_CODECS_KR=OFF -DENABLE_CODECS_TW=OFF -DENABLE_MULTIBYTECODEC=OFF -DENABLE_CODECS_CN=OFF -DENABLE_CODECS_HK=OFF -DENABLE_CODECS_ISO2022=OFF -DBUILD_EXTENSIONS_AS_BUILTIN=On -DANDROID_PLATFORM=android-21 -DPYTHON_VERSION=${{ matrix.python-version }} -DBUILD_PYTHON=../bootstrap-install-prefix/bin/python $(pwd)/../src/ cmake --build . -- VERBOSE=1 cmake --build . --target install diff --git a/.github/workflows/adb-emu.sh b/.github/workflows/adb-emu.sh index d5e849f97..f7336503d 100755 --- a/.github/workflows/adb-emu.sh +++ b/.github/workflows/adb-emu.sh @@ -1,9 +1,17 @@ #!/bin/sh adb push "$1" /data/local/tmp/ 1>/dev/null 2>/dev/null +BINARY=$(basename "$1") if [ $# -eq 1 ]; then - adb shell /data/local/tmp/$(basename $1) + adb shell "/data/local/tmp/${BINARY}" elif [ $# -eq 3 ]; then adb push "$2" /data/local/tmp/ 1>/dev/null 2>/dev/null - adb shell /data/local/tmp/$(basename $1) /data/local/tmp/$(basename $2) /data/local/tmp/$(basename $3) - adb pull /data/local/tmp/$(basename $3) "$3" 1>/dev/null 2>/dev/null + adb shell "/data/local/tmp/${BINARY}" "/data/local/tmp/$(basename $2)" "/data/local/tmp/$(basename $3)" + adb pull "/data/local/tmp/$(basename $3)" "$3" 1>/dev/null 2>/dev/null +elif [ $# -eq 4 ] && [ "${BINARY}" = "_freeze_importlib" ]; then + adb push "$3" /data/local/tmp/ 1>/dev/null 2>/dev/null + adb shell "/data/local/tmp/${BINARY}" "$2" "/data/local/tmp/$(basename $3)" "/data/local/tmp/$(basename $4)" + adb pull "/data/local/tmp/$(basename $4)" "$4" 1>/dev/null 2>/dev/null +else + echo "Unknown number of arguments $# for ${BINARY}" + exit 1 fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ada2539e..7cabf83cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,6 +163,28 @@ else() set(WITH_STATIC_DEPENDENCIES 0) endif() +if(ANDROID AND PY_VERSION VERSION_GREATER_EQUAL "3.11") + set(BUILD_PYTHON "" CACHE PATH "path to build ``python`` binary for cross compiling") + if(NOT BUILD_PYTHON) + message(FATAL_ERROR "Cross compiling requires -DBUILD_PYTHON=") + endif() + if(NOT EXISTS ${BUILD_PYTHON}) + message(FATAL_ERROR "invalid or missing build python binary ${BUILD_PYTHON}") + endif() + execute_process( + COMMAND ${BUILD_PYTHON} -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" + OUTPUT_VARIABLE BUILD_PYTHON_VER + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE BUILD_PYTHON_EXEC_RESULT + ) + if(NOT BUILD_PYTHON_EXEC_RESULT EQUAL 0) + message(FATAL_ERROR "can not execute build python binary ${BUILD_PYTHON}") + endif() + if(NOT "${BUILD_PYTHON_VER}" STREQUAL "${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}") + message(FATAL_ERROR "\"${BUILD_PYTHON}\" has incompatible version ${BUILD_PYTHON_VER} (expected: ${PY_VERSION_MAJOR}.${PY_VERSION_MINOR})") + endif() +endif() + # Detect source directory set(_landmark "pyconfig.h.in") # CMake will look for this file. if(NOT (SRC_DIR AND EXISTS ${SRC_DIR}/${_landmark})) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 1cd1f6e70..10f3245dd 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -373,16 +373,18 @@ add_python_extension(_xxtestfuzz _xxtestfuzz/fuzzer.c ) -# Python 3.8 -set(_wide_char_modifier "L") -add_python_extension(_testinternalcapi - REQUIRES - IS_PY3_8_OR_GREATER - SOURCES - _testinternalcapi.c - DEFINITIONS - "PY3_DLLNAME=${_wide_char_modifier}\"python3$<$:_d>\"" -) +if (NOT ANDROID) + # Python 3.8 + set(_wide_char_modifier "L") + add_python_extension(_testinternalcapi + REQUIRES + IS_PY3_8_OR_GREATER + SOURCES + _testinternalcapi.c + DEFINITIONS + "PY3_DLLNAME=${_wide_char_modifier}\"python3$<$:_d>\"" + ) +endif() # Python 3.9 add_python_extension(_peg_parser ALWAYS_BUILTIN diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index c344b674f..b7124d3e5 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -744,6 +744,7 @@ set(LIBPYTHON_DEEPFREEZE_SOURCES ) if(PY_VERSION VERSION_GREATER_EQUAL "3.11") +if(NOT ANDROID) # Build _bootstrap_python executable add_executable(_bootstrap_python ${SRC_DIR}/Programs/_bootstrap_python.c @@ -763,6 +764,7 @@ target_compile_definitions(_bootstrap_python PUBLIC Py_NO_ENABLE_SHARED ) +endif() list(APPEND LIBPYTHON_DEEPFREEZE_SOURCES ${SRC_DIR}/Python/deepfreeze/deepfreeze.c @@ -773,7 +775,7 @@ set(DEEPFREEZE_PY ${SRC_DIR}/Tools/$,${BUILD_PYTHON},_bootstrap_python> ${DEEPFREEZE_PY} "${SRC_DIR}/Python/frozen_modules/importlib._bootstrap.h:importlib._bootstrap" "${SRC_DIR}/Python/frozen_modules/importlib._bootstrap_external.h:importlib._bootstrap_external" From ba91b3c17bd60d0b66f0450a81b44f3fe88993a1 Mon Sep 17 00:00:00 2001 From: O01eg <397177+o01eg@users.noreply.github.com> Date: Sun, 24 May 2026 09:41:25 +0400 Subject: [PATCH 62/64] Move Linux CI from Cirecle CI to Github Actions CI --- .circleci/config.yml | 122 --------------------------------------- .github/workflows/CI.yml | 49 ++++++++++++++++ 2 files changed, 49 insertions(+), 122 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 00fae5351..eef75720b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,48 +4,6 @@ orbs: win: circleci/windows@2.4 jobs: - build-test-python: - parameters: - python_version: - description: "Python version specified as X.Y.Z" - type: string - python_arch: - description: "Python arch specified as x64 or x86" - type: string - working_directory: /work - docker: - - image: dockcross/linux-<< parameters.python_arch >> - steps: - - checkout - - run: - name: Install Dependencies - command: | - sudo apt-get update - sudo apt-get install -y \ - libbz2-dev \ - libdb-dev \ - libffi-dev \ - libgdbm-compat-dev \ - libgdbm-dev \ - liblzma-dev \ - libncursesw5-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - tcl-dev \ - tk-dev - - run: - name: download dashboard scripts - command: | - git clone git@github.com:python-cmake-buildsystem/python-cmake-buildsystem --branch dashboard --depth 1 scripts - - run: - name: build and test - command: | - set -e - ctest --timeout 360 -S /work/scripts/circle_dashboard.cmake -VV - environment: - PY_VERSION: << parameters.python_version >> - build-test-python-win: parameters: python_version: @@ -84,86 +42,6 @@ jobs: PLATFORM: << parameters.python_arch >> workflows: - build-and-test: - jobs: - # 3.12.10 - - build-test-python: - name: python-3.12.10-x64 - python_version: 3.12.10 - python_arch: x64 - - - build-test-python: - name: python-3.12.10-x86 - python_version: 3.12.10 - python_arch: x86 - - # 3.11.12 - - build-test-python: - name: python-3.11.12-x64 - python_version: 3.11.12 - python_arch: x64 - - - build-test-python: - name: python-3.11.12-x86 - python_version: 3.11.12 - python_arch: x86 - - # 3.10.17 - - build-test-python: - name: python-3.10.17-x64 - python_version: 3.10.17 - python_arch: x64 - - - build-test-python: - name: python-3.10.17-x86 - python_version: 3.10.17 - python_arch: x86 - - # 3.9.22 - - build-test-python: - name: python-3.9.22-x64 - python_version: 3.9.22 - python_arch: x64 - - - build-test-python: - name: python-3.9.22-x86 - python_version: 3.9.22 - python_arch: x86 - - # 3.8.20 - - build-test-python: - name: python-3.8.20-x64 - python_version: 3.8.20 - python_arch: x64 - - - build-test-python: - name: python-3.8.20-x86 - python_version: 3.8.20 - python_arch: x86 - - # 3.7.17 - - build-test-python: - name: python-3.7.17-x64 - python_version: 3.7.17 - python_arch: x64 - - - build-test-python: - name: python-3.7.17-x86 - python_version: 3.7.17 - python_arch: x86 - - # 3.6.15 - - build-test-python: - name: python-3.6.15-x64 - python_version: 3.6.15 - python_arch: x64 - - - build-test-python: - name: python-3.6.15-x86 - python_version: 3.6.15 - python_arch: x86 - - build-and-test-win: jobs: # 3.12.10 diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1275f9938..bd605e1db 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -127,12 +127,61 @@ jobs: cmake --build . -- VERBOSE=1 cmake --build . --target install + tests-linux: + name: python-linux-${{ matrix.python-arch }}-${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-arch: [x64, x86] + python-version: [3.6.15, 3.7.17, 3.8.20, 3.9.22, 3.10.17, 3.11.12, 3.12.10] + container: + image: dockcross/linux-${{ matrix.python-arch }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + path: src + - run: | + sudo apt-get update + sudo apt-get install -y \ + libbz2-dev \ + libdb-dev \ + libffi-dev \ + libgdbm-compat-dev \ + libgdbm-dev \ + liblzma-dev \ + libncursesw5-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + tcl-dev \ + tk-dev + - name: Download dashboard script + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: 'python-cmake-buildsystem/python-cmake-buildsystem' + ref: dashboard + fetch-depth: 0 + path: scripts + - name: Writing initial dashboard cache + shell: bash + run: | + cat > scripts/initial-dashboard-cache.txt << EOF + ${{ matrix.initial-dashboard-cache }} + EOF + cat scripts/initial-dashboard-cache.txt + - name: Build & Test + run: ctest --timeout 360 -S scripts/github_actions_dashboard.cmake -VV + env: + PY_VERSION: ${{ matrix.python-version }} pass: # This job does nothing and is only used for the branch protection if: always() needs: - tests - tests-android + - tests-linux runs-on: ubuntu-latest From c541fc4f8394247d952ae2723e4ba1bb2522b0b6 Mon Sep 17 00:00:00 2001 From: O01eg <397177+o01eg@users.noreply.github.com> Date: Sun, 24 May 2026 10:28:15 +0400 Subject: [PATCH 63/64] Move Windows CI from Cirecle CI to Github Actions CI --- .circleci/config.yml | 95 ---------------------------------------- .github/workflows/CI.yml | 30 +++++++++++++ 2 files changed, 30 insertions(+), 95 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index eef75720b..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,95 +0,0 @@ -version: 2.1 - -orbs: - win: circleci/windows@2.4 - -jobs: - build-test-python-win: - parameters: - python_version: - description: "Python version specified as X.Y.Z" - type: string - python_arch: - description: "Python arch specified as x64 or Win32" - type: string - generator: - description: "CMake generator" - type: string - executor: - name: win/default - shell: powershell.exe - working_directory: C:/Users/circleci/project/src - steps: - - checkout - - run: - name: Install dependencies - command: | - choco install --no-progress cmake - if (-not $?) { throw "Failed to install CMake" } - - run: - name: download dashboard scripts - command: | - git clone git@github.com:python-cmake-buildsystem/python-cmake-buildsystem --branch dashboard --depth 1 ../scripts - - run: - name: build and test - command: | - $Env:PATH += ";C:\Program Files\CMake\bin" - ctest -C $Env:CONFIGURATION -S C:/Users/circleci/project/scripts/circle_win_dashboard.cmake -VV - environment: - PY_VERSION: << parameters.python_version >> - CONFIGURATION: Release - GENERATOR: << parameters.generator >> - PLATFORM: << parameters.python_arch >> - -workflows: - build-and-test-win: - jobs: - # 3.12.10 - - build-test-python-win: - name: python-3.12.10-win-x64 - python_version: 3.12.10 - python_arch: x64 - generator: "Visual Studio 16 2019" - - # 3.11.12 - - build-test-python-win: - name: python-3.11.12-win-x64 - python_version: 3.11.12 - python_arch: x64 - generator: "Visual Studio 16 2019" - - # 3.10.17 - - build-test-python-win: - name: python-3.10.17-win-x64 - python_version: 3.10.17 - python_arch: x64 - generator: "Visual Studio 16 2019" - - # 3.9.22 - - build-test-python-win: - name: python-3.9.22-win-x64 - python_version: 3.9.22 - python_arch: x64 - generator: "Visual Studio 16 2019" - - # 3.8.20 - - build-test-python-win: - name: python-3.8.20-win-x64 - python_version: 3.8.20 - python_arch: x64 - generator: "Visual Studio 16 2019" - - # 3.7.17 - - build-test-python-win: - name: python-3.7.17-win-x64 - python_version: 3.7.17 - python_arch: x64 - generator: "Visual Studio 16 2019" - - # 3.6.15 - - build-test-python-win: - name: python-3.6.15-win-x64 - python_version: 3.6.15 - python_arch: x64 - generator: "Visual Studio 16 2019" - diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bd605e1db..8cb313e6d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -176,12 +176,42 @@ jobs: env: PY_VERSION: ${{ matrix.python-version }} + tests-windows: + name: python-${{ matrix.python-version }}-win-${{ matrix.python-arch }} + runs-on: windows-2022 + strategy: + fail-fast: false + matrix: + python-arch: [x64] + python-version: [3.6.15, 3.7.17, 3.8.20, 3.9.22, 3.10.17, 3.11.12, 3.12.10] + generator: ["Visual Studio 16 2019"] + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + path: src + - name: Download dashboard script + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: 'python-cmake-buildsystem/python-cmake-buildsystem' + ref: dashboard + fetch-depth: 0 + path: scripts + - name: Build & Test + run: ctest -C $Env:CONFIGURATION -S scripts/circle_win_dashboard.cmake -VV + env: + PY_VERSION: ${{ matrix.python-version }} + CONFIGURATION: Release + GENERATOR: ${{ matrix.generator }} + PLATFORM: ${{ matrix.python-arch }} + pass: # This job does nothing and is only used for the branch protection if: always() needs: - tests - tests-android - tests-linux + - tests-windows runs-on: ubuntu-latest From f85692c37f84ecd3c1092d6c4efde128a0581291 Mon Sep 17 00:00:00 2001 From: O01eg <397177+o01eg@users.noreply.github.com> Date: Sun, 24 May 2026 11:59:23 +0400 Subject: [PATCH 64/64] Remove fetch of deprecated separate dashboard branch --- .github/dashboard/circle.yml | 4 -- ...ake => github_actions_win_dashboard.cmake} | 17 +++++---- .github/workflows/CI.yml | 38 ++++--------------- 3 files changed, 17 insertions(+), 42 deletions(-) delete mode 100644 .github/dashboard/circle.yml rename .github/dashboard/{circle_win_dashboard.cmake => github_actions_win_dashboard.cmake} (76%) diff --git a/.github/dashboard/circle.yml b/.github/dashboard/circle.yml deleted file mode 100644 index a1dbbafeb..000000000 --- a/.github/dashboard/circle.yml +++ /dev/null @@ -1,4 +0,0 @@ -general: - branches: - ignore: - - dashboard diff --git a/.github/dashboard/circle_win_dashboard.cmake b/.github/dashboard/github_actions_win_dashboard.cmake similarity index 76% rename from .github/dashboard/circle_win_dashboard.cmake rename to .github/dashboard/github_actions_win_dashboard.cmake index 6bb8ccf0e..f76e95b37 100644 --- a/.github/dashboard/circle_win_dashboard.cmake +++ b/.github/dashboard/github_actions_win_dashboard.cmake @@ -19,9 +19,9 @@ if(_match STREQUAL "") message(FATAL_ERROR "Environment variable 'PY_VERSION' is improperly set.") endif() -set(CTEST_SITE "circleci-window") -set(CTEST_DASHBOARD_ROOT $ENV{CIRCLE_WORKING_DIRECTORY}/..) -set(CTEST_SOURCE_DIRECTORY $ENV{CIRCLE_WORKING_DIRECTORY}) +set(CTEST_SITE "github-actions-window") +set(CTEST_DASHBOARD_ROOT $ENV{GITHUB_WORKSPACE}) +set(CTEST_SOURCE_DIRECTORY $ENV{GITHUB_WORKSPACE}/src) set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION}) set(CTEST_CMAKE_GENERATOR "$ENV{GENERATOR}") @@ -31,16 +31,17 @@ set(CTEST_BUILD_FLAGS "/m") set(CTEST_TEST_ARGS PARALLEL_LEVEL 8) # Build name -string(SUBSTRING $ENV{CIRCLE_SHA1} 0 7 commit) -set(what "#$ENV{CIRCLE_PR_NUMBER}") -if("$ENV{CIRCLE_PR_NUMBER}" STREQUAL "") - set(what "$ENV{CIRCLE_BRANCH}") +# Build name +string(SUBSTRING $ENV{GITHUB_SHA} 0 7 commit) +set(what "#$ENV{GITHUB_HEAD_REF}") +if("$ENV{GITHUB_HEAD_REF}" STREQUAL "") + set(what "$ENV{GITHUB_REF_NAME}") endif() set(CTEST_BUILD_NAME "${PY_VERSION}-${CTEST_CMAKE_GENERATOR_PLATFORM}-${CTEST_CONFIGURATION_TYPE}_${what}_${commit}") set(dashboard_binary_name build) set(dashboard_model Experimental) -set(dashboard_track Circle-CI-Windows) +set(dashboard_track GitHub-Actions) set(dashboard_cache "BUILD_LIBPYTHON_SHARED:BOOL=ON PYTHON_VERSION:STRING=${PY_VERSION} diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8cb313e6d..298cb4e98 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -37,24 +37,16 @@ jobs: with: version: 1.10.0 - - name: Download dashboard script - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: 'python-cmake-buildsystem/python-cmake-buildsystem' - ref: dashboard - fetch-depth: 0 - path: scripts - - name: Writing initial dashboard cache shell: bash run: | - cat > scripts/initial-dashboard-cache.txt << EOF + cat > src/.github/dashboard/initial-dashboard-cache.txt << EOF ${{ matrix.initial-dashboard-cache }} EOF - cat scripts/initial-dashboard-cache.txt + cat src/.github/dashboard/initial-dashboard-cache.txt - name: Build & Test - run: ctest --timeout 360 -S scripts/github_actions_dashboard.cmake -VV + run: ctest --timeout 360 -S src/.github/dashboard/github_actions_dashboard.cmake -VV env: PY_VERSION: ${{ matrix.python-version }} CC: ${{ matrix.c-compiler }} @@ -157,22 +149,15 @@ jobs: libssl-dev \ tcl-dev \ tk-dev - - name: Download dashboard script - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: 'python-cmake-buildsystem/python-cmake-buildsystem' - ref: dashboard - fetch-depth: 0 - path: scripts - name: Writing initial dashboard cache shell: bash run: | - cat > scripts/initial-dashboard-cache.txt << EOF + cat > src/.github/dashboard/initial-dashboard-cache.txt << EOF ${{ matrix.initial-dashboard-cache }} EOF - cat scripts/initial-dashboard-cache.txt + cat src/.github/dashboard/initial-dashboard-cache.txt - name: Build & Test - run: ctest --timeout 360 -S scripts/github_actions_dashboard.cmake -VV + run: ctest --timeout 360 -S src/.github/dashboard/github_actions_dashboard.cmake -VV env: PY_VERSION: ${{ matrix.python-version }} @@ -184,21 +169,14 @@ jobs: matrix: python-arch: [x64] python-version: [3.6.15, 3.7.17, 3.8.20, 3.9.22, 3.10.17, 3.11.12, 3.12.10] - generator: ["Visual Studio 16 2019"] + generator: ["Visual Studio 17 2022"] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 path: src - - name: Download dashboard script - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: 'python-cmake-buildsystem/python-cmake-buildsystem' - ref: dashboard - fetch-depth: 0 - path: scripts - name: Build & Test - run: ctest -C $Env:CONFIGURATION -S scripts/circle_win_dashboard.cmake -VV + run: ctest -C $Env:CONFIGURATION -S src/.github/dashboard/github_actions_win_dashboard.cmake -VV env: PY_VERSION: ${{ matrix.python-version }} CONFIGURATION: Release