>From a0df10c8f1b3357427ee094fb50c522e69b40d3b Mon Sep 17 00:00:00 2001 From: Mario Domenech Goulart Date: Sat, 11 Nov 2023 20:00:44 +0100 Subject: [PATCH 1/2] chicken-install: Reset egg cache when status file does not exist If for whatever reason the status file doesn't exist, reset the cache of the egg to prevent the object files in there from being reused. This might happen when a CHICKEN older than 2f6a7221 caches an egg, and we try to install that egg with a CHICKEN newer than 2f6a7221. The older CHICKEN had installed a `STATUS' file, and the newer CHICKEN will look for a `_STATUS' file, which won't exist. If chicken-install ignores the existence of the status file and reuses object files, we might mix incompatible binaries produced by different versions of CHICKEN and C compilers, leading to errors like [panic] invalid encoded literal format - execution terminated --- chicken-install.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chicken-install.scm b/chicken-install.scm index d0d9f8aa..56c741db 100644 --- a/chicken-install.scm +++ b/chicken-install.scm @@ -425,7 +425,15 @@ (delete-directory cached #t)) (create-directory cached #t) (fetch-egg-sources name version cached lax)) - (cond ((or (not (probe-dir cached)) + (cond ((and (probe-dir cached) + (not (file-exists? status))) + ;; If for whatever reason the status file doesn't exist + ;; (e.g., it was renamed, as in 2f6a7221), reset the cache + ;; of the egg to prevent the object files in there from + ;; being reused. + (d "resetting ~a, as ~a does not exist~%" cached status) + (fetch #f)) + ((or (not (probe-dir cached)) (not (file-exists? eggfile))) (d "~a not cached~%" name) (when cached-only (error "extension not cached" name)) -- 2.39.2