无法编译xmonad.hs文件

时间:2018-05-01 15:22:06

标签: haskell archlinux window-managers xmonad

我在基于arch的系统上使用xmonad。但升级后,我无法通过

编译我的xmonad.hs文件

$ xmonad --recompile

我似乎在xmonad的每个模块上都出现错误,即使导入XMonad似乎也无法正常工作。 如果有人以某种方式解决了这个问题,请告诉我。

错误消息:

Error detected while loading xmonad configuration file: 
/home/arya/.xmonad/xmonad.hs

xmonad.hs:2:1: error:
    Could not find module ‘XMonad’
    Use -v to see a list of the files searched for.
  |
2 | import XMonad
  | ^^^^^^^^^^^^^

xmonad.hs:3:1: error:
    Could not find module ‘XMonad.Config.Mate’
    Use -v to see a list of the files searched for.
  |
3 | import XMonad.Config.Mate
  | ^^^^^^^^^^^^^^^^^^^^^^^^^

xmonad.hs:5:1: error:
    Could not find module ‘XMonad.StackSet’
    Use -v to see a list of the files searched for.
  |
5 | import qualified XMonad.StackSet as W
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

xmonad.hs:8:1: error:
    Could not find module ‘XMonad.Hooks.ManageDocks’
    Use -v to see a list of the files searched for.
  |
8 | import XMonad.Hooks.ManageDocks
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

xmonad.hs:9:1: error:
    Could not find module ‘XMonad.Hooks.EwmhDesktops’
    Use -v to see a list of the files searched for.
  |
9 | import XMonad.Hooks.EwmhDesktops
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

xmonad.hs:10:1: error:
    Could not find module ‘XMonad.Layout.Minimize’
    Use -v to see a list of the files searched for.
   |
10 | import XMonad.Layout.Minimize
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Please check the file for errors.

[arya@localhost ~]$ Warning: Missing charsets in String to FontSet 
conversion
[arya@localhost ~]$ 
monad.hs:9:1: error:
    Could not find module ‘XMonad.Hooks.EwmhDesktops’
    Use -v to see a list of the files searched for.
  |
9 | import XMonad.Hooks.EwmhDesktops
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

xmonad.hs:10:1: error:
    Could not find module ‘XMonad.Layout.Minimize’
    Use -v to see a list of the files searched for.
   |
10 | import XMonad.Layout.Minimize
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

输出:

$ type -a ghc

ghc is /usr/local/bin/ghc
ghc is /usr/bin/ghc

输出 $ ghc-pkg list

 /usr/local/haskell/ghc-8.2.2-x86_64/lib/ghc-8.2.2/package.conf.d
    Cabal-2.0.1.0
    array-0.5.2.0
    base-4.10.1.0
    binary-0.8.5.1
    bytestring-0.10.8.2
    containers-0.5.10.2
    deepseq-1.4.3.0
    directory-1.3.0.2
    filepath-1.4.1.2
    (ghc-8.2.2)
    ghc-boot-8.2.2
    ghc-boot-th-8.2.2
    ghc-compact-0.1.0.0
    ghc-prim-0.5.1.1
    ghci-8.2.2
    haskeline-0.7.4.0
    hoopl-3.10.2.2
    hpc-0.6.0.3
    integer-gmp-1.0.1.0
    pretty-1.1.3.3
    process-1.6.1.0
    rts-1.0
    template-haskell-2.12.0.0
    terminfo-0.4.1.0
    time-1.8.0.2
    transformers-0.5.2.0
    unix-2.7.2.2
    xhtml-3000.2.2

pacman -Ql xmonad的输出:

xmonad /usr/
xmonad /usr/bin/
xmonad /usr/bin/xmonad
xmonad /usr/lib/
xmonad /usr/lib/ghc-8.2.2/
xmonad /usr/lib/ghc-8.2.2/site-local/
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/Paths_xmonad.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/Config.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/Core.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/Layout.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/Main.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/ManageHook.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/Operations.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/StackSet.dyn_hi
xmonad /usr/lib/libHSxmonad-0.13-K842KXy8eLK2djQHd55ZyZ-ghc8.2.2.so
xmonad /usr/share/
xmonad /usr/share/doc/
xmonad /usr/share/doc/xmonad/
xmonad /usr/share/doc/xmonad/LICENSE
xmonad /usr/share/haskell/
xmonad /usr/share/haskell/register/
xmonad /usr/share/haskell/register/xmonad.sh
xmonad /usr/share/haskell/unregister/
xmonad /usr/share/haskell/unregister/xmonad.sh
xmonad /usr/share/licenses/
xmonad /usr/share/licenses/xmonad/
xmonad /usr/share/licenses/xmonad/LICENSE
xmonad /usr/share/man/
xmonad /usr/share/man/man1/
xmonad /usr/share/man/man1/xmonad.1.gz
xmonad /usr/share/pixmaps/
xmonad /usr/share/pixmaps/xmonad.svg
xmonad /usr/share/xmonad/
xmonad /usr/share/xmonad/man/
xmonad /usr/share/xmonad/man/xmonad.1
xmonad /usr/share/xmonad/man/xmonad.1.html
xmonad /usr/share/xmonad/man/xmonad.hs
xmonad /usr/share/xsessions/
xmonad /usr/share/xsessions/xmonad.desktop

2 个答案:

答案 0 :(得分:1)

略有相关,

在全新安装的 UBUNTU 20.10 中,当我使用 sudo apt install xmonad 通过 apt 安装 xmonad 时遇到了这个问题。我认为这也安装了 xmonad-contrib,它位于 libghc-xmonad-contrib-dev,因为当我尝试安装它以查看它是否修复时,我已经安装了它。最后修复它的是 cabal-installing xmonad 和 xmonad-contrib,使用 cabal install xmonad 然后 cabal install --lib xmonad-contrib,同时在 ~/.xmonad/build 中创建构建命令。

~/.xmonad/build 的内容:

ghc -package xmonad -package xmonad-contrib --make xmonad.hs -i -ilib -main-is main -fforce-recomp -o xmonad

如果有帮助,这里是我的命令历史:

 1912  ghc-pkg list # to check the output, just as in the question
 1913  cabal install xmonad
 1914  xmonad --recompile
 1915  cabal install xmonad-contrib
 1916  cabal install --lib xmonad-contrib # the previous line gave a warning, so I issued a corrected command.
 1917  xmonad --recompile
 1918  ghc -package xmonad ~/.xmonad/monad.hs
 1919  ghc -package xmonad ~/.xmonad/xmonad.hs # the previous line had a typo, so I had to issue the command again.
 1920  xmonad --recompile
 1921  nano .xmonad/build # when I tried the previous command, it said something about creating the following file, so I created it.
 1922  xmonad --recompile
 1923  chmod u+x .xmonad/build # when I tried the previous command, it complained about the file not being executable and recommended those permissions.
 1924  xmonad --recompile # worked!!!

答案 1 :(得分:0)

Arch linux上的XMonad包可能存在一些问题。

作为替代方案,您可以尝试pacman -s haskell-cabalcabal install xmonad