nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.09k stars 1.83k forks source link

bug: Collision during build when multiple flutter based packages are added in home.packages #5173

Open adtya opened 7 months ago

adtya commented 7 months ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

When more than one flutter based packages are added through home.packages, build fails with collision between files from the packages. This does not happen when the same packages are added through users.users.<name>.packages or environment.systemPackages

example with home.packages = [ pkgs.localsend pkgs.fluffychat ]

error: builder for '/nix/store/z7qx8d0g4shim69kjcpcpnc17widyw9m-home-manager-path.drv' failed with exit code 25;                                                            
       last 1 log lines:                                                                                                                                                    
       > error: collision between `/nix/store/qjxvadw1d63356sk1381s2klj06xkjq3-localsend-1.14.0/app/data/flutter_assets/AssetManifest.bin' and `/nix/store/1vwwz4kkjcbn9d6g4
d7ncbmlyyrbmlpq-fluffychat-linux-1.18.0/app/data/flutter_assets/AssetManifest.bin'                                                                                          
       For full logs, run 'nix log /nix/store/z7qx8d0g4shim69kjcpcpnc17widyw9m-home-manager-path.drv'.                                                                      
error: 1 dependencies of derivation '/nix/store/82pjm6d2sb48866imkf6b5qdqg2f72i4-home-manager-generation.drv' failed to build                                               
error: 1 dependencies of derivation '/nix/store/399wbzr70n0hq918j6sg86bzqgmxscdx-user-environment.drv' failed to build                                                      
error: 1 dependencies of derivation '/nix/store/0ajaliqvbaynp3kw00ki95gk5bmwn712-etc.drv' failed to build                                                                   
error: 1 dependencies of derivation '/nix/store/1xq6z4wq7jm6lhxml0289wyzcbsgf4xp-etc.drv' failed to build                                                                   
error: 1 dependencies of derivation '/nix/store/s7xss2ldv3g7cr6mcm8gpa69wm1gv2nz-etc.drv' failed to build                                                                   
error: 1 dependencies of derivation '/nix/store/0k074zzww8p4mgkm200j3m0s7nbhaiz1-nixos-system-Skipper-24.05.20240321.20f77aa.drv' failed to build

example with home.packages = [ pkgs.fluffychat pkgs.yubioath-flutter ]

error: builder for '/nix/store/k26yxyv3yxyb0yc1qcvijanp8gk49hs2-home-manager-path.drv' failed with exit code 25;
       last 1 log lines:
       > error: collision between `/nix/store/4kbvygf17yx0jasvviypms1py0as51f6-yubioath-flutter-6.4.0/app/data/flutter_assets/AssetManifest.bin' and `/nix/store/1vwwz4kkjcbn9d6g4d7ncbmlyyrbmlpq-fluffychat-linux-1.18.0/app/data/flutter_assets/AssetManifest.bin'
       For full logs, run 'nix log /nix/store/k26yxyv3yxyb0yc1qcvijanp8gk49hs2-home-manager-path.drv'.
error: 1 dependencies of derivation '/nix/store/w90jm62v7b23c26cms6vyn2fw7vhra40-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/m4wsqfnydj0091acxp1h8kg6lk7a5j33-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/6c1f7wjnc1bamk5803l7dia09pvfabn2-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/maxdyj3ig85ncbq3s27nq6akz8fci3ds-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ywfkcniaamn37p3v34qv457ipw150g74-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/vrn1pqqf1ppkbm7rygrcf0xw96206h80-nixos-system-Skipper-24.05.20240321.20f77aa.drv' failed to build

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.8.1, NixOS, 24.05 (Uakari), 24.05.20240321.20f77aa`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/etc/nix/inputs/nixpkgs`
Aleksanaa commented 6 months ago

Also hit this.

nixos-discourse commented 5 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/home-manager-collision-between-fluffychat-and-yubioath-flutter/47219/2

nixos-discourse commented 4 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/brainstorming-for-rfc-assimilate-home-manager-into-nixpkgs-monorepo/48230/5

nixos-discourse commented 2 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/home-manager-collision-with-app-lib/51969/3

derjohn commented 1 month ago

I hit that bug with localsend and rustdesk-flutter .... found a workaround in the discource link above. Any ideas if there will be a right solution available instead of ugly kludge ?

gungun974 commented 1 month ago

I'm got the same Issue with localsend and my WIP flutter based music player.

I see there was some idea to temporary fix it but right now since I'm the only user / developer of my App.

I cheat by moving in my postFixup the /app to a sub directory, everything seem to works fine with the moving path (note I recreate the wrap).

But I still think this issue is annoying since custom sub directory in /app is not the norm of buildFlutterApplication