Emacs-python-mode "marked as broken", can't rebuild NixOS config

MELPA’s ‘python-mode’ has been part of my config for over a year. Recently I became unable to run nixos-rebuild. The process fails as follows:

[jeff@jbb-dell:~/nix/jbb-config]$ sudo nixos-rebuild switch
[sudo] password for jeff:
unpacking 'https://github.com/nix-community/emacs-overlay/archive/master.tar.gz'...
building Nix...
building the system configuration...
error: Package ‘emacs-python-mode-20210408.800’ in /nix/store/kjrl5mryx1z9nmgsznn5b7wgpgrnq7s9-nixos-20.09.3925.63adedf6319/nixos/pkgs/applications/editors/emacs-modes/libgenerated.nix:72 is marked as broken, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

(use '--show-trace' to show detailed location information)

[jeff@jbb-dell:~/nix/jbb-config]$

I can’t imagine I’m the only Emacs & Python user who’s needed to rebuild their system since it broke a few weeks ago. What is the appropriate response? Should I use some other package? Where is the reason for a package being marked as broken usually documented?

Melpa packages are generated dynamically, the ‘broken’ flag comes from that generation process.

Looks like at the time that the melpa packages was generated gitlab returned a 503 for the python-mode repo.

from: (warning, big text file) https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/applications/editors/emacs-modes/recipes-archive-melpa.json

{
  "ename": "python-mode",
  "commit": "82861e1ab114451af5e1106d53195afd3605448a",
  "sha256": "1m7c6c97xpr5mrbyzhcl2cy7ykdz5yjj90mrakd4lknnsbcq205k",
  "fetcher": "gitlab",
  "repo": "python-mode-devs/python-mode",
  "unstable": {
   "version": [
    20210408,
    800
   ],
   "commit": "710ffadeb43136d400de0a4c9e4a94c8b7ff36f0",
   "error": [
    "exited abnormally with code 1\n",
    "",
    "warning: unknown setting 'experimental-features'\nwarning: unable to download 'https://gitlab.com/python-mode-devs/python-mode/repository/archive.tar.gz?ref=710ffadeb43136d400de0a4c9e4a94c8b7ff36f0': HTTP error 503; retrying in 326 ms\nwarning: unable to download 'https://gitlab.com/python-mode-devs/python-mode/repository/archive.tar.gz?ref=710ffadeb43136d400de0a4c9e4a94c8b7ff36f0': HTTP error 503; retrying in 558 ms\nwarning: unable to download 'https://gitlab.com/python-mode-devs/python-mode/repository/archive.tar.gz?ref=710ffadeb43136d400de0a4c9e4a94c8b7ff36f0': HTTP error 503; retrying in 1272 ms\nwarning: unable to download 'https://gitlab.com/python-mode-devs/python-mode/repository/archive.tar.gz?ref=710ffadeb43136d400de0a4c9e4a94c8b7ff36f0': HTTP error 503; retrying in 2702 ms\nerror: unable to download 'https://gitlab.com/python-mode-devs/python-mode/repository/archive.tar.gz?ref=710ffadeb43136d400de0a4c9e4a94c8b7ff36f0': HTTP error 503\n"
   ]
  },
  "stable": {
   "version": [
    6,
    2,
    3
   ],
   "commit": "a0a534639bc6142c2c2f44bd7ca5878ad5f79518",
   "sha256": "0sj2hfjwpcdg9djsgl3y5aa3gnvl4s87477x6a9d14m11db3p7ml"
  }
 }

I assume the fix is to regenerate melpa packages (or just the python-mode one) and submit a PR, but I’m not sure how to do that exactly.

I tried to use the ‘update-melpa’ script, but I got loads of 503s from various Gitlab projects as well. I wonder if this PR fixes the updater: Update emacs2nix and update-melpa.el by kennyballou · Pull Request #120354 · NixOS/nixpkgs · GitHub

Since that PR was merged, I created emacs.pkgs: 2021-05-03 by mattchrist · Pull Request #121632 · NixOS/nixpkgs · GitHub that fixes python-mode (among other updates).

1 Like