purescript / psc-package

A package manager for PureScript based on package sets
https://psc-package.readthedocs.io
Other
229 stars 45 forks source link

Compilation failure with GHC 8.8 #165

Closed lilyball closed 3 years ago

lilyball commented 4 years ago

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-41300

I 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

$ nix-build -A psc-package
[…]
Building executable 'psc-package' for psc-package-0.6.2..
[1 of 3] Compiling Paths_psc_package ( dist/build/psc-package/autogen/Paths_psc_package.hs, dist/build/psc-package/psc-package-tmp/Paths_psc_package.o )
[2 of 3] Compiling Types            ( app/Types.hs, dist/build/psc-package/psc-package-tmp/Types.o )

app/Types.hs:34:18: error:
    • Could not deduce (MonadFail m) arising from a use of ‘fail’
      from the context: Monad m
        bound by the type signature for:
                   fromText :: forall (m :: * -> *). Monad m => Text -> m PackageName
        at app/Types.hs:30:1-44
      Possible fix:
        add (MonadFail m) to the context of
          the type signature for:
            fromText :: forall (m :: * -> *). Monad m => Text -> m PackageName
    • In the expression: fail $ "Invalid package name: " <> show errs
      In a case alternative:
          Left errs -> fail $ "Invalid package name: " <> show errs
      In the expression:
        case mkPackageName t of
          Right pkgName -> pure pkgName
          Left errs -> fail $ "Invalid package name: " <> show errs
   |
34 |     Left errs -> fail $ "Invalid package name: " <> show errs
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

builder for '/nix/store/daf2d9jdggmz4w93490zzlyinnh4f8pd-psc-package-0.6.2.drv' failed with exit code 1
error: build of '/nix/store/daf2d9jdggmz4w93490zzlyinnh4f8pd-psc-package-0.6.2.drv' failed
justinwoo commented 4 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.

lilyball commented 4 years ago

I was using that. nix-build -A psc-package from the root of the nixpkgs repo is what produced the above failure.

justinwoo commented 4 years ago

okay looks like someone fucked this up https://github.com/NixOS/nixpkgs/blob/04a0ff8cc5ce2991787960bac539799192d1b043/pkgs/top-level/all-packages.nix#L8335-L8336

justinwoo commented 4 years ago

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

justinwoo commented 4 years ago

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

lilyball commented 4 years ago

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?

lilyball commented 4 years ago

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
Full output: ``` these derivations will be built: /nix/store/czp05bcvc7q62m3iryljrr9jq1narv74-tasty-ant-xml-1.1.6.drv /nix/store/s6mzwx2djj0438z8v2x88jrfbifq16na-scientific-0.3.6.2.drv /nix/store/482dmsykwsz5fr0gpff6wjsa2l78v2yv-attoparsec-0.13.2.3.drv /nix/store/lw31zzljpchaxm8kc961ld2nhycp9ssf-time-compat-1.9.2.2.drv /nix/store/qryxcwj29sj1v2sm78nf5ppgjv7lffw3-uuid-types-1.0.3.drv /nix/store/7xfh5ck69qi3ga620i8mygvizx2cd6jn-quickcheck-instances-0.3.22.drv /nix/store/4px1by7kq1l7csx442l1nyrkq5df8ayf-comonad-5.0.6.drv /nix/store/ky6akzlc4dv88crinfrq057ayinkpwnx-bifunctors-5.5.7.drv /nix/store/c85ksb3hsdh1ayjbzqi9xgs6qmi9ysb6-semigroupoids-5.3.4.drv /nix/store/rjxcbhdrdv2j0v2sf4h9nps8kbmfs8zl-profunctors-5.5.2.drv /nix/store/ghl9ahzmlh38l12ib072iygk2ix7x7jq-either-5.0.1.1.drv /nix/store/j8hxb5ywm1arzan8s0vs2p41rljvr4j6-cryptohash-sha1-0.11.100.1.drv /nix/store/whan21l9sifl0dvnyn4qkys4ridsbai2-pureMD5-2.1.3.drv /nix/store/vb57652qd36824h000snwmnwlbnh5z17-cryptohash-md5-0.11.100.1.drv /nix/store/knih6dgxjvqr9w3d4z3884a39ipf18ff-uuid-1.3.13.drv /nix/store/yj7b857yacp5iajjj5yaxp0989mh0n1h-rebase-1.4.1.drv /nix/store/mw4wikykghjr2i0g3vsznl654y8vdzzr-rerebase-1.4.1.drv /nix/store/0jic6vp5fc0qmqddai30fshxlvq9xjby-vector-builder-0.3.8.drv /nix/store/c8fq82j7rrdrrgr9wj21wh0fzpg5hyn8-aeson-1.4.6.0.drv /nix/store/iqh86n5alfl28nqd44895vg2bk3xjsd5-math-functions-0.3.3.0.drv /nix/store/i29wnj1pg1jvggr5aah92mghakr2xhb0-mwc-random-0.14.0.0.drv /nix/store/mrnvn2jgqp5y1iwmc0a69ljfdcbm86zs-foldl-1.4.6.drv /nix/store/ncmpplpcjlhv89jxg0scygpqadjcvh7y-turtle-1.5.16.drv /nix/store/wffi8vw5smdxacl50xcj1fc1x3rk3nl8-aeson-pretty-0.8.8.drv /nix/store/nbphxf8gbf7rdx6zgn5pgdpl6czj0gm2-psc-package-0.6.2.drv building '/nix/store/lw31zzljpchaxm8kc961ld2nhycp9ssf-time-compat-1.9.2.2.drv'... building '/nix/store/qryxcwj29sj1v2sm78nf5ppgjv7lffw3-uuid-types-1.0.3.drv'... building '/nix/store/4px1by7kq1l7csx442l1nyrkq5df8ayf-comonad-5.0.6.drv'... building '/nix/store/czp05bcvc7q62m3iryljrr9jq1narv74-tasty-ant-xml-1.1.6.drv'... building '/nix/store/iqh86n5alfl28nqd44895vg2bk3xjsd5-math-functions-0.3.3.0.drv'... building '/nix/store/j8hxb5ywm1arzan8s0vs2p41rljvr4j6-cryptohash-sha1-0.11.100.1.drv'... building '/nix/store/whan21l9sifl0dvnyn4qkys4ridsbai2-pureMD5-2.1.3.drv'... setupCompilerEnvironmentPhase Build with /nix/store/fkvy4xnan95gd1rvgi24v3980606a4il-ghc-8.6.5. setupCompilerEnvironmentPhase Build with /nix/store/fkvy4xnan95gd1rvgi24v3980606a4il-ghc-8.6.5. setupCompilerEnvironmentPhase Build with /nix/store/fkvy4xnan95gd1rvgi24v3980606a4il-ghc-8.6.5. setupCompilerEnvironmentPhase Build with /nix/store/fkvy4xnan95gd1rvgi24v3980606a4il-ghc-8.6.5. setupCompilerEnvironmentPhase Build with /nix/store/fkvy4xnan95gd1rvgi24v3980606a4il-ghc-8.6.5. setupCompilerEnvironmentPhase Build with /nix/store/fkvy4xnan95gd1rvgi24v3980606a4il-ghc-8.6.5. setupCompilerEnvironmentPhase Build with /nix/store/fkvy4xnan95gd1rvgi24v3980606a4il-ghc-8.6.5. unpacking sources unpacking source archive /nix/store/sf8fpfs6xr994fdbxwnj91y97nm3k1gx-math-functions-0.3.3.0.tar.gz source root is math-functions-0.3.3.0 setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file math-functions-0.3.3.0/tests/tests.hs patching sources compileBuildDriverPhase setupCompileFlags: -package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-math-functions-0.3.3.0.drv-0/setup-package.conf.d -j4 -threaded unpacking sources unpacking source archive /nix/store/kwscj7rp1371lbwv4cprby2dkhcvdcss-comonad-5.0.6.tar.gz source root is comonad-5.0.6 setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file comonad-5.0.6/tests/doctests.hs patching sources compileBuildDriverPhase setupCompileFlags: -package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-comonad-5.0.6.drv-0/setup-package.conf.d -j4 -threaded [1 of 1] Compiling Main ( Setup.hs, /private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-math-functions-0.3.3.0.drv-0/Main.o ) unpacking sources unpacking source archive /nix/store/vsng38wjx5zjyxd14yfllsdbhgk8qf5i-tasty-ant-xml-1.1.6.tar.gz source root is tasty-ant-xml-1.1.6 patching sources compileBuildDriverPhase setupCompileFlags: -package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-tasty-ant-xml-1.1.6.drv-0/setup-package.conf.d -j4 -threaded unpacking sources unpacking source archive /nix/store/0pwr88mvi90y19wwglh92zn27p9haych-uuid-types-1.0.3.tar.gz source root is uuid-types-1.0.3 unpacking sources [1 of 1] Compiling Main ( Setup.lhs, /private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-comonad-5.0.6.drv-0/Main.o ) unpacking source archive /nix/store/zjp39bxn7i40arjs379x6vijc9nan839-time-compat-1.9.2.2.tar.gz Linking Setup ... setting SOURCE_DATE_EPOCH to timestamp 1459626467 of file uuid-types-1.0.3/uuid-types.cabal unpacking sources patching sources unpacking source archive /nix/store/f1zmcpn72qb1vb1hsqpy9l4cq39q3i2b-cryptohash-sha1-0.11.100.1.tar.gz Replace Cabal file with edited version from mirror://hackage/uuid-types-1.0.3/revision/2.cabal. Run jailbreak-cabal to lift version restrictions on build inputs. [1 of 1] Compiling Main ( Setup.hs, /private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-tasty-ant-xml-1.1.6.drv-0/Main.o ) compileBuildDriverPhase setupCompileFlags: -package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-uuid-types-1.0.3.drv-0/setup-package.conf.d -j4 -threaded source root is time-compat-1.9.2.2 source root is cryptohash-sha1-0.11.100.1 setting SOURCE_DATE_EPOCH to timestamp 1467098023 of file cryptohash-sha1-0.11.100.1/src/Crypto/Hash/SHA1.hs setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file time-compat-1.9.2.2/time-compat.cabal patching sources patching sources Replace Cabal file with edited version from mirror://hackage/cryptohash-sha1-0.11.100.1/revision/4.cabal. Replace Cabal file with edited version from mirror://hackage/time-compat-1.9.2.2/revision/2.cabal. Run jailbreak-cabal to lift version restrictions on build inputs. compileBuildDriverPhase setupCompileFlags: -package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-time-compat-1.9.2.2.drv-0/setup-package.conf.d -j4 -threaded compileBuildDriverPhase setupCompileFlags: -package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-cryptohash-sha1-0.11.100.1.drv-0/setup-package.conf.d -j4 -threaded Linking Setup ... unpacking sources unpacking source archive /nix/store/dg5z6d6v7pqg5cdrqm1y9msvbwaz149q-pureMD5-2.1.3.tar.gz [1 of 1] Compiling Main ( Setup.hs, /private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-uuid-types-1.0.3.drv-0/Main.o ) Linking Setup ... source root is pureMD5-2.1.3 setting SOURCE_DATE_EPOCH to timestamp 1462815901 of file pureMD5-2.1.3/pureMD5.cabal patching sources [1 of 1] Compiling Main ( /nix/store/4mdp8nhyfddh7bllbi7xszz7k9955n79-Setup.hs, /private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-time-compat-1.9.2.2.drv-0/Main.o ) compileBuildDriverPhase setupCompileFlags: -package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-pureMD5-2.1.3.drv-0/setup-package.conf.d -j4 -threaded [1 of 1] Compiling Main ( Setup.hs, /private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-cryptohash-sha1-0.11.100.1.drv-0/Main.o ) Linking Setup ... [1 of 1] Compiling Main ( Setup.lhs, /private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-pureMD5-2.1.3.drv-0/Main.o ) Linking Setup ... Linking Setup ... Linking Setup ... configuring configureFlags: --verbose --prefix=/nix/store/lqvy4mwkq1iryvalqr9wd594fvzv04wd-math-functions-0.3.3.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/vlf38v9rhwys155zl1zwvpvh4z88a6gd-math-functions-0.3.3.0-doc/share/doc/math-functions-0.3.3.0 --with-gcc=clang --package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-math-functions-0.3.3.0.drv-0/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --extra-include-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/include --extra-lib-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/lib --extra-include-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/include --extra-lib-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/lib --extra-include-dirs=/nix/store/hhy5g31igqyqg0vrh0k2nzvya8rr3569-compiler-rt-7.1.0-dev/include --extra-lib-dirs=/nix/store/7n9yjfzjxp3b71rj930840w5m1zijsxm-compiler-rt-7.1.0/lib --extra-lib-dirs=/nix/store/izvb1pxcljmwblf8cb6zp2wwzl9m9vr5-ncurses-6.2/lib --extra-lib-dirs=/nix/store/dhywhjyd9kl3bgj2si0flxlaxfb46smz-libffi-3.3/lib --extra-lib-dirs=/nix/store/jf2szj928fn5b0vh72al5myihlg8qfkb-gmp-6.2.0/lib --extra-include-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/include --extra-lib-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/lib --extra-framework-dirs=/nix/store/37ryi8dqw7nlfwvawx0vs8xzxqbcwh52-swift-corefoundation/Library/Frameworks configuring configureFlags: --verbose --prefix=/nix/store/yr760h3kkpdgisb5829xibc6qm58q6a0-comonad-5.0.6 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/mvvy5g1ra9w2gk0mj650lpng3s21dpax-comonad-5.0.6-doc/share/doc/comonad-5.0.6 --with-gcc=clang --package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-comonad-5.0.6.drv-0/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --extra-include-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/include --extra-lib-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/lib --extra-include-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/include --extra-lib-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/lib --extra-include-dirs=/nix/store/hhy5g31igqyqg0vrh0k2nzvya8rr3569-compiler-rt-7.1.0-dev/include --extra-lib-dirs=/nix/store/7n9yjfzjxp3b71rj930840w5m1zijsxm-compiler-rt-7.1.0/lib --extra-lib-dirs=/nix/store/izvb1pxcljmwblf8cb6zp2wwzl9m9vr5-ncurses-6.2/lib --extra-lib-dirs=/nix/store/dhywhjyd9kl3bgj2si0flxlaxfb46smz-libffi-3.3/lib --extra-lib-dirs=/nix/store/jf2szj928fn5b0vh72al5myihlg8qfkb-gmp-6.2.0/lib --extra-include-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/include --extra-lib-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/lib --extra-lib-dirs=/nix/store/fkvy4xnan95gd1rvgi24v3980606a4il-ghc-8.6.5/lib --extra-framework-dirs=/nix/store/37ryi8dqw7nlfwvawx0vs8xzxqbcwh52-swift-corefoundation/Library/Frameworks configuring configureFlags: --verbose --prefix=/nix/store/yb06d51d2sngwqwv69b5fs8fcrzac2li-tasty-ant-xml-1.1.6 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/qvngrv8vmwsk7c6y7dyx4cfc5v2syygs-tasty-ant-xml-1.1.6-doc/share/doc/tasty-ant-xml-1.1.6 --with-gcc=clang --package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-tasty-ant-xml-1.1.6.drv-0/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --extra-include-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/include --extra-lib-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/lib --extra-include-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/include --extra-lib-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/lib --extra-include-dirs=/nix/store/hhy5g31igqyqg0vrh0k2nzvya8rr3569-compiler-rt-7.1.0-dev/include --extra-lib-dirs=/nix/store/7n9yjfzjxp3b71rj930840w5m1zijsxm-compiler-rt-7.1.0/lib --extra-lib-dirs=/nix/store/izvb1pxcljmwblf8cb6zp2wwzl9m9vr5-ncurses-6.2/lib --extra-lib-dirs=/nix/store/dhywhjyd9kl3bgj2si0flxlaxfb46smz-libffi-3.3/lib --extra-lib-dirs=/nix/store/jf2szj928fn5b0vh72al5myihlg8qfkb-gmp-6.2.0/lib --extra-include-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/include --extra-lib-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/lib --extra-framework-dirs=/nix/store/37ryi8dqw7nlfwvawx0vs8xzxqbcwh52-swift-corefoundation/Library/Frameworks configuring configureFlags: --verbose --prefix=/nix/store/vqqpz27p3zn2f8zgb51p0z5i46mrgr5z-uuid-types-1.0.3 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/qcfvay1ydjfqgr5kadr259k44vg6f46j-uuid-types-1.0.3-doc/share/doc/uuid-types-1.0.3 --with-gcc=clang --package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-uuid-types-1.0.3.drv-0/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --extra-include-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/include --extra-lib-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/lib --extra-include-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/include --extra-lib-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/lib --extra-include-dirs=/nix/store/hhy5g31igqyqg0vrh0k2nzvya8rr3569-compiler-rt-7.1.0-dev/include --extra-lib-dirs=/nix/store/7n9yjfzjxp3b71rj930840w5m1zijsxm-compiler-rt-7.1.0/lib --extra-lib-dirs=/nix/store/izvb1pxcljmwblf8cb6zp2wwzl9m9vr5-ncurses-6.2/lib --extra-lib-dirs=/nix/store/dhywhjyd9kl3bgj2si0flxlaxfb46smz-libffi-3.3/lib --extra-lib-dirs=/nix/store/jf2szj928fn5b0vh72al5myihlg8qfkb-gmp-6.2.0/lib --extra-include-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/include --extra-lib-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/lib --extra-framework-dirs=/nix/store/37ryi8dqw7nlfwvawx0vs8xzxqbcwh52-swift-corefoundation/Library/Frameworks configuring configuring configureFlags: --verbose --prefix=/nix/store/1jr3bcm77p52jsc0a382xkwzfkly7q11-cryptohash-sha1-0.11.100.1 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/w5xsyk1blaqqsxv9wkgaaaqv5bzpzxnf-cryptohash-sha1-0.11.100.1-doc/share/doc/cryptohash-sha1-0.11.100.1 --with-gcc=clang --package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-cryptohash-sha1-0.11.100.1.drv-0/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --extra-include-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/include --extra-lib-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/lib --extra-include-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/include --extra-lib-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/lib --extra-include-dirs=/nix/store/hhy5g31igqyqg0vrh0k2nzvya8rr3569-compiler-rt-7.1.0-dev/include --extra-lib-dirs=/nix/store/7n9yjfzjxp3b71rj930840w5m1zijsxm-compiler-rt-7.1.0/lib --extra-lib-dirs=/nix/store/izvb1pxcljmwblf8cb6zp2wwzl9m9vr5-ncurses-6.2/lib --extra-lib-dirs=/nix/store/dhywhjyd9kl3bgj2si0flxlaxfb46smz-libffi-3.3/lib --extra-lib-dirs=/nix/store/jf2szj928fn5b0vh72al5myihlg8qfkb-gmp-6.2.0/lib --extra-include-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/include --extra-lib-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/lib --extra-framework-dirs=/nix/store/37ryi8dqw7nlfwvawx0vs8xzxqbcwh52-swift-corefoundation/Library/Frameworks configureFlags: --verbose --prefix=/nix/store/rx7632605n5jph77j5qcpy7ai3sxqypf-time-compat-1.9.2.2 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/8fzpy8n8z4pxlckj76j9152izkq6v95s-time-compat-1.9.2.2-doc/share/doc/time-compat-1.9.2.2 --with-gcc=clang --package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-time-compat-1.9.2.2.drv-0/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --extra-include-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/include --extra-lib-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/lib --extra-include-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/include --extra-lib-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/lib --extra-include-dirs=/nix/store/hhy5g31igqyqg0vrh0k2nzvya8rr3569-compiler-rt-7.1.0-dev/include --extra-lib-dirs=/nix/store/7n9yjfzjxp3b71rj930840w5m1zijsxm-compiler-rt-7.1.0/lib --extra-lib-dirs=/nix/store/izvb1pxcljmwblf8cb6zp2wwzl9m9vr5-ncurses-6.2/lib --extra-lib-dirs=/nix/store/dhywhjyd9kl3bgj2si0flxlaxfb46smz-libffi-3.3/lib --extra-lib-dirs=/nix/store/jf2szj928fn5b0vh72al5myihlg8qfkb-gmp-6.2.0/lib --extra-include-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/include --extra-lib-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/lib --extra-framework-dirs=/nix/store/37ryi8dqw7nlfwvawx0vs8xzxqbcwh52-swift-corefoundation/Library/Frameworks configuring configureFlags: --verbose --prefix=/nix/store/sid0rl541gdqy61d61d9qql9vv9yawwm-pureMD5-2.1.3 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/qp804ynigchzkgzq9w8dqqxgby4jd02z-pureMD5-2.1.3-doc/share/doc/pureMD5-2.1.3 --with-gcc=clang --package-db=/private/var/folders/nq/dmc1zzf938163pj2rm8tcrbr0000gn/T/nix-build-pureMD5-2.1.3.drv-0/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --extra-include-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/include --extra-lib-dirs=/nix/store/ibnnd3ldx63bbmpk8h32nxbdgi4vv92a-libc++-7.1.0/lib --extra-include-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/include --extra-lib-dirs=/nix/store/l4w5vyqdhy4i5kyrclq1hx4ql3hnf89l-libc++abi-7.1.0/lib --extra-include-dirs=/nix/store/hhy5g31igqyqg0vrh0k2nzvya8rr3569-compiler-rt-7.1.0-dev/include --extra-lib-dirs=/nix/store/7n9yjfzjxp3b71rj930840w5m1zijsxm-compiler-rt-7.1.0/lib --extra-lib-dirs=/nix/store/izvb1pxcljmwblf8cb6zp2wwzl9m9vr5-ncurses-6.2/lib --extra-lib-dirs=/nix/store/dhywhjyd9kl3bgj2si0flxlaxfb46smz-libffi-3.3/lib --extra-lib-dirs=/nix/store/jf2szj928fn5b0vh72al5myihlg8qfkb-gmp-6.2.0/lib --extra-include-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/include --extra-lib-dirs=/nix/store/k600sa8qadp74bwy638nc288d66iq1ch-libiconv-osx-10.12.6/lib --extra-framework-dirs=/nix/store/37ryi8dqw7nlfwvawx0vs8xzxqbcwh52-swift-corefoundation/Library/Frameworks Using Parsec parser Configuring math-functions-0.3.3.0... Flags chosen: system-erf=True, system-expm1=True Dependency base >=4.5 && <5: using base-4.12.0.0 Dependency data-default-class >=0.1.2.0: using data-default-class-0.1.2.0 Dependency deepseq -any: using deepseq-1.4.4.0 Dependency primitive -any: using primitive-0.7.0.1 Dependency vector >=0.7: using vector-0.12.1.2 Dependency vector-th-unbox >=0.2.1.6: using vector-th-unbox-0.2.1.7 Using Parsec parser Configuring comonad-5.0.6... Flags chosen: containers=True, distributive=True, test-doctests=True Dependency base ==4.*: using base-4.12.0.0 Dependency containers >=0.3 && <0.7: using containers-0.6.0.1 Dependency distributive >=0.2.2 && <1: using distributive-0.6.1 Dependency tagged >=0.7 && <1: using tagged-0.8.6 Dependency transformers >=0.2 && <0.6: using transformers-0.5.6.2 Dependency transformers-compat >=0.3 && <1: using transformers-compat-0.6.5 Dependency base -any: using base-4.12.0.0 Dependency comonad -any: using comonad-5.0.6 Dependency doctest >=0.11.1 && <0.17: using doctest-0.16.2 Using Parsec parser Configuring tasty-ant-xml-1.1.6... Dependency base >=4.5 && <5: using base-4.12.0.0 Dependency containers >=0.4.2.0: using containers-0.6.0.1 Dependency directory >=1.2.3.0: using directory-1.3.3.0 Dependency filepath >=1.0.0: using filepath-1.4.2.1 Dependency generic-deriving >=1.6.2: using generic-deriving-1.13.1 Dependency ghc-prim -any: using ghc-prim-0.5.3 Dependency mtl >=2.1.2: using mtl-2.2.2 Dependency stm >=2.4.2: using stm-2.5.0.0 Dependency tagged >=0.7: using tagged-0.8.6 Dependency tasty >=0.10 && <1.3: using tasty-1.2.3 Dependency transformers >=0.3.0.0: using transformers-0.5.6.2 Dependency xml >=1.3.13: using xml-1.3.14 Using Parsec parser Configuring time-compat-1.9.2.2... CallStack (from HasCallStack): die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-2.4.0.1:Distribution.Simple.Configure configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:460:12 in Cabal-2.4.0.1:Distribution.Simple.Configure configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-2.4.0.1:Distribution.Simple confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-2.4.0.1:Distribution.Simple defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:115:27 in Cabal-2.4.0.1:Distribution.Simple defaultMain, called at /nix/store/4mdp8nhyfddh7bllbi7xszz7k9955n79-Setup.hs:2:8 in main:Main Setup: Encountered missing dependencies: base-compat >=0.10.5 && <0.11 builder for '/nix/store/lw31zzljpchaxm8kc961ld2nhycp9ssf-time-compat-1.9.2.2.drv' failed with exit code 1 cannot build derivation '/nix/store/c8fq82j7rrdrrgr9wj21wh0fzpg5hyn8-aeson-1.4.6.0.drv': 1 dependencies couldn't be built cannot build derivation '/nix/store/7xfh5ck69qi3ga620i8mygvizx2cd6jn-quickcheck-instances-0.3.22.drv': 1 dependencies couldn't be built cannot build derivation '/nix/store/nbphxf8gbf7rdx6zgn5pgdpl6czj0gm2-psc-package-0.6.2.drv': 1 dependencies couldn't be built error: build of '/nix/store/nbphxf8gbf7rdx6zgn5pgdpl6czj0gm2-psc-package-0.6.2.drv' failed ```

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.

justinwoo commented 4 years ago

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.

justinwoo commented 4 years ago

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.

lilyball commented 4 years ago

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).

justinwoo commented 4 years ago

Yes, sorry, I missed that detail. Does this also not work with allowing "jailbreaks", if it's just a result of version bounds?

lilyball commented 4 years ago

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.

justinwoo commented 4 years ago

Maybe @mwu knows specifically what is needed with libiconv https://github.com/justinwoo/easy-purescript-nix/commit/4176669b3d1ecf17b56e1a88295c7c9e9933fcaa#diff-49720a993c4fd8fb2db87822ea9ab0f4R32-R38.

lilyball commented 4 years ago

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.

lilyball commented 4 years ago

I submitted https://github.com/NixOS/nixpkgs/pull/82964 to adopt the easy-purescript-nix approach.

justinwoo commented 4 years ago

Thanks!

lilyball commented 4 years ago

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.

mitchblank commented 3 years ago

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.

justinwoo commented 3 years ago

Fixed upstream in nixpkgs.