Open puffnfresh opened 6 years ago
I would use haskell.lib.justStaticExecutables
here, my 2c
I see the same with elm and elm-format:
error: packages '/nix/store/sy70d8694bzb5zmcya8f085ha7mjyfry-elm-0.19.0/lib/links/libHStransformers-compat-0.6.2-DR0vsQLKu2k3Tes0C8KQG1-ghc8.2.2.dylib' and '/nix/store/qspdc70dh6hqhv3svmsq20mbqwfnjc53-elm-format-0.8.1/lib/links/libHStransformers-compat-0.6.2-DR0vsQLKu2k3Tes0C8KQG1-ghc8.2.2.dylib' have the same priority 5; use 'nix-env --set-flag priority NUMBER INSTALLED_PKGNAME' to change the priority of one of the conflicting packages (0 being the highest priority)
Elm was fixed, for haskell this awaits multiple outputs split of bin
.
I noticed that on the nixpkgs-unstable
channel at 20.03pre192821.b425012fdf4
, Brian's installation problem is resolved.
$ nix-env -f '<nixpkgs>' -iA haskellPackages.pointfree haskellPackages.ghcid
installing 'pointfree-1.1.1.5'
installing 'ghcid-0.7.5'
$
I found this issue because I had a similar problem:
$ nix-env -f '<nixpkgs>' -iA haskellPackages.hindent haskellPackages.brittany
installing 'hindent-5.3.1'
installing 'brittany-0.12.0.0'
building '/nix/store/kcxahsm7wdw9slrz1lgsk1qxc86a7hrd-user-environment.drv'...
error: packages '/nix/store/r1is2997yll2mdfyjl8kmh4k5wvb7hjy-hindent-5.3.1/lib/links/libHShashable-1.2.7.0-DVIM6jhr9aVIFByzF7F0EB-ghc8.6.5.dylib' and '/nix/store/3d0y0c9wvxby0j7qm3l860czpyxdhs17-brittany-0.12.0.0/lib/links/libHShashable-1.2.7.0-DVIM6jhr9aVIFByzF7F0EB-ghc8.6.5.dylib' have the same priority 5; use 'nix-env --set-flag priority NUMBER INSTALLED_PKGNAME' to change the priority of one of the conflicting packages (0 being the highest priority)
builder for '/nix/store/kcxahsm7wdw9slrz1lgsk1qxc86a7hrd-user-environment.drv' failed with exit code 1
error: build of '/nix/store/kcxahsm7wdw9slrz1lgsk1qxc86a7hrd-user-environment.drv' failed
I followed @andreabedini's suggestion and can get a shell with hindent
and brittany
:
$ nix-shell --packages 'haskell.lib.justStaticExecutables haskellPackages.hindent''haskell.lib.justStaticExecutables haskellPackages.brittany'
However, if using a shell, the following works as well:
$ nix-shell --packages haskellPackages.hindent haskellPackages.brittany
I found that haskell.lib.justStaticExecutables
can be used without error in an overlay:
brittany = self.haskell.lib.justStaticExecutables self.haskellPackages.brittany;
hindent = self.haskell.lib.justStaticExecutables self.haskellPackages.hindent;
I was wondering if it's possible to use haskell.lib.justStaticExecutables
with nix-env -i
to install into the user's profile?
I'd like to understand these problems better. @domenkozar, is there an issue for "multiple output splits of bin"? I found a few closed issues and pull requests. #43795 seems to be related.
Try using self.haskell.lib.enableSeparateBinOutput
and grep nixpkgs where it's applied for ghcid
. Same could be used for the rest of haskell packages.
Thanks, @domenkozar, that works in my Haskell overlay. I can now simply install with nix-env -iA nixpkgs.brittany nixpkgs.hindent
.
Is it preferable to use enableSeparateBinOutput
over justStaticExecutables
? Both seem to work equally well for my use case.
The difference is:
justStaticExecutables creates a new derivation by telling haskell not to compile the library part and just removing all the rest
enableSeparateBinOutput tells haskell build system to put executables into separate output, so the package doesn't need to build twice (once for libraries and once for cli usage)
I've had the same problem, but with a conflict between stack and cabal-install.
An interesting thing is that both are symlinks that point to the same file. If nix would look at where symlinks point during a conflict, these problems would go away.
Is there any resolution to this issue and is it really as simple as pointing symlinks to the same place? I'm having to override libraries for every package because of conflicts between haskell library dylibs.
For instance, I am trying to install regex-base and regex-posix. The dylib they are complaining about is the same file with the same hash: DXu8ShLVgKTKig28mYwARV-ghc8.8.3.dylib
Is this not supposed to be the type of scenario at which nix excels?
@xave Both of those are libraries without executables and should be installed with haskellPackages.ghcWithPackages (p: [ p.regex-base p.regex-posix ])
, otherwise ghc won't detect them anyways. For executables, the trick is to use haskell.lib.justStaticExecutables haskellPackages.programName
as mentioned above.
But yes, I agree that it is a bit annoying.
I marked this as stale due to inactivity. → More info
Issue description
I told my coworker they might want to use
haskellPackages.pointfree
andhaskellPackages.ghcid
.Steps to reproduce
Technical details
Mac OS X 10.13.3