tweag / rules_haskell

Haskell rules for Bazel.
https://haskell.build
Apache License 2.0
266 stars 80 forks source link

There are files missing in the package / ghc-pkg check error #1754

Closed brendanhay closed 10 months ago

brendanhay commented 2 years ago

After upgrading to the latest commit (from v0.14) I receive numerous errors of the following form:

Use --sandbox_debug to see verbose messages from the sandbox

Control/Concurrent/Async.hs:217:1: error:
    Could not find module ‘Data.Hashable’
    There are files missing in the ‘hashable-1.4.0.2’ package,
    try running 'ghc-pkg check'.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
    |
217 | import Data.Hashable (Hashable(hashWithSalt))
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Numerous other libraries like divisible and contravariant all fail with the same error(s). The stack_snapshot's stackage/BUILD.bazel entries look fine, as do the source directories themselves (ie. containing the correct files/structure.)

haskell_cabal_library(
    name = "hashable",
    version = "1.4.0.2",
    haddock = False,
    flags = [],
    srcs = glob(["hashable-1.4.0.2/**"]),
    deps = ["base", "bytestring", "containers", "deepseq", "ghc-bignum", "ghc-prim", "text"],
    setup_deps = [],
    tools = ["@nixpkgs_alex//:bin/alex", "@nixpkgs_c2hs//:bin/c2hs", "@nixpkgs_happy//:bin/happy"],
    visibility = ["//visibility:public"],
    cabalopts = ["--ghc-option=-w", "--ghc-option=-optF=-w"],
    verbose = False,
    unique_name = True,
)

Is this an error someone else has run into previously? Manually writing a BUILD file and vendoring in the stack_snapshot etc. works, even with the exact content above.

avdv commented 10 months ago

Closing, since after +1 year this is hard to reproduce and it seems nobody bumped into this in the meantime. Please re-open if you still hit this with v0.17 or HEAD of the default branch.