在我的一个项目中,我想使用llvm-general和llvm-general-pure,但是我想使用使用llvm3.9的llvm-3.9分支,这些库在hackage上的最新版本是lvm3.5。
我的项目是一个堆栈项目,这是我在stack.yaml中拥有的:
resolver: nightly-2017-05-01
packages:
- '.'
- location:
git: https://github.com/bscarlet/llvm-general.git
commit: 61fd03639063283e7dc617698265cc883baf0eec
subdirs:
- llvm-general
- llvm-general-pure
extra-dep: true 所有其他选项都是默认的。
这是我的project.cabal:
name: compiler-final
version: 0.1.0.0
category: Compiler
build-type: Simple
-- extra-source-files:
cabal-version: >=1.10
library
hs-source-dirs: src
exposed-modules: Lexer,Parser,ParserTestData,CodeGen
other-modules: Prelude,StateTUtil
ghc-options: -Wall -dcore-lint -fhpc -XNoImplicitPrelude -fobject-code
build-depends: base-noprelude >= 4.7 && < 5 , megaparsec < 6 , transformers < 1, unordered-containers < 1 , hashable < 2
,classy-prelude , either < 5 , mono-traversable < 2 , logfloat < 0.14 , text
default-language: Haskell2010
default-extensions: OverloadedStrings
executable compiler-final-exe
hs-source-dirs: app
main-is: Main.hs
ghc-options: -threaded -rtsopts -XNoImplicitPrelude -with-rtsopts=-N -fobject-code
build-depends: base
, compiler-final
default-language: Haskell2010
default-extensions: OverloadedStrings
test-suite compiler-final-test
type: exitcode-stdio-1.0
hs-source-dirs: test
other-modules: LexerSpec , ParserSpec
main-is: Spec.hs
build-depends: base
, compiler-final, megaparsec < 6 , hspec < 3,hspec-megaparsec >= 0.3,unordered-containers < 1
,hashable,transformers < 1,text,bytestring , mtl, text
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fhpc -Wall -XNoImplicitPrelude -fobject-code
default-language: Haskell2010
default-extensions: OverloadedStrings
Benchmark compiler-final-bench
type: exitcode-stdio-1.0
hs-source-dirs: bench
main-is: Bench.hs
other-modules: ParserBench
build-depends: base,compiler-final,megaparsec < 6 ,unordered-containers < 1,QuickCheck<3
,hashable
ghc-options: -rtsopts -auto-all -caf-all -fforce-recomp -fobject-code
default-language: Haskell2010不幸的是,在CodeGen.hs中,这个简单的导入语句没有编译:import LLVM.General.AST,它说它没有找到模块。
现在,我已经通过cabal install在全球范围内安装了llvm通用分支3.9,我可以使用ghci -package(而不是stack ghci)访问它,并且存在上述模块。
我尝试将llvm-general和llvm-general-pure添加到版本3.9.0.0的依赖项列表中,但是堆栈似乎试图安装版本3.5,因为它报告了有关不匹配版本的错误。
那么如何实现我想要的呢?
发布于 2017-05-07 12:05:23
您的.cabal没有将llvm-general和llvm-general-pure列为依赖项,因此没有找到LLVM.General.AST。
此外,您的stack.yaml指向master,因此stack只会看到3.5版本。如果版本3.9不在stack文件中,那么它对它一无所知。以下任一项:
ec1ad5bd2112e7f64dbb43441b5e2075cf6ad8e;location字段替换为https://stackoverflow.com/questions/43829231
复制相似问题