happstack-server 安装期间的 GHCi 交互式链接错误
GHCi interactive linking error during happstack-server installation
我正在尝试在依赖于 happstack-server
的 cabal 沙箱中构建项目,但此包无法构建。这是.cabal-sandbox/logs/happstack-server-7.4.6.1.log
的内容:
Building happstack-server-7.4.6.1...
Preprocessing library happstack-server-7.4.6.1...
[ 1 of 38] Compiling Happstack.Server.Internal.LazyLiner ( src/Happstack/Server/Internal/LazyLiner.hs, dist/dist-sandbox-925bc8f2/build/Happstack/Server/Internal/LazyLiner.o )
[ 2 of 38] Compiling Happstack.Server.Internal.SocketTH ( src/Happstack/Server/Internal/SocketTH.hs, dist/dist-sandbox-925bc8f2/build/Happstack/Server/Internal/SocketTH.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package zlib-0.6.1.1 ... linking ... done.
Loading package xhtml-3000.2.1 ... linking ... done.
Loading package utf8-string-0.3.8 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package old-time-1.1.0.2 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package time-compat-0.1.0.3 ... linking ... done.
Loading package stm-2.4.4.1 ... linking ... done.
Loading package threads-0.5.1.3 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package binary-0.8.2.1 ... linking ... done.
Loading package text-1.2.2.0 ... linking ... done.
Loading package system-filepath-0.4.13.4 ... linking ... done.
Loading package syb-0.6 ... linking ... done.
Loading package unix-2.7.0.1 ... linking ... done.
Loading package network-2.6.2.1 ... linking ... done.
Loading package sendfile-0.7.9 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package parsec-3.1.9 ... linking ... done.
Loading package network-uri-2.6.0.3 ... linking ... done.
Loading package transformers-compat-0.5.1.4 ... linking ... done.
Loading package transformers-base-0.4.4 ... linking ... done.
Loading package monad-control-1.0.0.5 ... linking ... done.
Loading package html-1.0.1.2 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package process-1.2.0.0 ... linking ... done.
Loading package hslogger-1.2.9 ... linking ... done.
Loading package extensible-exceptions-0.1.1.4 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package exceptions-0.8.2.1 ... linking ... done.
Loading package blaze-builder-0.4.0.1 ... linking ... done.
Loading package blaze-markup-0.7.0.3 ... linking ... done.
Loading package blaze-html-0.8.1.1 ... linking ... done.
Loading package base64-bytestring-1.0.0.1 ... linking ... done.
ByteCodeLink.lookupCE
During interactive linking, GHCi couldn't find the following symbol:
templatezmhaskell_LanguageziHaskellziTHziSyntax_zdfMonadQzuzdczgzgze_closure
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session. Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
glasgow-haskell-bugs@haskell.org
我该如何解决这个问题?
▶ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4
▶ cabal --version
cabal-install version 1.18.1.0
using version 1.18.1.5 of the Cabal library
问题是由于我的 OS 包管理器安装了旧版本的模板-haskell。即使我在沙箱中工作,也会考虑这个版本。我使用 cabal install --shadow-installed-packages
.
解决了这个问题
我正在尝试在依赖于 happstack-server
的 cabal 沙箱中构建项目,但此包无法构建。这是.cabal-sandbox/logs/happstack-server-7.4.6.1.log
的内容:
Building happstack-server-7.4.6.1...
Preprocessing library happstack-server-7.4.6.1...
[ 1 of 38] Compiling Happstack.Server.Internal.LazyLiner ( src/Happstack/Server/Internal/LazyLiner.hs, dist/dist-sandbox-925bc8f2/build/Happstack/Server/Internal/LazyLiner.o )
[ 2 of 38] Compiling Happstack.Server.Internal.SocketTH ( src/Happstack/Server/Internal/SocketTH.hs, dist/dist-sandbox-925bc8f2/build/Happstack/Server/Internal/SocketTH.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package zlib-0.6.1.1 ... linking ... done.
Loading package xhtml-3000.2.1 ... linking ... done.
Loading package utf8-string-0.3.8 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package old-time-1.1.0.2 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package time-compat-0.1.0.3 ... linking ... done.
Loading package stm-2.4.4.1 ... linking ... done.
Loading package threads-0.5.1.3 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package binary-0.8.2.1 ... linking ... done.
Loading package text-1.2.2.0 ... linking ... done.
Loading package system-filepath-0.4.13.4 ... linking ... done.
Loading package syb-0.6 ... linking ... done.
Loading package unix-2.7.0.1 ... linking ... done.
Loading package network-2.6.2.1 ... linking ... done.
Loading package sendfile-0.7.9 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package parsec-3.1.9 ... linking ... done.
Loading package network-uri-2.6.0.3 ... linking ... done.
Loading package transformers-compat-0.5.1.4 ... linking ... done.
Loading package transformers-base-0.4.4 ... linking ... done.
Loading package monad-control-1.0.0.5 ... linking ... done.
Loading package html-1.0.1.2 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package process-1.2.0.0 ... linking ... done.
Loading package hslogger-1.2.9 ... linking ... done.
Loading package extensible-exceptions-0.1.1.4 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package exceptions-0.8.2.1 ... linking ... done.
Loading package blaze-builder-0.4.0.1 ... linking ... done.
Loading package blaze-markup-0.7.0.3 ... linking ... done.
Loading package blaze-html-0.8.1.1 ... linking ... done.
Loading package base64-bytestring-1.0.0.1 ... linking ... done.
ByteCodeLink.lookupCE
During interactive linking, GHCi couldn't find the following symbol:
templatezmhaskell_LanguageziHaskellziTHziSyntax_zdfMonadQzuzdczgzgze_closure
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session. Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
glasgow-haskell-bugs@haskell.org
我该如何解决这个问题?
▶ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4
▶ cabal --version
cabal-install version 1.18.1.0
using version 1.18.1.5 of the Cabal library
问题是由于我的 OS 包管理器安装了旧版本的模板-haskell。即使我在沙箱中工作,也会考虑这个版本。我使用 cabal install --shadow-installed-packages
.