collision between `/nix/store/qr9rrhalxbi1x914xj0hh9y73sfn1p3l-python2.7-backports.ssl_match_hostname-3.5.0.1/lib/python2.7/site-packages/backports/__init__.py' and `/nix/store/lazj5zfz9ysbadlrjwnzj4aa1znff7ff-python2.7-backports.shutil_get_terminal_size-1.0.0/lib/python2.7/site-packages/backports/__init__.py'
nixos-version, Ubuntu/Fedora: lsb_release -a, ...)nix-env --version)nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)What caused this to happen? Can you provide steps to reproduce the issue, and version details, as in the issue template?
Looks to be a similar issue as https://github.com/NixOS/nixpkgs/issues/22311 so I am closing this. As @lheckemann said you need to give more details.
@FRidh the issue is different - the problem is setuptools namespace packages generating namespace declaring __init__.py files - now if you merge the file tree of 2 of those, both will have a __init__.py with the same content
$ nix-build -E '((import <nixpkgs> {}).python.withPackages (ps: [ps.backports_ssl_match_hostname ps.backports_shutil_get_terminal_size]))'
these derivations will be built:
/nix/store/cp5p81j8mk94jhjy55q6aip67vld3qxi-python-2.7.13-env.drv
building path(s) ‘/nix/store/wdh53zgsjfcw9zscy6mw9iq01cgwcgsb-python-2.7.13-env’
collision between `/nix/store/qr9rrhalxbi1x914xj0hh9y73sfn1p3l-python2.7-backports.ssl_match_hostname-3.5.0.1/lib/python2.7/site-packages/backports/__init__.py' and `/nix/store/lazj5zfz9ysbadlrjwnzj4aa1znff7ff-python2.7-backports.shutil_get_terminal_size-1.0.0/lib/python2.7/site-packages/backports/__init__.py'
builder for ‘/nix/store/cp5p81j8mk94jhjy55q6aip67vld3qxi-python-2.7.13-env.drv’ failed with exit code 25
error: build of ‘/nix/store/cp5p81j8mk94jhjy55q6aip67vld3qxi-python-2.7.13-env.drv’ failed
According to PEP 420 namespace packages shouldn't have an __init__.py
The __init__.py refers to PEP 382 which was rejected and was eventually replaced by PEP 420. Therefore, this is an upstream issue.
Even so, we could have a look at how to fix it for now.
I've reported the issue on the tracker of both packages:
@FRidh pep420 doesn't apply to python2.7 - this is setuptools namespaces that need the file
Indeed, you're right.
I don't see any other solution than using python.buildEnv.override and passing ignoreCollisions = true;.
What we're seeing here is exactly the reason PEP 420 exists.
Closing because there isn't much else we can do here.
Most helpful comment
Indeed, you're right.
I don't see any other solution than using
python.buildEnv.overrideand passingignoreCollisions = true;.What we're seeing here is exactly the reason PEP 420 exists.