为 threadscope 堆栈安装 cairo
Stack installing cairo for threadscope
我开始通过堆栈安装 threadscope(而不是 cabal,可以吗?https://wiki.haskell.org/ThreadScope)。 threadscope 需要开罗。
$ stack install cairo
cairo-0.13.3.1: configure
-- While building package cairo-0.13.3.1 using:
/home/username/.stack/programs/x86_64-linux/ghc-8.0.1/bin/ghc --make -odir /tmp/stack13291/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup -hidir /tmp/stack13291/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup -i -i. -package=Cabal-1.24.2.0 -clear-package-db -global-package-db -package-db=/home/username/.stack/snapshots/x86_64-linux/lts-7.10/8.0.1/pkgdb /tmp/stack13291/cairo-0.13.3.1/Setup.hs /home/username/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -main-is StackSetupShim.mainOverride -o /tmp/stack13291/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup -threaded
Process exited with code: ExitFailure 1
Logs have been written to: /home/username/.stack/global-project/.stack-work/logs/cairo-0.13.3.1.log
[1 of 2] Compiling Main ( /tmp/stack13291/cairo-0.13.3.1/Setup.hs, /tmp/stack13291/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/Main.o )
/tmp/stack13291/cairo-0.13.3.1/Setup.hs:8:29: error:
• Couldn't match expected type ‘Distribution.Simple.UserHooks.UserHooks’
with actual type ‘Cabal-1.24.1.0:Distribution.Simple.UserHooks.UserHooks’
NB: ‘Cabal-1.24.1.0:Distribution.Simple.UserHooks.UserHooks’
is defined in ‘Distribution.Simple.UserHooks’
in package ‘Cabal-1.24.1.0’
‘Distribution.Simple.UserHooks.UserHooks’
is defined in ‘Distribution.Simple.UserHooks’
in package ‘Cabal-1.24.2.0’
• In the first argument of ‘defaultMainWithHooks’, namely
‘gtk2hsUserHooks’
In the expression: defaultMainWithHooks gtk2hsUserHooks
In an equation for ‘main’:
main = defaultMainWithHooks gtk2hsUserHooks
为了更进一步,我尝试安装 gtk 构建工具:
$ stack install gtk2hs-buildtools
Copying from /home/username/.stack/snapshots/x86_64-linux/lts-7.10/8.0.1/bin/gtk2hsC2hs to /home/username/.local/bin/gtk2hsC2hs
Copying from /home/username/.stack/snapshots/x86_64-linux/lts-7.10/8.0.1/bin/gtk2hsHookGenerator to /home/username/.local/bin/gtk2hsHookGenerator
Copying from /home/username/.stack/snapshots/x86_64-linux/lts-7.10/8.0.1/bin/gtk2hsTypeGen to /home/username/.local/bin/gtk2hsTypeGen
Copied executables to /home/username/.local/bin:
- gtk2hsC2hs
- gtk2hsHookGenerator
- gtk2hsTypeGen
我一直在安装 cairo 时遇到同样的错误。我是 运行 Ubuntu 14.04 并且安装了 libcairo2-dev
:
$ stack install threadscope
glib-0.13.4.1: configure
cairo-0.13.3.1: configure
Progress: 2/6
-- While building package cairo-0.13.3.1 using:
/home/username/.stack/programs/x86_64-linux/ghc-8.0.1/bin/ghc --make -odir /tmp/stack20456/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup -hidir /tmp/stack20456/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup -i -i. -package=Cabal-1.24.2.0 -clear-package-db -global-package-db -package-db=/home/username/.stack/snapshots/x86_64-linux/lts-7.10/8.0.1/pkgdb /tmp/stack20456/cairo-0.13.3.1/Setup.hs /home/username/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -main-is StackSetupShim.mainOverride -o /tmp/stack20456/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup -threaded
Process exited with code: ExitFailure 1
堆栈版本:
$ stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0
Cabal 版本:
$ stack exec cabal -- --version
cabal-install version 1.24.0.1
compiled using version 1.24.1.0 of the Cabal library
其他版本:
$ sudo apt-get install libgtk2.0-dev libpango1.0-dev libglib2.0-dev libcairo2-dev libghc-gtk-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcairo2-dev is already the newest version.
libglib2.0-dev is already the newest version.
libglib2.0-dev set to manually installed.
libgtk2.0-dev is already the newest version.
libgtk2.0-dev set to manually installed.
libpango1.0-dev is already the newest version.
libpango1.0-dev set to manually installed.
libghc-gtk-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove
我在这里而不是超级用户或 ubuntu 提出这个问题的原因是这个错误:
• Couldn't match expected type ‘Distribution.Simple.UserHooks.UserHooks’
with actual type ‘Cabal-1.24.1.0:Distribution.Simple.UserHooks.UserHooks’
似乎表明 Haskell 包代码本身有一些奇怪的地方,期望它位于一个更深一层的模块中,在 cabal-*: 内部,对吧?
其他未解决的参考文献:
- Building project dependent on gtk2hs fails on lts-7.8 and later
- https://github.com/commercialhaskell/stack/issues/2924
- https://github.com/commercialhaskell/stack/issues/2230
- https://github.com/commercialhaskell/stack/issues/2795
- Missing dependencies for chart-cairo on linux mint 17
我认为这与我遇到的问题相同recently
你可以试试吗
stack setup --upgrade-cabal
看看是否能解决问题。
== 编辑:==
但是,为了回答您的第一个问题,我可以使用以下命令通过堆栈安装 threadscope,
$ stack --resolver=nightly install threadscope
Selected resolver: nightly-2017-01-31
Copying from /home/wizzup/.stack/global-project/.stack-work/install/x86_64-linux-ncurses6/nightly-2017-01-31/8.0.2/bin/threadscope to /home/wizzup/.local/bin/threadscope
Copied executables to /home/wizzup/.local/bin/:
- threadscope
但我正在使用 Arch Linux。
为了成功编译 cairo
,您需要支持新的 custom-setup feature in Cabal 1.24。官方发布的 Stack 版本暂不支持,master
上已经支持了。为了安装它:
- 运行
stack upgrade --git --source-only
- 确保目标目录(通常是
$HOME/.local/bin
)在您的 PATH
上
- 为了更加确定,运行
stack --version
和 which stack
在此之后,stack build cairo
应该可以工作了。
我开始通过堆栈安装 threadscope(而不是 cabal,可以吗?https://wiki.haskell.org/ThreadScope)。 threadscope 需要开罗。
$ stack install cairo
cairo-0.13.3.1: configure
-- While building package cairo-0.13.3.1 using:
/home/username/.stack/programs/x86_64-linux/ghc-8.0.1/bin/ghc --make -odir /tmp/stack13291/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup -hidir /tmp/stack13291/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup -i -i. -package=Cabal-1.24.2.0 -clear-package-db -global-package-db -package-db=/home/username/.stack/snapshots/x86_64-linux/lts-7.10/8.0.1/pkgdb /tmp/stack13291/cairo-0.13.3.1/Setup.hs /home/username/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -main-is StackSetupShim.mainOverride -o /tmp/stack13291/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup -threaded
Process exited with code: ExitFailure 1
Logs have been written to: /home/username/.stack/global-project/.stack-work/logs/cairo-0.13.3.1.log
[1 of 2] Compiling Main ( /tmp/stack13291/cairo-0.13.3.1/Setup.hs, /tmp/stack13291/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/Main.o )
/tmp/stack13291/cairo-0.13.3.1/Setup.hs:8:29: error:
• Couldn't match expected type ‘Distribution.Simple.UserHooks.UserHooks’
with actual type ‘Cabal-1.24.1.0:Distribution.Simple.UserHooks.UserHooks’
NB: ‘Cabal-1.24.1.0:Distribution.Simple.UserHooks.UserHooks’
is defined in ‘Distribution.Simple.UserHooks’
in package ‘Cabal-1.24.1.0’
‘Distribution.Simple.UserHooks.UserHooks’
is defined in ‘Distribution.Simple.UserHooks’
in package ‘Cabal-1.24.2.0’
• In the first argument of ‘defaultMainWithHooks’, namely
‘gtk2hsUserHooks’
In the expression: defaultMainWithHooks gtk2hsUserHooks
In an equation for ‘main’:
main = defaultMainWithHooks gtk2hsUserHooks
为了更进一步,我尝试安装 gtk 构建工具:
$ stack install gtk2hs-buildtools
Copying from /home/username/.stack/snapshots/x86_64-linux/lts-7.10/8.0.1/bin/gtk2hsC2hs to /home/username/.local/bin/gtk2hsC2hs
Copying from /home/username/.stack/snapshots/x86_64-linux/lts-7.10/8.0.1/bin/gtk2hsHookGenerator to /home/username/.local/bin/gtk2hsHookGenerator
Copying from /home/username/.stack/snapshots/x86_64-linux/lts-7.10/8.0.1/bin/gtk2hsTypeGen to /home/username/.local/bin/gtk2hsTypeGen
Copied executables to /home/username/.local/bin:
- gtk2hsC2hs
- gtk2hsHookGenerator
- gtk2hsTypeGen
我一直在安装 cairo 时遇到同样的错误。我是 运行 Ubuntu 14.04 并且安装了 libcairo2-dev
:
$ stack install threadscope
glib-0.13.4.1: configure
cairo-0.13.3.1: configure
Progress: 2/6
-- While building package cairo-0.13.3.1 using:
/home/username/.stack/programs/x86_64-linux/ghc-8.0.1/bin/ghc --make -odir /tmp/stack20456/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup -hidir /tmp/stack20456/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup -i -i. -package=Cabal-1.24.2.0 -clear-package-db -global-package-db -package-db=/home/username/.stack/snapshots/x86_64-linux/lts-7.10/8.0.1/pkgdb /tmp/stack20456/cairo-0.13.3.1/Setup.hs /home/username/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -main-is StackSetupShim.mainOverride -o /tmp/stack20456/cairo-0.13.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup -threaded
Process exited with code: ExitFailure 1
堆栈版本:
$ stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0
Cabal 版本:
$ stack exec cabal -- --version
cabal-install version 1.24.0.1
compiled using version 1.24.1.0 of the Cabal library
其他版本:
$ sudo apt-get install libgtk2.0-dev libpango1.0-dev libglib2.0-dev libcairo2-dev libghc-gtk-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcairo2-dev is already the newest version.
libglib2.0-dev is already the newest version.
libglib2.0-dev set to manually installed.
libgtk2.0-dev is already the newest version.
libgtk2.0-dev set to manually installed.
libpango1.0-dev is already the newest version.
libpango1.0-dev set to manually installed.
libghc-gtk-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove
我在这里而不是超级用户或 ubuntu 提出这个问题的原因是这个错误:
• Couldn't match expected type ‘Distribution.Simple.UserHooks.UserHooks’
with actual type ‘Cabal-1.24.1.0:Distribution.Simple.UserHooks.UserHooks’
似乎表明 Haskell 包代码本身有一些奇怪的地方,期望它位于一个更深一层的模块中,在 cabal-*: 内部,对吧?
其他未解决的参考文献:
- Building project dependent on gtk2hs fails on lts-7.8 and later
- https://github.com/commercialhaskell/stack/issues/2924
- https://github.com/commercialhaskell/stack/issues/2230
- https://github.com/commercialhaskell/stack/issues/2795
- Missing dependencies for chart-cairo on linux mint 17
我认为这与我遇到的问题相同recently
你可以试试吗
stack setup --upgrade-cabal
看看是否能解决问题。
== 编辑:==
但是,为了回答您的第一个问题,我可以使用以下命令通过堆栈安装 threadscope,
$ stack --resolver=nightly install threadscope
Selected resolver: nightly-2017-01-31
Copying from /home/wizzup/.stack/global-project/.stack-work/install/x86_64-linux-ncurses6/nightly-2017-01-31/8.0.2/bin/threadscope to /home/wizzup/.local/bin/threadscope
Copied executables to /home/wizzup/.local/bin/:
- threadscope
但我正在使用 Arch Linux。
为了成功编译 cairo
,您需要支持新的 custom-setup feature in Cabal 1.24。官方发布的 Stack 版本暂不支持,master
上已经支持了。为了安装它:
- 运行
stack upgrade --git --source-only
- 确保目标目录(通常是
$HOME/.local/bin
)在您的PATH
上
- 为了更加确定,运行
stack --version
和which stack
在此之后,stack build cairo
应该可以工作了。