首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ghc-pkg:找不到ghc-7.10.2.20150906包

ghc-pkg:找不到ghc-7.10.2.20150906包
EN

Stack Overflow用户
提问于 2015-11-24 17:44:17
回答 1查看 825关注 0票数 1

我需要公开一个包ghc-7.10.2.20150906。当我使用"ghc-pkg列表“时,我看到:

但是,当我试图暴露sudo ghc-pkg expose ghc-7.10.2.20150906的ghc-7.10.2.20150906时,我得到了一个信息:

ghc-pkg:找不到ghc-7.10.2.20150906包

有什么问题吗?或者有其他方法来揭露它?

阴谋集团档案:

代码语言:javascript
复制
-- This is the configuration file for the 'cabal' command line tool.

-- The available configuration options are listed below.
-- Some of them have default values listed.

-- Lines (like this one) beginning with '--' are comments.
-- Be careful with spaces and indentation because they are
-- used to indicate layout for nested sections.


remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
remote-repo-cache: /home/valoisa/.cabal/packages
-- local-repo:
-- logs-dir:
world-file: /home/valoisa/.cabal/world
-- verbose: 1
-- compiler: ghc
-- with-compiler:
-- with-hc-pkg:
-- scratchdir:
-- program-prefix: 
-- program-suffix: 
-- library-vanilla: True
-- library-profiling: False
-- shared:
-- executable-dynamic: False
-- executable-profiling: False
-- optimization: True
-- library-for-ghci: False
-- split-objs: False
-- executable-stripping: True
-- user-install: True
-- package-db:
-- flags:
-- extra-include-dirs:
-- extra-lib-dirs:
extra-prog-path: /home/valoisa/.cabal/bin
-- tests: False
-- library-coverage: False
-- benchmarks: False
-- cabal-lib-version:
-- constraint:
-- preference:
-- solver: choose
-- documentation: False
-- doc-index-file: $datadir/doc/index.html
-- max-backjumps: 2000
-- reorder-goals: False
-- shadow-installed-packages: False
-- strong-flags: False
-- reinstall: False
-- avoid-reinstalls: False
-- force-reinstalls: False
-- upgrade-dependencies: False
-- root-cmd:
-- symlink-bindir:
build-summary: /home/valoisa/.cabal/logs/build.log
-- build-log:
remote-build-reporting: anonymous
-- one-shot: False
jobs: $ncpus
-- username:
-- password:

install-dirs user
  -- prefix: /home/valoisa/.cabal
  -- bindir: $prefix/bin
  -- libdir: $prefix/lib
  -- libsubdir: $arch-$os-$compiler/$pkgid
  -- libexecdir: $prefix/libexec
  -- datadir: $prefix/share
  -- datasubdir: $arch-$os-$compiler/$pkgid
  -- docdir: $datadir/doc/$arch-$os-$compiler/$pkgid
  -- htmldir: $docdir/html
  -- haddockdir: $htmldir
  -- sysconfdir: $prefix/etc

install-dirs global
  -- prefix: /usr/local
  -- bindir: $prefix/bin
  -- libdir: $prefix/lib
  -- libsubdir: $arch-$os-$compiler/$pkgid
  -- libexecdir: $prefix/libexec
  -- datadir: $prefix/share
  -- datasubdir: $arch-$os-$compiler/$pkgid
  -- docdir: $datadir/doc/$arch-$os-$compiler/$pkgid
  -- htmldir: $docdir/html
  -- haddockdir: $htmldir
  -- sysconfdir: $prefix/etc

program-locations 
  -- alex-location:
  -- ar-location:
  -- c2hs-location:
  -- cpphs-location:
  -- ffihugs-location:
  -- gcc-location:
  -- ghc-location:
  -- ghc-pkg-location:
  -- greencard-location:
  -- haddock-location:
  -- happy-location:
  -- hmake-location:
  -- hpc-location:
  -- hsc2hs-location:
  -- hscolour-location:
  -- hugs-location:
  -- jhc-location:
  -- ld-location:
  -- lhc-location:
  -- lhc-pkg-location:
  -- nhc98-location:
  -- pkg-config-location:
  -- ranlib-location:
  -- strip-location:
  -- tar-location:
  -- uhc-location:

program-default-options 
  -- alex-options:
  -- ar-options:
  -- c2hs-options:
  -- cpphs-options:
  -- ffihugs-options:
  -- gcc-options:
  -- ghc-options:
  -- ghc-pkg-options:
  -- greencard-options:
  -- haddock-options:
  -- happy-options:
  -- hmake-options:
  -- hpc-options:
  -- hsc2hs-options:
  -- hscolour-options:
  -- hugs-options:
  -- jhc-options:
  -- ld-options:
  -- lhc-options:
  -- lhc-pkg-options:
  -- nhc98-options:
  -- pkg-config-options:
  -- ranlib-options:
  -- strip-options:
  -- tar-options:
  -- uhc-options:
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-11-25 10:31:32

通常,当您编写更大的Haskell项目时,您会指定要在特定于项目的Cabal文件中使用的包,下面是一个使用base包和ghcexample.cabal的非常小的示例

代码语言:javascript
复制
name:                example
version:             0.1.0.0
build-type:          Simple
cabal-version:       >=1.10

library
  exposed-modules:     AModule
  build-depends:       base >= 4.7 && < 5
                       , ghc
  default-language:    Haskell2010

要在此项目中使用GHC7.10.3快照,您可以运行cabal configure --with-compiler=PATH/TO/ghc-7.10.3,然后可以使用GHCi会话中的依赖包使用cabal repl访问项目。

如果您真的想公开ghc包,您的问题似乎是sudo ghc-pkg调用不是7.10.3快照中的ghc,如行所示。

标志db堆栈:"/home/valoisa/.ghc/x86_64-linux-7.10.2/package.conf.d",“/usr/local/lib/ghc-7.10.2/pacage.conf.d”

你在输出 of sudo ghc-pkg -v2 expose ghc上贴的。

我可以看到两种可能的解决方案

  1. 不要使用sudo,因为它似乎使用了正确的ghc-pkg版本(我想不出有什么理由在这里使用sudo )。
  2. 通过指定程序的整个路径来使用正确的ghc-pkg
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33900373

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档