haskell / alex

A lexical analyser generator for Haskell
https://hackage.haskell.org/package/alex
BSD 3-Clause "New" or "Revised" License
297 stars 82 forks source link

Alex fails to compile on Arch Linux #167

Closed felipebalbi closed 3 years ago

felipebalbi commented 3 years ago

Hi,

when trying to compile, I get a lot of missing packages, even though I have all dependencies installed. In fact, even Prelude is "missing". Any ideas?

$ cabal new-run gen-alex-sdist
Build profile: -w ghc-8.10.2 -O1
In order, the following will be built (use -v for more details):
 - gen-alex-sdist-0 (exe:gen-alex-sdist) (first run)
Configuring executable 'gen-alex-sdist' for gen-alex-sdist-0..
Preprocessing executable 'gen-alex-sdist' for gen-alex-sdist-0..
Building executable 'gen-alex-sdist' for gen-alex-sdist-0..
[1 of 1] Compiling Main             ( Main.hs, /home/balbi/workspace/alex/dist-newstyle/build/x86_64-linux/ghc-8.10.2/gen-alex-sdist-0/x/gen-alex-sdist/build/gen-alex-sdist/gen-alex-sdist-tmp/Main.o )

Main.hs:1:8: error:
    Could not find module ‘Prelude’
    There are files missing in the ‘base-4.14.1.0’ package,
    try running 'ghc-pkg check'.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
1 | module Main (main) where
  |        ^^^^

Main.hs:3:1: error:
    Could not find module ‘Control.Monad’
    There are files missing in the ‘base-4.14.1.0’ package,
    try running 'ghc-pkg check'.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
3 | import           Control.Monad
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Main.hs:4:1: error:
    Could not find module ‘Data.List’
    There are files missing in the ‘base-4.14.1.0’ package,
    try running 'ghc-pkg check'.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
4 | import qualified Data.List                   as List
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Main.hs:5:1: error:
    Could not find module ‘Language.Preprocessor.Cpphs’
    There are files missing in the ‘cpphs-1.20.9.1’ package,
    try running 'ghc-pkg check'.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
5 | import           Language.Preprocessor.Cpphs
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Main.hs:6:1: error:
    Could not find module ‘System.Directory’
    There are files missing in the ‘directory-1.3.6.0’ package,
    try running 'ghc-pkg check'.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
6 | import           System.Directory
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Main.hs:7:1: error:
    Could not find module ‘System.FilePath’
    There are files missing in the ‘filepath-1.4.2.1’ package,
    try running 'ghc-pkg check'.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
7 | import           System.FilePath
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Ericson2314 commented 3 years ago

This does seem like an issue with your installation, and not with alex in particular. I would try to see if you can build other packages first, as this doesn't appear to be an Alex-specific issue.

Ericson2314 commented 3 years ago

Closing unless/until there is evidence this is Alex-specific.