Skip to content

Commit

Permalink
Merge pull request #1132 from progfolio/fix/compile
Browse files Browse the repository at this point in the history
straight--build-compile: fix compile process load-path
  • Loading branch information
raxod502 authored Oct 5, 2024
2 parents 08e197b + 3468d18 commit 33fb469
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions straight.el
Original file line number Diff line number Diff line change
Expand Up @@ -5272,19 +5272,22 @@ individual package recipe."
RECIPE should be a straight.el-style plist. Note that this
function only modifies the build folder, not the original
repository."
(let* ((dir (straight--build-dir (plist-get recipe :package)))
(let* ((pkg (plist-get recipe :package))
(dir (straight--build-dir pkg))
(emacs (concat invocation-directory invocation-name))
(buffer straight-byte-compilation-buffer)
(deps
(let ((tmp nil))
(dolist (dep (straight--flatten (straight-dependencies pkg))
tmp)
(let ((build-dir (straight--build-dir dep)))
(when (file-exists-p build-dir) (push build-dir tmp))))))
(print-circle nil)
(print-length nil)
(program
(format "%S" `(let ((default-directory ,(straight--build-dir))
(lp load-path))
(setq load-path (list default-directory))
(normal-top-level-add-subdirs-to-load-path)
(setq load-path (append (cons ,dir load-path)
lp))
(byte-recompile-directory ,dir 0 'force))))
(format
"%S" `(progn (setq load-path (append '(,dir) ',deps load-path))
(byte-recompile-directory ,dir 0 'force))))
(args (list "-Q" "--batch" "--eval" program)))
(when buffer (with-current-buffer (get-buffer-create buffer)
(insert (format "\n$ %s %s \\\n %S\n" emacs
Expand Down

0 comments on commit 33fb469

Please sign in to comment.