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) ''
|
'' + lib.optionalString (nativeComp && withNS) ''
|
||||||
ln -snf $out/lib/emacs/*/native-lisp $out/Applications/Emacs.app/Contents/native-lisp
|
ln -snf $out/lib/emacs/*/native-lisp $out/Applications/Emacs.app/Contents/native-lisp
|
||||||
'' + lib.optionalString nativeComp ''
|
'' + lib.optionalString nativeComp ''
|
||||||
$out/bin/emacs --batch \
|
echo "Generating native-compiled trampolines..."
|
||||||
-l comp --eval "(mapatoms (lambda (s) \
|
# precompile trampolines in parallel, but avoid spawning one process per trampoline.
|
||||||
(when (subr-primitive-p (symbol-function s)) \
|
# 1000 is a rough lower bound on the number of trampolines compiled.
|
||||||
(comp-trampoline-compile s))))"
|
$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
|
mkdir -p $out/share/emacs/native-lisp
|
||||||
$out/bin/emacs --batch \
|
$out/bin/emacs --batch \
|
||||||
--eval "(add-to-list 'comp-eln-load-path \"$out/share/emacs/native-lisp\")" \
|
--eval "(add-to-list 'comp-eln-load-path \"$out/share/emacs/native-lisp\")" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user