Skip to content

emacs30: add a patch to fix upstream bug 67916#361947

Merged
jian-lin merged 1 commit intoNixOS:staging-nextfrom
linj-fork:pr/emacs-fix-67916
Dec 6, 2024
Merged

emacs30: add a patch to fix upstream bug 67916#361947
jian-lin merged 1 commit intoNixOS:staging-nextfrom
linj-fork:pr/emacs-fix-67916

Conversation

@jian-lin
Copy link
Copy Markdown
Contributor

@jian-lin jian-lin commented Dec 5, 2024

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67916

Bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67916

Inhibit lexical cookie warning for *-pkg.el files (bug#67916)

Users may use byte-compile-error-on-warn to turn compilation warnings
into errors to make sure their Emacs lisp packages are warning-free.
Emacs bug 67916 makes that difficult because the Emacs-generated file
*-pkg.el emits a compilation warning about missing lexical cookie.

There is an upstream patch to fix this. That patch makes Emacs also
generate the needed lexical cookie when generating *-pkg.el files.
However, that patch has stalled.

This patch takes an easier but less accurate approach by inhibiting
lexical cookie warning for *-pkg.el files. Given that not all
*-pkg.el files are generated by Emacs, to reduce impact, this patch
also checks no-byte-compile.


This patch can be verified by building a simple elisp package foo.el with turnCompilationWarningToError enabled:

;;; foo.el --- A test file  -*- lexical-binding: t; -*-

;; Version: 1.0.0

(provide 'foo)

;;; foo.el ends here
$ nix build -Lv --include nixpkgs=$PWD --impure --expr 'with (import <nixpkgs> { config = { }; overlays = [ ]; }); emacs30.pkgs.elpaBuild { pname = "foo"; version = "1.0.0"; turnCompilationWarningToError = true; src = writeText "foo.el" ";;; foo.el --- A test file  -*- lexical-binding: t; -*-\n;; Version: 1.0.0\n(provide \'foo)\n;;; foo.el ends here"; }'

Previously, the build failed. With this patch applied, the build succeeds.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: emacs Text editor label Dec 5, 2024
@ofborg ofborg bot requested review from jwiegley and lovek323 December 5, 2024 21:58
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Dec 5, 2024
@jian-lin jian-lin merged commit 47b7878 into NixOS:staging-next Dec 6, 2024
@jian-lin jian-lin deleted the pr/emacs-fix-67916 branch December 6, 2024 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: emacs Text editor 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants