Skip to content

Commit

Permalink
emacs: Update emacs-overlay and apply patch
Browse files Browse the repository at this point in the history
Emacs commit ea9831bb3cb4878273f6f848051c9b8c3c76d5f1 introduces a
failure to build nix elisp packages on certain machines. Laptop has no
issue, but desktop fails to compile some packages. This is reproducible
inside a container so unlikely to be system state. Potentially could be
a but with libggcjit, as it does not occur with native comp disabled.

For now, this adds a patch that reverts part of the commit that triggers
the bug.
  • Loading branch information
accelbread committed Apr 24, 2023
1 parent 5e37e28 commit 8e5e3ad
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
};
impermanence.url = "github:nix-community/impermanence";
emacs-overlay = {
url = "github:nix-community/emacs-overlay/3655d1502e02bafa2668a74e511166ce5415c247";
url = "github:nix-community/emacs-overlay/2afeb0596418d37aa3feb7203cc37a11c10c83fe";
inputs.nixpkgs.follows = "nixpkgs";
};
nixgl = {
Expand Down
5 changes: 4 additions & 1 deletion nix/packages/emacsAccelbread.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ let
,(eglot-alternatives '("nil" "rnix-lsp" "${nil}/bin/nil")))
. ,eglot-server-programs)))
'';
baseEmacs = emacsPgtk;
baseEmacs = emacsPgtk.overrideAttrs (old: {
patches = (old.patches or [ ]) ++
[ ./misc/0001-Revert-Better-compilation-of-arguments-to-ignore.patch ];
});
emacsWithPackages = (emacsPackagesFor baseEmacs).emacsWithPackages;
in
emacsWithPackages (epkgs: attrVals configPackages epkgs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From ad7d2d1d69f8c255b0e59afb3e5a369c45fa8619 Mon Sep 17 00:00:00 2001
From: Archit Gupta <archit@accelbread.com>
Date: Sun, 23 Apr 2023 14:16:05 -0700
Subject: [PATCH] Revert "Better compilation of arguments to `ignore`"

This reverts commit ea9831bb3cb4878273f6f848051c9b8c3c76d5f1.
---
lisp/emacs-lisp/bytecomp.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index c84c70971b3..fd0c101146c 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -4448,8 +4448,11 @@ This function is never called when `lexical-binding' is nil."

(defun byte-compile-ignore (form)
(dolist (arg (cdr form))
- ;; Compile each argument for-effect but suppress unused-value warnings.
- (byte-compile-form arg 'for-effect-no-warn))
+ ;; Compile args for value (to avoid warnings about unused values),
+ ;; emit a discard after each, and trust the LAP peephole optimiser
+ ;; to annihilate useless ops.
+ (byte-compile-form arg)
+ (byte-compile-discard))
(byte-compile-form nil))

;; Return the list of items in CONDITION-PARAM that match PRED-LIST.
--
2.39.2

0 comments on commit 8e5e3ad

Please sign in to comment.