NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.3k stars 13.54k forks source link

Build failure: tensorflow collision #323965

Open zimbatm opened 2 months ago

zimbatm commented 2 months ago

Steps To Reproduce

$ nix repl
Welcome to Nix 2.18.2. Type :? for help.

nix-repl> :l .                                                               
Added 21850 variables.

nix-repl> :b python3Packages.python.withPackages (p: [p.tensorflow p.torch])

Build log

error: builder for '/nix/store/3h3mak3wv1nylnilm7skwzrh9651na84-python3-3.11.9-env.drv' failed with exit code 25;
       last 1 log lines:
       > error: collision between `/nix/store/v06wfm1b8iijkm1pk6p5ick7xsvpx574-python3.11-tensorboard-2.16.2/bin/.tensorboard-wrapped' and `/nix/store/gaxcj0yb0vm41ykipgn25s8v53i1cq3m-python3.11-tensorboard-2.16.2/bin/.tensorboard-wrapped'
       For full logs, run 'nix log /nix/store/3h3mak3wv1nylnilm7skwzrh9651na84-python3-3.11.9-env.drv'.

Additional context

The root cause is that tensorflow comes with its own dimension of python packages caused by these overrides here:

https://github.com/zimbatm/nixpkgs/blob/a128565b55085166b20cfbb0a6bcaa736d96630e/pkgs/top-level/python-packages.nix#L15045-L15090

So it's impossible to mix and match tensorflow and torch, or any other python package depending on tensorboard.

Notify maintainers

@abbradar

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.32, NixOS, 24.11 (Vicuña), 24.11.20240529.c598bbf`
 - multi-user?: `yes`
 - sandbox: `relaxed`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/home/zimbatm/go/src/github.com/NixOS/nixpkgs`

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

stephen-huan commented 1 month ago

I describe possible workarounds in https://github.com/NixOS/nixpkgs/issues/329378#issuecomment-2247861665, but a good solution for this seems tricky.