From 1b1797cc455d9d4accf98fd0a8d06fa333e6e1ca Mon Sep 17 00:00:00 2001 From: PythonNut Date: Sun, 18 Feb 2024 17:53:45 -0800 Subject: [PATCH] Set print-symbols-bare to t while saving the build cache This fixes a bug where recipes may contain symbols with positions, which have a printed representation but no read syntax, causing the subsequent load of the build cache to fail. Symbols with positions may be generated during the execution of the byte compiler. --- straight.el | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/straight.el b/straight.el index 81ef345..c8ca55e 100644 --- a/straight.el +++ b/straight.el @@ -4260,11 +4260,17 @@ The name of the cache file is stored in (straight--log 'modification-detection "Saving build cache") (unless straight-safe-mode (with-temp-buffer - ;; Prevent mangling of the form being printed in the case that - ;; this function was called by an `eval-expression' invocation - ;; of `straight-use-package'. - (let ((print-level nil) - (print-length nil)) + (let (;; Prevent mangling of the form being printed in the case that + ;; this function was called by an `eval-expression' invocation + ;; of `straight-use-package'. + (print-level nil) + (print-length nil) + ;; Print symbols with attached positions, which can occur + ;; during byte compilation, as bare symbols so they can be + ;; read when loading the cache. + (print-symbols-bare t)) + ;; Stop the byte-compiler from complaining about unused binding. + (ignore print-symbols-bare) ;; The version of the build cache. (print straight--build-cache-version (current-buffer)) ;; Record the current Emacs version. If a different version of