mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 01:13:05 +00:00
Merge pull request #113730 from collares/parallel-trampolines
emacs: precompile trampolines in parallel
This commit is contained in:
commit
e59a33db58
@ -159,10 +159,14 @@ let emacs = stdenv.mkDerivation (lib.optionalAttrs nativeComp {
|
||||
'' + lib.optionalString (nativeComp && withNS) ''
|
||||
ln -snf $out/lib/emacs/*/native-lisp $out/Applications/Emacs.app/Contents/native-lisp
|
||||
'' + lib.optionalString nativeComp ''
|
||||
$out/bin/emacs --batch \
|
||||
-l comp --eval "(mapatoms (lambda (s) \
|
||||
(when (subr-primitive-p (symbol-function s)) \
|
||||
(comp-trampoline-compile s))))"
|
||||
echo "Generating native-compiled trampolines..."
|
||||
# precompile trampolines in parallel, but avoid spawning one process per trampoline.
|
||||
# 1000 is a rough lower bound on the number of trampolines compiled.
|
||||
$out/bin/emacs --batch --eval "(mapatoms (lambda (s) \
|
||||
(when (subr-primitive-p (symbol-function s)) (print s))))" \
|
||||
| xargs -n $((1000/NIX_BUILD_CORES + 1)) -P $NIX_BUILD_CORES \
|
||||
$out/bin/emacs --batch -l comp --eval "(while argv \
|
||||
(comp-trampoline-compile (intern (pop argv))))"
|
||||
mkdir -p $out/share/emacs/native-lisp
|
||||
$out/bin/emacs --batch \
|
||||
--eval "(add-to-list 'comp-eln-load-path \"$out/share/emacs/native-lisp\")" \
|
||||
|
Loading…
Reference in New Issue
Block a user