From 273555f53458eb80d15c3d5c1910e57428818ee4 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 10:27:27 +0000 Subject: build(release): version compiler packages by their last source commit Co-Authored-By: Claude Opus 5.5 --- cmake/CompilerPaths.txt | 11 +++++++++++ cmake/Release.cmake | 9 ++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 cmake/CompilerPaths.txt (limited to 'cmake') diff --git a/cmake/CompilerPaths.txt b/cmake/CompilerPaths.txt new file mode 100644 index 0000000..9de9772 --- /dev/null +++ b/cmake/CompilerPaths.txt @@ -0,0 +1,11 @@ +cmake +doc +include +lib +pseudocode-lib +tests +tools +CMakeLists.txt +install.sh +install.ps1 +LICENSE diff --git a/cmake/Release.cmake b/cmake/Release.cmake index 7ff1d2c..c825f74 100644 --- a/cmake/Release.cmake +++ b/cmake/Release.cmake @@ -1,16 +1,19 @@ -# Read HEAD at packaging time so subsequent commits do not require reconfiguration. +# Read the last compiler commit at packaging time so subsequent commits do not require reconfiguration. include("${CPSC_SOURCE_DIR}/cmake/FindDependency.cmake") include("${CPSC_SOURCE_DIR}/cmake/ManualAliases.cmake") cpsc_find_dependency(PROGRAM GIT_EXECUTABLE NAMES git REQUIRED) find_package(Git REQUIRED) +file(STRINGS "${CPSC_SOURCE_DIR}/cmake/CompilerPaths.txt" cpsc_compiler_paths) +list(TRANSFORM cpsc_compiler_paths STRIP) +list(FILTER cpsc_compiler_paths EXCLUDE REGEX "^$") execute_process( - COMMAND "${GIT_EXECUTABLE}" -C "${CPSC_SOURCE_DIR}" log -1 "--format=%ct:%h" + COMMAND "${GIT_EXECUTABLE}" -C "${CPSC_SOURCE_DIR}" log -1 "--format=%ct:%h" -- ${cpsc_compiler_paths} OUTPUT_VARIABLE cpsc_revision OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE cpsc_git_result ) if(NOT cpsc_git_result STREQUAL "0" OR NOT cpsc_revision MATCHES "^([0-9]+):([0-9a-f]+)$") - message(FATAL_ERROR "Cannot read the HEAD commit for the release version") + message(FATAL_ERROR "Cannot read the last compiler commit for the release version") endif() set(ENV{SOURCE_DATE_EPOCH} "${CMAKE_MATCH_1}") set(cpsc_short_id "${CMAKE_MATCH_2}") -- cgit v1.3.1-4-g156e