首页 > 解决方案 > Graphite 由于空接口导致错误

问题描述

我遇到的问题是我将graphite依赖项添加到一个新项目并且无法构建。为什么会发生这种情况以及可以采取哪些措施来纠正它?

重现

  1. 运行stack new project
  2. 运行cd project
  3. 运行stack build(按预期工作)。
  4. 编辑package.yaml并添加石墨作为依赖项。
dependencies:
- base >= 4.7 && < 5
- graphite # add this line
  1. 运行stack build(不起作用)。
QuickCheck> configure
QuickCheck> Configuring QuickCheck-2.14.2...
QuickCheck> build
graphviz  > configure
QuickCheck> Preprocessing library for QuickCheck-2.14.2..
QuickCheck> Building library for QuickCheck-2.14.2..
QuickCheck> [ 1 of 16] Compiling Test.QuickCheck.Exception
graphviz  > Configuring graphviz-2999.20.1.0...
QuickCheck> [ 2 of 16] Compiling Test.QuickCheck.Random
QuickCheck> 
QuickCheck> /tmp/stack-05e37a900bbf6a92/QuickCheck-2.14.2/src/Test/QuickCheck/Random.hs:9:1: error:
QuickCheck>     Bad interface file: /home/waynevanson/.stack/snapshots/x86_64-linux-tinfo6/b3cf699ace1558dcb39ae886a5a104f0e17753ec2ae390d996aa847a910da0d0/8.10.7/lib/x86_64-linux-ghc-8.10.7/random-1.2.0-GAV679NMk7iDELNoxF99p4/System/Random.hi
QuickCheck>         Data.Binary.getPrim: end of file
QuickCheck>   |
QuickCheck> 9 | import System.Random
QuickCheck>   | ^^^^^^^^^^^^^^^^^^^^
QuickCheck> 
graphviz  > build                         
scientific> configure                     
graphviz  > Preprocessing library for graphviz-2999.20.1.0..
graphviz  > Building library for graphviz-2999.20.1.0..
graphviz  > [ 1 of 31] Compiling Data.GraphViz.Attributes.ColorScheme
scientific> Configuring scientific-0.3.7.0...
scientific> build                         
vector    > configure                     
scientific> Preprocessing library for scientific-0.3.7.0..
scientific> Building library for scientific-0.3.7.0..
scientific> [1 of 5] Compiling GHC.Integer.Compat
scientific> [2 of 5] Compiling Utils      
scientific>                               
scientific> /tmp/stack-05e37a900bbf6a92/scientific-0.3.7.0/src/Utils.hs:17:1: error:
scientific>     Bad interface file: /home/waynevanson/.stack/snapshots/x86_64-linux-tinfo6/b3cf699ace1558dcb39ae886a5a104f0e17753ec2ae390d996aa847a910da0d0/8.10.7/lib/x86_64-linux-ghc-8.10.7/primitive-0.7.3.0-HMedJdQUTCQ79SiIUfisnA/Data/Primitive/Array.hi
scientific>         Data.Binary.getPrim: end of file
scientific>    |                          
scientific> 17 | import qualified Data.Primitive.Array as Primitive
scientific>    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
scientific>                               
vector    > Configuring vector-0.12.3.1...
vector    > build             
vector    > Preprocessing library for vector-0.12.3.1..
vector    > Building library for vector-0.12.3.1..
graphviz  > [ 2 of 31] Compiling Data.GraphViz.Exception
graphviz  > [ 3 of 31] Compiling Data.GraphViz.Internal.State
graphviz  >                   
graphviz  > /tmp/stack-05e37a900bbf6a92/graphviz-2999.20.1.0/Data/GraphViz/Internal/State.hs:33:1: error:
graphviz  >     Bad interface file: /home/waynevanson/.stack/snapshots/x86_64-linux-tinfo6/b3cf699ace1558dcb39ae886a5a104f0e17753ec2ae390d996aa847a910da0d0/8.10.7/lib/x86_64-linux-ghc-8.10.7/polyparse-1.13-CS3hwJapEwUHObxSp4JF8T/Text/ParserCombinators/Poly/StateText.hi
graphviz  >         Data.Binary.getPrim: end of file
graphviz  >    |              
graphviz  > 33 | import Text.ParserCombinators.Poly.StateText (Parser, stQuery, stUpdate)
graphviz  >    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
graphviz  >                   
vector    > [ 1 of 21] Compiling Data.Vector.Fusion.Util
vector    > [ 2 of 21] Compiling Data.Vector.Fusion.Bundle.Size
vector    > [ 3 of 21] Compiling Data.Vector.Generic.Mutable.Base
vector    >         
vector    > /tmp/stack-05e37a900bbf6a92/vector-0.12.3.1/Data/Vector/Generic/Mutable/Base.hs:18:1: error:
vector    >     Bad interface file: /home/waynevanson/.stack/snapshots/x86_64-linux-tinfo6/b3cf699ace1558dcb39ae886a5a104f0e17753ec2ae390d996aa847a910da0d0/8.10.7/lib/x86_64-linux-ghc-8.10.7/primitive-0.7.3.0-HMedJdQUTCQ79SiIUfisnA/Control/Monad/Primitive.hi
vector    >         Data.Binary.getPrim: end of file
vector    >    |    
vector    > 18 | import Control.Monad.Primitive ( PrimMonad, PrimState )
vector    >    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
vector    >         
Progress 4/8        

--  While building package vector-0.12.3.1 (scroll up to its section to see the error) using:
      /home/waynevanson/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package graphviz-2999.20.1.0 (scroll up to its section to see the error) using:
      /home/waynevanson/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package scientific-0.3.7.0 (scroll up to its section to see the error) using:
      /home/waynevanson/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package QuickCheck-2.14.2 (scroll up to its section to see the error) using:
      /home/waynevanson/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

看一下这个:

QuickCheck> /tmp/stack-05e37a900bbf6a92/QuickCheck-2.14.2/src/Test/QuickCheck/Random.hs:9:1: error:
QuickCheck>     Bad interface file: /home/waynevanson/.stack/snapshots/x86_64-linux-tinfo6/b3cf699ace1558dcb39ae886a5a104f0e17753ec2ae390d996aa847a910da0d0/8.10.7 /lib/x86_64-linux-ghc-8.10.7/random-1.2.0-GAV679NMk7iDELNoxF99p4/System/Random.hi
QuickCheck>         Data.Binary.getPrim: end of file

我导航到/home/waynevanson/.stack/snapshots/x86_64-linux-tinfo6/b3cf699ace1558dcb39ae886a5a104f0e17753ec2ae390d996aa847a910da0d0/8.10.7/lib/x86_64-linux-ghc-8.10.7/random-1.2.0-GAV679NMk7iDELNoxF99p4/System/Random.hi该文件为空。我不相信它应该是空的。

graphite据我了解,在解析器中可用。

标签: haskellbuildhaskell-stack

解决方案


推荐阅读