mach-nix: error: infinite recursion encountered, 'dateutil', 'python-dateutil'

I have ./default.nix

let
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix/";
    ref = "refs/tags/3.0.0";
  }) {};
in
mach-nix.buildPythonPackage {
  src = "https://github.com/twintproject/twint/archive/v2.1.4.tar.gz";
}

I build with nix-build and getting this error:

❯ nix-build
unpacking 'https://github.com/nixos/nixpkgs/tarball/41c0f49681009ceb57a65b7cd7d4e6d605df712c'...
unpacking 'https://github.com/DavHau/pypi-deps-db/tarball/d6ca2a67a76f98f168d5c6414f1fbc311b464bdf'...
warning: dumping very large path (> 256 MiB); this may run out of memory
unpacking 'https://github.com/twintproject/twint/archive/v2.1.4.tar.gz'...
copying path '/nix/store/xxl9nhy71gnsg2fcqrdwj108fhgi9n6z-adv_cmds-osx-10.5.8-locale' from 'https://cache.nixos.org'...
copying path '/nix/store/9vkb3rbsj4cy92qj25yxmbak01g5iaxq-unzip-6.0' from 'https://cache.nixos.org'...
.
..
...

pandas - 0.25.3 - sdist
├── numpy - 1.17.5 - sdist
├── numpy - 1.17.5 - sdist
├── python-dateutil - 2.7.1 - sdist
│   ├── setuptools-scm - 4.1.2 - nixpkgs
│   └── six - 1.15.0 - sdist
└── pytz - 2020.1 - sdist

aiohttp-socks - 0.3.9 - nixpkgs

schedule - 0.6.0 - sdist

geopy - 2.0.0 - sdist
└── geographiclib - 1.50 - sdist

fake-useragent - 0.1.11 - nixpkgs

Multiple nixkgs attributes found for python-dateutil-2.7.1: ['dateutil', 'python-dateutil']
Picking 'dateutil' as base attribute name.
unpacking 'https://github.com/DavHau/nix-pypi-fetcher/tarball/22aa55de07c3c2fc0afc8ec274082ccb66ed9393'...
error: infinite recursion encountered, at /nix/store/4in2fprhpxnbrrwh0pfn961n7x915fps-nixpkgs/pkgs/top-level/python-packages.nix:5688:3
(use '--show-trace' to show detailed location information)

The error points to this part of /nix/store/4in2fprhpxnbrrwh0pfn961n7x915fps-nixpkgs/pkgs/top-level/python-packages.nix:5688:

.
..
...
  python-daemon = callPackage ../development/python-modules/python-daemon { };

❯ python-dateutil = callPackage ../development/python-modules/dateutil { };
  # Alias that we should deprecate
  dateutil = self.python-dateutil;

  python-dbusmock = callPackage ../development/python-modules/python-dbusmock { };
...
..
.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

Hey, I just noticed that the wheel selection for macos is broken, therefore the resolver didn’t pick any wheel releases, falling back to sdist which sometimes can be troublesome. I fixed the issue and added some unit tests for it. This one should work now:

let
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix";
    ref = "refs/heads/master";
    rev = "3acbfc2ebd0b826cd046925493714a5e2f146d73";
  }) {};
in
mach-nix.buildPythonPackage {
 src = "https://github.com/twintproject/twint/tarball/ae5e7e1189be1c";
 overridesPre = [(
    pySelf: pySuper: {
      dateutil = null;
    }
 )];
}

In the meantime you can remove the duplicated dateutil from nixpkgs via an override:

let
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix";
    ref = "master";
    rev = "ffd51659df279b809d44c71855c57dbb58a105ea";
  }) {};
in
mach-nix.buildPythonPackage {
 src = "https://github.com/twintproject/twint/tarball/ae5e7e1189be1c";
 overridesPre = [(
    pySelf: pySuper: {
      dateutil = null;
    }
 )];
}