Reputation: 58
I'm new to Haskell and just installed GHC, Cabal and all the dependencies on my new Arch Linux installation. I tried to run $ cabal run
but I always get this error:
Resolving dependencies...
Build profile: -w ghc-9.0.2 -O1
In order, the following will be built (use -v for more details):
- password-types-1.0.0.0 (lib:password-types) (requires build)
- text-short-0.1.5 (lib) (requires build)
- base64-0.4.2.3 (lib) (requires build)
- password-3.0.0.0 (lib:password) (requires build)
- PasswordManager-0.2.0.0 (exe:PasswordManager) (first run)
Starting password-types-1.0.0.0 (all, legacy fallback)
Starting text-short-0.1.5 (lib)
Building text-short-0.1.5 (lib)
Building password-types-1.0.0.0 (all, legacy fallback)
Failed to build password-types-1.0.0.0.
Build log (
/root/.cabal/logs/ghc-9.0.2/password-types-1.0.0.0-b6ad46c3a2a5c46e5a3feb8166bef298a0c1c24aaa421ab87c68c474481242d7.log
):
[1 of 1] Compiling Main ( /home/anonymous/Coding/PasswordManager/dist-newstyle/tmp/src-220869/password-types-1.0.0.0/dist/setup/setup.hs, /home/anonymous/Coding/PasswordManager/dist-newstyle/tmp/src-220869/password-types-1.0.0.0/dist/setup/Main.o )
Linking /home/anonymous/Coding/PasswordManager/dist-newstyle/tmp/src-220869/password-types-1.0.0.0/dist/setup/setup ...
Configuring password-types-1.0.0.0...
Preprocessing library for password-types-1.0.0.0..
Building library for password-types-1.0.0.0..
[1 of 2] Compiling Data.Password.Types ( src/Data/Password/Types.hs, dist/build/Data/Password/Types.o, dist/build/Data/Password/Types.dyn_o )
src/Data/Password/Types.hs:53:1: error:
Could not find module ‘Data.ByteArray’
There are files missing in the ‘memory-0.16.0’ package,
try running 'ghc-pkg check'.
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
53 | import Data.ByteArray (constEq)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed to build text-short-0.1.5.
Build log (
/root/.cabal/logs/ghc-9.0.2/text-short-0.1.5-acb1ce3e536dccc589b85edcd09cd042b082277864b4c8b1812554d67c66f493.log
):
Configuring library for text-short-0.1.5..
Preprocessing library for text-short-0.1.5..
Building library for text-short-0.1.5..
[1 of 5] Compiling PrimOps ( src-ghc804/PrimOps.hs, dist/build/PrimOps.o, dist/build/PrimOps.dyn_o )
[2 of 5] Compiling Data.Text.Short.Internal ( src/Data/Text/Short/Internal.hs, dist/build/Data/Text/Short/Internal.o, dist/build/Data/Text/Short/Internal.dyn_o )
src/Data/Text/Short/Internal.hs:122:1: error:
Could not find module ‘Data.Hashable’
There are files missing in the ‘hashable-1.4.0.0’ package,
try running 'ghc-pkg check'.
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
122 | import Data.Hashable (Hashable)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Failed to build password-types-1.0.0.0 (which is required by
exe:PasswordManager from PasswordManager-0.2.0.0). See the build log above for
details.
Failed to build text-short-0.1.5 (which is required by exe:PasswordManager
from PasswordManager-0.2.0.0). See the build log above for details.
I only added the package password
to my build dependencies. I tried installing the packages ByteArray
and hashable
manually but it still doesn't work. When I run $ ghc-pkg check
I get all these warnings:
Warning: haddock-interfaces: /usr/share/doc/haskell-zlib/html/zlib.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-zlib/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-th-compat/html/th-compat.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-th-compat/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-tar/html/tar.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-tar/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-splitmix/html/splitmix.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-splitmix/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-resolv/html/resolv.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-resolv/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-regex-posix/html/regex-posix.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-regex-posix/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-regex-base/html/regex-base.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-regex-base/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-random/html/random.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-random/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-network/html/network.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-network/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-network-uri/html/network-uri.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-network-uri/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-lukko/html/lukko.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-lukko/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-http/html/HTTP.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-http/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-hashable/html/hashable.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-hashable/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-hackage-security/html/hackage-security.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-hackage-security/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-ghc-bignum-orphans/html/ghc-bignum-orphans.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-ghc-bignum-orphans/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-edit-distance/html/edit-distance.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-edit-distance/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-ed25519/html/ed25519.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-ed25519/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-echo/html/echo.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-echo/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-cryptohash-sha256/html/cryptohash-sha256.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-cryptohash-sha256/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-base64-bytestring/html/base64-bytestring.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-base64-bytestring/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-base16-bytestring/html/base16-bytestring.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-base16-bytestring/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-base-orphans/html/base-orphans.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-base-orphans/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-async/html/async.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-async/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/share/doc/haskell-haddock-library/html/haddock-library.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/share/doc/haskell-haddock-library/html doesn't exist or isn't a directory
I have no idea what all this means and why nothing works even though this is a fresh Linux, Haskell and cabal installation.
Upvotes: 0
Views: 387
Reputation: 10645
The Arch Linux packages for Haskell related things don't work out of the box. See the arch wiki:
Since version 8.0.2-1, the Arch ghc package and all haskell-* packages in community provide only dynamically linked libraries. Therefore, to link successfully one must configure GHC, Cabal and Stack for dynamic linking, as the default is to use static linking.
I would suggest uninstalling them and using ghcup to get a normal Haskell experience. But you can also follow the further instructions on that Arch Wiki page.
Upvotes: 4