fix(emacs-pkgs/nix-util): Use lexical-let to allow variable capture
The lambda that acts as the sentinel for building SBCL with packages needs to be able to capture variables if lexical binding is enabled, which is made possible by the lexical-let form.
This commit is contained in:
parent
8e9167fdc8
commit
bdd488ce27
1 changed files with 17 additions and 17 deletions
|
@ -75,11 +75,18 @@
|
||||||
thrown on build failures."
|
thrown on build failures."
|
||||||
|
|
||||||
(interactive "sAttribute: ")
|
(interactive "sAttribute: ")
|
||||||
(let* ((outbuf (get-buffer-create (format "*depot-out/%s*" attribute)))
|
(lexical-let* ((outbuf (get-buffer-create (format "*depot-out/%s*" attribute)))
|
||||||
(errbuf (get-buffer-create (format "*depot-errors/%s*" attribute)))
|
(errbuf (get-buffer-create (format "*depot-errors/%s*" attribute)))
|
||||||
(expression (format "let depot = import <depot> {}; in depot.nix.buildLisp.sbclWith [ depot.%s ]" attribute))
|
(expression (format "let depot = import <depot> {}; in depot.nix.buildLisp.sbclWith [ depot.%s ]" attribute))
|
||||||
(command (list "nix-build" "-I" (format "depot=%s" nix-depot-path) "-E" expression))
|
;; TODO(tazjin): use <depot>
|
||||||
(build-handler
|
(command (list "nix-build" "-I" (format "depot=%s" nix-depot-path) "-E" expression)))
|
||||||
|
|
||||||
|
(message "Acquiring Lisp for <depot>.%s" attribute)
|
||||||
|
(make-process :name (format "depot-nix-build/%s" attribute)
|
||||||
|
:buffer outbuf
|
||||||
|
:stderr errbuf
|
||||||
|
:command command
|
||||||
|
:sentinel
|
||||||
(lambda (process event)
|
(lambda (process event)
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(pcase event
|
(pcase event
|
||||||
|
@ -91,13 +98,6 @@
|
||||||
(_ (with-current-buffer errbuf
|
(_ (with-current-buffer errbuf
|
||||||
(error "Failed to build '%s':\n%s" attribute (buffer-string)))))
|
(error "Failed to build '%s':\n%s" attribute (buffer-string)))))
|
||||||
(kill-buffer outbuf)
|
(kill-buffer outbuf)
|
||||||
(kill-buffer errbuf)))))
|
(kill-buffer errbuf))))))
|
||||||
|
|
||||||
(message "Acquiring Lisp for <depot>.%s" attribute)
|
|
||||||
(make-process :name (format "depot-nix-build/%s" attribute)
|
|
||||||
:buffer outbuf
|
|
||||||
:stderr errbuf
|
|
||||||
:sentinel build-handler
|
|
||||||
:command command))) ; TODO(tazjin): use <depot>
|
|
||||||
|
|
||||||
(provide 'nix-util)
|
(provide 'nix-util)
|
||||||
|
|
Loading…
Add table
Reference in a new issue