reflex-frp / reflex-platform

A curated package set and set of tools that let you build Haskell packages so they can run on a variety of platforms. reflex-platform is built on top of the nix package manager.
https://reflex-frp.org
BSD 3-Clause "New" or "Revised" License
713 stars 163 forks source link

Strange Hoogle error on opening a Nix shell #813

Closed thomas-huegel closed 7 months ago

thomas-huegel commented 1 year ago

Hi, I get the following error when launching nix-shell -A shells.ghc as explained in https://github.com/reflex-frp/reflex-platform/blob/develop/docs/project-development.rst

error: value is null while a set was expected

       at /nix/store/xln8nq120xfa36yh500mjqabc9x3miv9-source/pkgs/development/haskell-modules/hoogle.nix:69:43:

           68|        + " the following were specified: "
           69|        + lib.concatMapStringsSep ", " (p: p.name) packages)}
             |                                           ^
           70|     mkdir -p $out/share/doc/hoogle

I work on NixOS 23.05. I don't need to use Hoogle. Thanks for your help.

alexfmpe commented 1 year ago

You can workaround this by disabling hoogle in your default.nix

{ system ? builtins.currentSystem }:
(import ./reflex-platform { inherit system; }).project ({ pkgs, ... }: {
+ withHoogle = false;
  packages = {

Seems like https://github.com/NixOS/nixpkgs/issues/158600#issuecomment-1036234839 so will probably be fixed with a nixpkgs bump.

That said, while I could reproduce this in a blank project, I couldn't reproduce it in https://github.com/ElvishJerricco/reflex-project-skeleton even after setting the reflex-platform and default.nix to be exactly the same (https://github.com/reflex-frp/reflex-platform/commit/12ab0adac1f3f1869e256e2f7fcd9f4ff1394d92) as what I got following the project docs. Wonder if I'm missing something or there's some impurity sneaking in.

cc @Ericson2314 @cidkidnix

thomas-huegel commented 1 year ago

Thanks you for your help. Setting withHoogle=false makes me move one step forward. Now I stumble upon a problem with the Cabal version:

error: builder for '/nix/store/cwbn21hnw3nkh35a5c4vxsfw4nqj9jqf-hpack-0.34.4.drv' failed with exit code 1;
       last 10 log lines:
       >   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 Setup.lhs:3:10 in main:Main
       > Setup: Encountered missing dependencies:
       > Cabal >=3.0.0.0 && <3.6
       >
       For full logs, run 'nix log /nix/store/cwbn21hnw3nkh35a5c4vxsfw4nqj9jqf-hpack-0.34.4.drv'.

I also tried to use reflex-project/skeleton but got the following on ./cabal new-build all:

error: unrecognised flag '--add-root'
Try 'nix-shell --help' for more information.

Thanks you for your help.

ali-abrar commented 7 months ago

Please reopen if this is reproducible with a more recent version of reflex-platform.