nix-community / emacs-overlay

Bleeding edge emacs overlay [maintainer=@adisbladis]
503 stars 165 forks source link

bytecomp-revert patch fails on 5cd187 #379

Closed ParetoOptimalDev closed 9 months ago

ParetoOptimalDev commented 9 months ago
error: builder for '/nix/store/qy953p4yp2xgxkl41yx5zcllk9m8bfa3-emacs-git-20240102.0.drv' failed with exit code 1;
       last 9 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/3jwc5k2l8jdjha5qh61milxyld9a2rgr-source
       > source root is source
       > Running phase: patchPhase
       > applying patch /nix/store/nlzm32a8dnrcx7iihv0smm01ifyzczfm-bytecomp-revert.patch
       > patching file lisp/emacs-lisp/bytecomp.el
       > Hunk #1 FAILED at 3521.
       > Hunk #2 succeeded at 4515 (offset 51 lines).
       > 1 out of 2 hunks FAILED -- saving rejects to file lisp/emacs-lisp/bytecomp.el.rej
       For full logs, run 'nix log /nix/store/qy953p4yp2xgxkl41yx5zcllk9m8bfa3-emacs-git-20240102.0.drv'.

My flake metadata for emacs-overlay:

$ nix flake metadata emacs-overlay
Resolved URL:  path:/nix/store/62qnxpmkwv534n1v13242c1cqghc478q-source?lastModified=1703725068&narHash=sha256-MLYevZuQC5wdzS/RnPYm20SwvSijWzPg97wi9K/qghM%3D&rev=5cd18705d47b49e35f760a83fdc33dc6e1e3f757
Locked URL:    path:/nix/store/62qnxpmkwv534n1v13242c1cqghc478q-source?lastModified=1703725068&narHash=sha256-MLYevZuQC5wdzS/RnPYm20SwvSijWzPg97wi9K/qghM%3D&rev=5cd18705d47b49e35f760a83fdc33dc6e1e3f757
Description:   Bleeding edge Emacs overlay
Path:          /nix/store/62qnxpmkwv534n1v13242c1cqghc478q-source
Revision:      5cd18705d47b49e35f760a83fdc33dc6e1e3f757
Last modified: 2023-12-27 18:57:48
Inputs:
├───flake-utils: github:numtide/flake-utils/4022d587cbbfd70fe950c1e2083a02621806a725
│   └───systems: github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e
├───nixpkgs: github:NixOS/nixpkgs/5f64a12a728902226210bf01d25ec6cbb9d9265b
└───nixpkgs-stable: github:NixOS/nixpkgs/7790e078f8979a9fcd543f9a47427eeaba38f268
ParetoOptimalDev commented 9 months ago

Building without patches, but maybe this (untested) code removing only the bytecomp patch is better:

  patches = lib.filter (patch: patch.name or (toString patch) != "bytecomp-revert.patch") old.patches;

Or perhaps I need to fix the bytecomp patch and it's still needed. It says its for #318 so I might not need it on my vanilla x86_64 linux but could be needed by others.

ParetoOptimalDev commented 9 months ago

Oh forgot to update, that didn't work so I just rolled my flake back to an earlier version for now.

slotThe commented 9 months ago

The following works for me:

nope ``` nix programs.emacs = { enable = true; package = (pkgs.emacs-git.override { … }).overrideAttrs(old: { patches = builtins.filter (patch: builtins.baseNameOf patch != "bytecomp-revert.patch") old.patches; }); … } ```
ParetoOptimalDev commented 9 months ago

Sadly I get this error that might be related to that patch somehow:

error: builder for '/nix/store/b5xg2r1zp8yiv9k3q7kxn4wzbn9z7004-emacs-beacon-20220730.100.drv' failed with exit code 255;
       last 10 log lines:
       >   (if (consp x61) (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit)))))
       >   (let* ((x60 (car-safe x59)) (x61 (cdr-safe x59))) (if (consp x61) (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit))))))
       >   (if (consp x59) (let* ((x60 (car-safe x59)) (x61 (cdr-safe x59))) (if (consp x61) (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit)))))))
       >   (let* ((x58 (car-safe command-line-args-left)) (x59 (cdr-safe command-line-args-left))) (if (consp x59) (let* ((x60 (car-safe x59)) (x61 (cdr-safe x59))) (if (consp x61) (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit))))))))
       >   (if (consp command-line-args-left) (let* ((x58 (car-safe command-line-args-left)) (x59 (cdr-safe command-line-args-left))) (if (consp x59) (let* ((x60 (car-safe x59)) (x61 (cdr-safe x59))) (if (consp x61) (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit)))))))))
       >   melpa2nix-build-package()
       >   command-line-1(("-L" "/build/package-build" "-l" "/nix/store/65hf8xsn31cindnpqcnha1w591jyvzhb-melpa2nix.el" "-f" "melpa2nix-build-package" "beacon" "20220730.100" "d09cfab21be800831644218e9c8c4433087951c0"))
       >   command-line()
       >   normal-top-level()
       > Symbol's function definition is void: package--prepare-dependencies
slotThe commented 9 months ago

Oh, sorry about that; maybe I should've let Emacs finish building before posting

leungbk commented 9 months ago

I'm not sure if the bytecomp-revert patch is needed at all anymore since Mattias E. made some recent changes upstream...but anyway, I pushed some commits here to make sure the patch applies.

BTW, at the time of writing, the overlay's version of Emacs 30 works on nixos-unstable but not release-23.11 since we merged https://github.com/NixOS/nixpkgs/pull/277331 fairly late. If this bothers anyone, let me know and I'll revert https://github.com/nix-community/emacs-overlay/pull/378 temporarily.