尽管缺少堆栈ghci,但由于缺少包而导致堆栈构建失败

马尔特·德雷舍特

我正在尝试使用堆栈在Haskell中构建一个简单的程序。我使用创建了一个新项目,stack new然后执行了一个stack setup模板构建良好。

我想尝试二进制文件解析,所以我导入了Data.ByteStringbuild-depends在集团文件中看起来像这样:

build-depends:     base >= 4.7 && < 5
                 , bytestring >= 0.10.6
                 , binary >= 0.7.5

stack ghci现在可以正常工作,但stack build仍然不快乐。有人可以告诉我我在这里做错了什么吗?

这是完整的错误消息:

test-0.1.0.0: build
Preprocessing library test-0.1.0.0...
In-place registering test-0.1.0.0...
Preprocessing executable 'test-exe' for test-0.1.0.0...

haskell/test/app/Main.hs:4:18:
    Could not find module ‘Data.ByteString’
    It is a member of the hidden package ‘bytestring-0.10.6.0@bytes_6VWy06pWzJq9evDvK2d4w6’.
    Perhaps you need to add ‘bytestring’ to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.

haskell/test/app/Main.hs:5:8:
    Could not find module ‘Data.Binary.Get’
    It is a member of the hidden package ‘binary-0.7.5.0@binar_3uXFWMoAGBg0xKP9MHKRwi’.
    Perhaps you need to add ‘binary’ to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.

--  While building package test-0.1.0.0 using:
      .stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 build lib:test exe:test-exe --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

这是我的app / Main.hs文件:

module Main where

import Lib
import qualified Data.ByteString as B
import Data.Binary.Get
import Data.Word

main :: IO ()
main =  do
    putStrLn "f"

非常感谢您的帮助。

mgsloan

这可能是因为您添加bytestringbuild-depends库的而不是可执行文件。避免需要针对不同的节重复这些依赖关系的一种方法是使用hpack作为程序包描述格式。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

堆栈构建因缺少依赖项而失败

由于缺少库而导致构建失败

由于缺少方法而导致PanoJS失败

由于缺少android SDK,Jenkins构建失败

由于缺少dx.jar,构建失败

尽管存在传输,但由于缺少传输,Python AsyncIO无法创建协议

缺少堆栈更新

为什么由于缺少自定义本地存储库的apklib依赖关系而导致构建失败?

尽管套接字从未通过菜单关闭,但由于SocketException而导致DTLS握手失败

显示缺少的库:使用堆栈安装构建针鼹时的 ff

使用 nix 构建堆栈期间缺少 C 库错误

由于缺少模块映射,Jenkins XCode iOS构建失败

由于缺少GSL,Windows机器(AppVeyor)上的R软件包构建失败-GNU科学图书馆

尽管代码在另一个项目中为我工作,但由于“ fatJar任务”,Gradle构建失败

由于缺少引号,布尔值未在 MERN 堆栈中更新

使用 spring boot 2.4.1 构建 docker 映像在防火墙后面失败,并显示“缺少‘io.buildpacks.stack.id’堆栈标签”

为什么我的堆栈跟踪缺少步骤?

Instruments堆栈跟踪中缺少方法调用

Spring Boot Maven插件缺少堆栈跟踪

“ ReactComponentTreeDevtool:在构建堆栈时缺少debugID 9的React元素”是什么意思?

Haskell Stack:使用堆栈构建X11-xft时缺少C库Xft吗?

由于颜色图中缺少元素而导致的 ValueError

由于构建APK后缺少流星1.2

由于缺少 WebApp 库,在 Spring-boot-starter 项目中构建失败

由于缺少依赖项org.springframework.build.aws.maven,Spring Roo构建失败

由于缺少工件jdk.tools:jar,使用maven的hadoop-common构建失败

由于缺少jQuery插件,Jenkins“构建管道插件”插件安装失败

由于“缺少图标”,Apple Watch提交失败

由于缺少模块'minizlib',npm启动失败