faylang / fay

A proper subset of Haskell that compiles to JavaScript
https://github.com/faylang/fay/wiki
BSD 3-Clause "New" or "Revised" License
1.29k stars 86 forks source link

Fix ghc-pkg issue while running tests on cabal >= 3.2.0.0 #470

Open swamp-agr opened 3 years ago

swamp-agr commented 3 years ago

With substituted -package-conf argument:

fay-tests -package-conf ./dist-newstyle/packagedb/ghc-8.8.4/fay-base-0.21.1.1-inplace.conf
...
    tests/whereBind3.hs:                               FAIL
      Exception: ghc-pkg describe error:
      ghc-pkg: ghc no longer supports single-file style package databases (./dist-newstyle/packagedb/ghc-8.8.4/fay-base-0.21.1.1-inplace.conf) use 'ghc-pkg init'to create the database with the correct format.

      GHC package manager version 8.8.4

      CallStack (from HasCallStack):
        error, called at src/Fay/Compiler/Packages.hs:74:24 in fy-0.24.1.0-ee9f8930:Fay.Compiler.Packages

Without arguments:

fay-tests
...
    tests/whereBind3.hs:                               FAIL
      Exception: ghc-pkg describe error:
      Timestamp 2021-01-02 17:48:09.931464101 UTC for $HOME/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/package.conf.d/package.cache
      ghc-pkg: cannot find package fay-base

      GHC package manager version 8.8.4
      using cache: $HOME/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/package.conf.d/package.cache
      db stack: ["$HOME/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/package.conf.d"]
      flag db stack: ["$HOME/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/package.conf.d"]

      CallStack (from HasCallStack):
        error, called at src/Fay/Compiler/Packages.hs:74:24 in fy-0.24.1.0-ee9f8930:Fay.Compiler.Packages
swamp-agr commented 3 years ago

ghc-pkg pointed to local package database directory instead of single file seems to resolve it. However, several cases are still failing.

fay-tests -package-conf ./dist-newstyle/packagedb/ghc-8.8.4 -base-path ./fay-base/src
...
15 out of 268 tests failed (95.12s)