Skip to content

Commit

Permalink
Set print-symbols-bare to t while saving the build cache
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PythonNut committed Feb 21, 2024
1 parent b3760f5 commit 1b1797c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions straight.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b1797c

Please sign in to comment.