Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collision ? #4

Open
asmodehn opened this issue Nov 21, 2018 · 2 comments
Open

collision ? #4

asmodehn opened this issue Nov 21, 2018 · 2 comments

Comments

@asmodehn
Copy link

Using this overlay (via (python36.withPackages (ps: with ps; [ azure-cli ])) in buildInputs of a mkShell derivation), I get a collision between two azure-cli related packages :

building '/nix/store/yq8yalq8ad864jh9ljq0y61914n1qfx1-python3-3.6.6-env.drv'...
collision between `/nix/store/gw491p587z32mlrm122xc8vsq5snldq3-python3.6-azure-cli-extension-0.2.1/lib/python3.6/site-packages/azure/cli/__pycache__/__init__.cpython-36.pyc' and `/nix/store/f740dpb3g8qi8g166cc80xqkkkr99gyg-python3.6-azure-cli-core-2.0.43/lib/python3.6/site-packages/azure/cli/__pycache__/__init__.cpython-36.pyc'
builder for '/nix/store/yq8yalq8ad864jh9ljq0y61914n1qfx1-python3-3.6.6-env.drv' failed with exit code 25
error: build of '/nix/store/yq8yalq8ad864jh9ljq0y61914n1qfx1-python3-3.6.6-env.drv' failed

Using it with (with python36Packages; [ azure-cli ]) installs fine however, but breaks on usage :

[nix-shell:~]$ az
/nix/store/bwfygfcdvis9wd1c1v51xwnwhw1hx0a0-python3-3.6.6/bin/python: No module named azure.cli

Any hint ?

@asmodehn
Copy link
Author

Since this is a namespace package, the proper way to do things (given how nix messes around with PYTHONPATH) is to have all the package in the same site-packages location.
I would advise a deeper look at importlib to figure out how python's import works.

And apparently this does work (thanks @duog ):

{pkgs ? import <nixpkgs> {
 overlays = [ (import ./nix/azure-cli-nix) ];
}}: let
 python = pkgs.python36.buildEnv.override {
   extraLibs = with pkgs.python36Packages; [ azure-cli];
   ignoreCollisions = true;
} ;

in pkgs.mkShell {
 name = "env";
 buildInputs = [ python ];
}

Next step would be figuring out where the collisions come from exactly...

@asmodehn
Copy link
Author

I accidentally noticed that current nixpkgs solves this problem slightly differently : https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/azure-mgmt-compute/default.nix#L24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant