aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AGENTS/ARCH/INSTALL.md3
-rw-r--r--AGENTS/ARCH/LAYOUT.md1
-rw-r--r--cmake/CompilerPaths.txt11
-rw-r--r--cmake/Release.cmake9
4 files changed, 20 insertions, 4 deletions
diff --git a/AGENTS/ARCH/INSTALL.md b/AGENTS/ARCH/INSTALL.md
index 82c5059..a1624bd 100644
--- a/AGENTS/ARCH/INSTALL.md
+++ b/AGENTS/ARCH/INSTALL.md
@@ -21,7 +21,8 @@ the extracted executable, and sets its local runtime/data paths as needed. Syste
Pandoc remains the fallback.
`make -C build release` packages the executable, all manuals, installer and license
as `build/cpsc-VERSION-SYSTEM-ARCH.tar.xz`, retaining the configured execution mode.
-`cmake/Release.cmake` reads HEAD at packaging time; VERSION is the commit's UTC
+`cmake/Release.cmake` reads, at packaging time, the last commit that touched the paths
+listed in `cmake/CompilerPaths.txt`; VERSION is that commit's UTC
timestamp (`yyyymmdd-hhmmss`) followed by its short ID. Git is only required
for packaging; recipients can install the extracted archive using just the script.
diff --git a/AGENTS/ARCH/LAYOUT.md b/AGENTS/ARCH/LAYOUT.md
index a88c60b..2d8f2fd 100644
--- a/AGENTS/ARCH/LAYOUT.md
+++ b/AGENTS/ARCH/LAYOUT.md
@@ -35,6 +35,7 @@
| `cmake/BuildTools.cmake`, `cmake/LLVMDependencies.cmake` | Compiler/build tool selection and LLVM dependency discovery |
| `cmake/Manual.cmake`, `cmake/GenerateManual.cmake.in` | Optional manual generation with local-first Pandoc discovery |
| `install.sh`, `install.ps1`, `cmake/Install.cmake.in`, `cmake/Release.cmake` | Artifact installation and versioned binary release packaging |
+| `cmake/CompilerPaths.txt` | Plain list of compiler source paths; the last commit touching them versions release packages |
AST nodes live in `include/cps/AST.h` (+ `FunctionAST.h`, `FileAST.h`, `TypeAST.h`, `TemplateAST.h`);
they are pure data with virtual destructors only — no codegen/visitor methods.
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}")