NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.59k stars 13.74k forks source link

Build failure: Emacs with ELPA package `p4-16-mode` #301795

Closed hexclover closed 1 month ago

hexclover commented 5 months ago

Steps To Reproduce

Steps to reproduce the behavior:

With flake.nix:

{
  description = "A very basic flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
  };

  outputs = { self, nixpkgs }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs { inherit system; };
    in
    {
      devShells."${system}".default = with pkgs; mkShell {
        packages = [
          ((emacsPackagesFor emacs-gtk).emacsWithPackages (e: [ e.p4-16-mode ]))
        ];
      };
    };
}

Build log

@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
no Makefile or custom buildPhase, doing nothing
@nix { "action": "setPhase", "phase": "installPhase" }
Running phase: installPhase
Parsing tar file... 
Parsing tar file...done

Error: wrong-type-argument (arrayp nil)
  mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode -0x51fa72ed2510e41>))
  debug-early-backtrace()
  debug-early(error (wrong-type-argument arrayp nil))
  tar--describe-as-link(nil)
  tar--check-descriptor(nil)
  tar-get-file-descriptor("p4-16-mode-0.3/p4-pkg.el")
  package-tar-file-info()
  (if (derived-mode-p 'tar-mode) (package-tar-file-info) (package-buffer-info))
  (let ((pkg-desc (if (derived-mode-p 'tar-mode) (package-tar-file-info) (package-buffer-info)))) (p>
  elpa2nix-install-from-buffer()
  (progn (if is-tar (insert-file-contents-literally file) (insert-file-contents file)) (if is-tar (p>
  (unwind-protect (progn (if is-tar (insert-file-contents-literally file) (insert-file-contents file>
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (if is-tar (insert-file-conte>
  (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffe>
  (let ((is-tar (string-match "\\.tar\\'" file))) (let ((temp-buffer (generate-new-buffer " *temp*" >
  elpa2nix-install-file("/nix/store/m5gj443yzg81163fncw1rb58c81kz8rl-p4-16-mode-0.3.tar")
  (progn (setq package-user-dir elpa) (elpa2nix-install-file archive))
  (let ((archive x0) (elpa x2)) (progn (setq package-user-dir elpa) (elpa2nix-install-file archive)))
  (if (null x3) (let ((archive x0) (elpa x2)) (progn (setq package-user-dir elpa) (elpa2nix-install->
  (let* ((x2 (car-safe x1)) (x3 (cdr-safe x1))) (if (null x3) (let ((archive x0) (elpa x2)) (progn (>
  (if (consp x1) (let* ((x2 (car-safe x1)) (x3 (cdr-safe x1))) (if (null x3) (let ((archive x0) (elp>
  (let* ((x0 (car-safe command-line-args-left)) (x1 (cdr-safe command-line-args-left))) (if (consp x>
  (if (consp command-line-args-left) (let* ((x0 (car-safe command-line-args-left)) (x1 (cdr-safe com>
  elpa2nix-install-package()
  command-line-1(("-l" "/nix/store/4jj63z4v1xp13rh2md053dccq920hd45-elpa2nix.el" "-f" "elpa2nix-inst>
  command-line()
  normal-top-level()
Wrong type argument: arrayp, nil

Additional context

Directly installing this package from within Emacs (using package-install) does not cause this error.

The execution leading to this build error is:

  1. elpa2nix-install-from-buffer in elpa2nix.el calls (package-tar-file-info)
  2. ... which calls package--description-file on the unpacked directory name (p4-16-mode-0.3)
  3. ... which parses this name to get the "package name" and append -pkg.el to get the "package description file name"
  4. but wrongly thinks the "package name" is "p4" instead of "p4-16-mode", and looks for p4-pkg.el (instead of p4-16-mode-pkg.el), which does not exist.

Notify maintainers

@AndersonTorres @jian-lin


Add a :+1: reaction to issues you find important.

AndersonTorres commented 5 months ago

Most certainly the parser conflates 16 as a version number.