Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nix build无法生成haskell包“;由于来自阴谋集团的严重配置时间警告而中止&引用;“未发现uhc”;_Haskell_Cabal_Nix - Fatal编程技术网

Nix build无法生成haskell包“;由于来自阴谋集团的严重配置时间警告而中止&引用;“未发现uhc”;

Nix build无法生成haskell包“;由于来自阴谋集团的严重配置时间警告而中止&引用;“未发现uhc”;,haskell,cabal,nix,Haskell,Cabal,Nix,我遇到了类似的情况: 基本上,我有一个Haskell库,它的依赖项为 time>=1.9.2(阴谋集团包存储库中的时间库) 似乎此版本当前不存在于nixpkgs中,执行nix构建将导致以下错误: ... CallStack (from HasCallStack): die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-2.4.0.1:Distribution.Simple.

我遇到了类似的情况:

基本上,我有一个Haskell库,它的依赖项为
time>=1.9.2
(阴谋集团包存储库中的时间库)

似乎此版本当前不存在于
nixpkgs
中,执行
nix构建将导致以下错误:

...
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 Setup.hs:2:8 in main:Main
Setup: Encountered missing dependencies:
time >=1.9.2
...
这里有什么可能的解决方案?我也注意到以下问题,但不确定是否相关:

我想到的可能解决方案:

  • 覆盖Haskell
    time
    包,我想这是一个乏味的过程
  • 使用阴谋集团的本地包管理。我在这里担心的是,它无法充分利用Nix的存储缓存,所以我最终会构建更多的库?我确实找到了(),但不清楚这到底是做什么的
  • “越狱”时代图书馆

  • 第1条:

      myHaskellPackages = haskellPackages.override {
        overrides = self: super: rec {
          time  = self.callCabal2nix "time" (builtins.fetchGit {
            url = "git@github.com:haskell/time.git";
            rev = "5d2046f79cf5451f48b17529abec85349333aa9f";
          }) {};
        };
      };
    
      variant = if doBenchmark then myHaskellPackages.lib.doBenchmark else pkgs.lib.id;
    
      drv = variant (myHaskellPackages.callPackage f {});
    
    奇怪的结果是:

    nix-shell
    error: infinite recursion encountered, at undefined position
    (use '--show-trace' to show detailed location information)
    
    第2条:

    简单地说,我对阴谋集团没有透彻的了解,但我只是记录了我所做的尝试:

    cabal new-update
    Downloading the latest package list from hackage.haskell.org
    To revert to previous state run:
        cabal new-update 'hackage.haskell.org,2019-08-10T14:09:42Z'
    
    第三点:

      myHaskellPackages = pkgs.haskellPackages.override {
        overrides = self: super: rec {
          turtle = pkgs.haskell.lib.doJailbreak super.turtle;
        };
      };
    
    似乎导致了相同的错误:

    ...
    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 Setup.hs:2:8 in main:Main
    Setup: Encountered missing dependencies:
    time >=1.9.2
    
    builder for '/nix/store/67109ylsjfw8vpdv0q5b90d2bwx8zii0-platinumpitanga-1.0.0.0.drv' failed with exit code 1
    error: build of '/nix/store/67109ylsjfw8vpdv0q5b90d2bwx8zii0-platinumpitanga-1.0.0.0.drv' failed
    

    更新

    因此,显然重写像
    time
    这样的“核心”库实际上不起作用。。。我试着定义如下:

      myHaskellPackages = pkgs.haskell.packages.${compiler}.override {
        overrides = self: super: rec {
          timezz = pkgs.haskell.packages.${compiler}.callHackageDirect
            {
              pkg = "time";
              ver = "1.9.3";
              sha256 = "1bs74nj2qc83i2d78xf1hn79f37g8wjgak2bwn5bnwb31pl0bl7r";
            }
            {};
        };
      };
    
    然后使用
    timezz
    作为依赖项,而不是
    time
    。。。但由于以下原因,无法建立时间库:

    Documentation installed in:
    /nix/store/9s5hbq3pzippwcylb3x501rja2vxip1c-platinumpitanga-1.0.0.0-doc/share/doc/platinumpitanga-1.0.0.0
    Configuration files installed in:
    /nix/store/26qkhjjq0ry8mxx6myp0h7m21d35x84z-platinumpitanga-1.0.0.0/etc
    No alex found
    Using ar found on system at:
    /nix/store/0y7jmqnj48ikjh37n3dl9kqw9hnn68nq-binutils-2.31.1/bin/ar
    No c2hs found
    No cpphs found
    No doctest found
    Using gcc version 7.4.0 given by user at:
    /nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0/bin/gcc
    Using ghc version 8.6.4 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/ghc
    Using ghc-pkg version 8.6.4 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/ghc-pkg
    No ghcjs found
    No ghcjs-pkg found
    No greencard found
    Using haddock version 2.22.0 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/haddock
    No happy found
    Using haskell-suite found on system at: haskell-suite-dummy-location
    Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
    No hmake found
    Using hpc version 0.67 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/hpc
    Using hsc2hs version 0.68.5 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/hsc2hs
    Using hscolour version 1.24 found on system at:
    /nix/store/xnn0093zfkxsvjyr6g7w1l534hrb1p57-hscolour-1.24.4/bin/HsColour
    No jhc found
    Using ld found on system at:
    /nix/store/rbpyfy6413aqpik9aj6p3a2syd1mda68-binutils-wrapper-2.31.1/bin/ld
    No pkg-config found
    Using runghc version 8.6.4 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/runghc
    Using strip version 2.31 found on system at:
    /nix/store/0y7jmqnj48ikjh37n3dl9kqw9hnn68nq-binutils-2.31.1/bin/strip
    Using tar found on system at:
    /nix/store/wmxqm38g1y1y7sd7s9vg7an3klffaiyz-gnutar-1.31/bin/tar
    No uhc found
    *** abort because of serious configure-time warning from Cabal
    builder for '/nix/store/3dsr8m5frzyn0lcmf4v0b80fq55b2vp6-platinumpitanga-1.0.0.0.drv' failed with exit code 1
    error: build of '/nix/store/3dsr8m5frzyn0lcmf4v0b80fq55b2vp6-platinumpitanga-1.0.0.0.drv' failed
    

    因为项目最初可以通过stack成功构建。。。导致成功的
    nix构建--option sandbox false
    的解决方法是:

    {
      nixpkgs ? import <nixpkgs> {}
    , sources ? import ./nix/sources.nix
    , compiler ? "ghc864" } :
    let
      niv = import sources.nixpkgs {
        overlays = [
          (_ : _ : { niv = import sources.niv {}; })
        ] ;
        config = {};
      };
      pkgs = niv.pkgs;
    in
    pkgs.haskell.lib.buildStackProject {
      name = "platinumpitanga";
      src = ./.;
    }
    
    {
    nixpkgs?导入{}
    ,sources?导入。/nix/sources.nix
    ,编译器?“ghc864”}:
    允许
    niv=导入源.nixpkgs{
    覆盖层=[
    (:{niv=import sources.niv{};})
    ] ;
    config={};
    };
    pkgs=niv.pkgs;
    在里面
    pkgs.haskell.lib.buildStackProject{
    name=“platinumpitanga”;
    src=./。;
    }
    
    对于另一个正在使用
    prettyprinter
    的项目来说,遇到类似错误可能会有所帮助。。。(我认为这取决于ghc相关的图书馆)
    Documentation installed in:
    /nix/store/9s5hbq3pzippwcylb3x501rja2vxip1c-platinumpitanga-1.0.0.0-doc/share/doc/platinumpitanga-1.0.0.0
    Configuration files installed in:
    /nix/store/26qkhjjq0ry8mxx6myp0h7m21d35x84z-platinumpitanga-1.0.0.0/etc
    No alex found
    Using ar found on system at:
    /nix/store/0y7jmqnj48ikjh37n3dl9kqw9hnn68nq-binutils-2.31.1/bin/ar
    No c2hs found
    No cpphs found
    No doctest found
    Using gcc version 7.4.0 given by user at:
    /nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0/bin/gcc
    Using ghc version 8.6.4 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/ghc
    Using ghc-pkg version 8.6.4 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/ghc-pkg
    No ghcjs found
    No ghcjs-pkg found
    No greencard found
    Using haddock version 2.22.0 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/haddock
    No happy found
    Using haskell-suite found on system at: haskell-suite-dummy-location
    Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
    No hmake found
    Using hpc version 0.67 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/hpc
    Using hsc2hs version 0.68.5 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/hsc2hs
    Using hscolour version 1.24 found on system at:
    /nix/store/xnn0093zfkxsvjyr6g7w1l534hrb1p57-hscolour-1.24.4/bin/HsColour
    No jhc found
    Using ld found on system at:
    /nix/store/rbpyfy6413aqpik9aj6p3a2syd1mda68-binutils-wrapper-2.31.1/bin/ld
    No pkg-config found
    Using runghc version 8.6.4 found on system at:
    /nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/runghc
    Using strip version 2.31 found on system at:
    /nix/store/0y7jmqnj48ikjh37n3dl9kqw9hnn68nq-binutils-2.31.1/bin/strip
    Using tar found on system at:
    /nix/store/wmxqm38g1y1y7sd7s9vg7an3klffaiyz-gnutar-1.31/bin/tar
    No uhc found
    *** abort because of serious configure-time warning from Cabal
    builder for '/nix/store/3dsr8m5frzyn0lcmf4v0b80fq55b2vp6-platinumpitanga-1.0.0.0.drv' failed with exit code 1
    error: build of '/nix/store/3dsr8m5frzyn0lcmf4v0b80fq55b2vp6-platinumpitanga-1.0.0.0.drv' failed
    
    {
      nixpkgs ? import <nixpkgs> {}
    , sources ? import ./nix/sources.nix
    , compiler ? "ghc864" } :
    let
      niv = import sources.nixpkgs {
        overlays = [
          (_ : _ : { niv = import sources.niv {}; })
        ] ;
        config = {};
      };
      pkgs = niv.pkgs;
    in
    pkgs.haskell.lib.buildStackProject {
      name = "platinumpitanga";
      src = ./.;
    }