Closed lilyball closed 3 years ago
Sounds typical, but nixpkgs consumers should be using https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/purescript/psc-package/default.nix from all-packages if they're not overriding what package set is used. I'll take a PR for this, but building from haskellPackages is not a priority for me.
I was using that. nix-build -A psc-package
from the root of the nixpkgs repo is what produced the above failure.
okay looks like someone fucked this up https://github.com/NixOS/nixpkgs/blob/04a0ff8cc5ce2991787960bac539799192d1b043/pkgs/top-level/all-packages.nix#L8335-L8336
sorry, i realized i did not change over this derivation. could you make a PR to nixpkgs to replace the all-packages derivation with https://github.com/justinwoo/easy-purescript-nix/blob/master/psc-package-simple.nix? you will basically need to copy paste this derivation into nixpkgs and just add a comment linking to the original repo
i also did write about this same problem with purescript a while back: https://github.com/justinwoo/my-blog-posts/blob/master/posts/2019-04-29-why-easy-purescript-nix.md
I just took a look at https://github.com/justinwoo/easy-purescript-nix/blob/master/psc-package-simple.nix and it doesn't have a meta
section at all, which nixpkgs will need. It's also set up src
to either be mac or linux, which suggests it has a restricted set of platforms (but looking at https://github.com/purescript/psc-package/releases/tag/v0.6.2 it seems as though it should support windows as well).
And is it really appropriate to be downloading what appears to be a prebuilt binary and then just changing a few linker paths, especially since this means it's now linking against libraries other than what it was built with? Is libiconv forwards-compatible at runtime? Why should we not be compiling from source instead?
I tried downgrading the version of GHC to use for building psc-package using haskellPackages
and it's not working. I guess the MonadFail
thing went into 8.8.1 so I went to 8.6.5 and now it fails with
Setup: Encountered missing dependencies:
base-compat >=0.10.5 && <0.11
Given my reservations about the easy-purescript-nix approach, I'm not sure what the right solution is right now, beyond having psc-package update for MonadFail
.
And is it really appropriate to be downloading what appears to be a prebuilt binary and then just changing a few linker paths, especially since this means it's now linking against libraries other than what it was built with? Is libiconv forwards-compatible at runtime? Why should we not be compiling from source instead?
I've written about this in my post above and spent years talking to people about this to fix what is used for the PureScript compiler, with others' agreement. Please understand that I don't want to try to argue about this any more.
I believe you might also look towards some previous haskellPackages purescript solution in the end also, where you use one of the "pinned ghc versions" to somewhat guarantee a static set of libraries that will build.
I read your linked post but it doesn't explain why it should be safe to replace the version of libiconv used at runtime from the one used at build time.
As for pinning the version of haskell, I tried the following patch:
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index cf5f169933e..8da8eb7d304 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -8343,8 +8343,14 @@ in
purescript = callPackage ../development/compilers/purescript/purescript { };
- psc-package = haskell.lib.justStaticExecutables
- (haskellPackages.callPackage ../development/compilers/purescript/psc-package { });
+ psc-package = let
+ # psc-package is not compatible with GHC 8.8
+ # See https://github.com/purescript/psc-package/issues/165
+ haskellPackages = haskell.packages.ghc865;
+ in haskell.lib.justStaticExecutables
+ (haskellPackages.callPackage ../development/compilers/purescript/psc-package {
+ inherit haskellPackages;
+ });
purescript-psa = nodePackages.purescript-psa;
This produced the failure above (missing base-compat
).
Yes, sorry, I missed that detail. Does this also not work with allowing "jailbreaks", if it's just a result of version bounds?
I'm not a Haskell developer, so I don't know what you mean by "jailbreaks" or how I'd test that. I care about psc-package
because it's blocking my ability to install insect
.
Maybe @mwu knows specifically what is needed with libiconv https://github.com/justinwoo/easy-purescript-nix/commit/4176669b3d1ecf17b56e1a88295c7c9e9933fcaa#diff-49720a993c4fd8fb2db87822ea9ab0f4R32-R38.
After digging into this some more, Catalina is providing libiconv 2.4.0 and the macOS 10.12.6 SDK (which is what Nix currently uses) also has version 2.4.0 of libiconv. So at least for the time being it may be safe to do this anyway. I'm still concerned about long-term forwards/backwards compatibility, but perhaps this is the right path forward for the short term.
I submitted https://github.com/NixOS/nixpkgs/pull/82964 to adopt the easy-purescript-nix approach.
Thanks!
Experimentally it looks like psc-package
also supports --fish-completion-script
and --zsh-completion-script
flags, so I'm going to update my PR to use those too. You may want to do the same with easy-purescript-nix.
FWIW this might be more pressing now that purescript 0.14.1 is out which supports ghc 8.10
Out of curiosity I made an attempt to update the homebrew psc-package formula to build against its current ghc stack now that it's been updated to purescript 0.14.1. Unsurprisingly, still has the same build error.
Fixed upstream in nixpkgs.
With the current set of Nix packages,
psc-package
fails to compile. I don't really understand what's going on but the error appears to be due to MonadFail: https://gitlab.haskell.org/ghc/ghc/wikis/migration/8.8#base-41300I found a PR for spago that fixes what I believe to be the same issue: https://github.com/purescript/spago/pull/584
The error I'm getting right now looks like