tweag / rules_haskell

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

haskell_doctest is failing when there are more than one targets in `deps`. #1712

Open ylecornec opened 2 years ago

ylecornec commented 2 years ago

To reproduce Inside the rules_haskell repository, bazel build //tests/haskell_doctest_multiple_deps:both_doctest fails for me with:

Traceback (most recent call last):
    File "/home/stan/tools/rules_haskell/haskell/doctest.bzl", line 180, column 44, in _haskell_doctest_impl
        logs.append(_haskell_doctest_single(dep, ctx))
    File "/home/stan/tools/rules_haskell/haskell/doctest.bzl", line 137, column 42, in _haskell_doctest_single
        depset(get_ghci_library_files(hs, cc_libraries_info, cc.transitive_libraries)),
    File "/home/stan/tools/rules_haskell/haskell/private/cc_libraries.bzl", line 57, column 50, in get_ghci_library_files
        static_libs, dynamic_libs = get_library_files(
    File "/home/stan/tools/rules_haskell/haskell/private/cc_libraries.bzl", line 103, column 54, in get_library_files
        cc_library_info = cc_libraries_info.libraries[cc_library_key(lib_to_link)]
Error: key struct(dynamic_library = "bazel-out/k8-fastbuild/bin/_solib_k8/libHStestsZShaskellZUdoctestZUmultipleZUdepsZSbaz-ghc8.10.7.so", interface_library = None, pic_static_library = None, static_library = "bazel-out/k8-fastbuild/bin/tests/haskell_doctest_multiple_deps/libHStestsZShaskellZUdoctestZUmultipleZUdepsZSbaz.a") not found in dictionary

Environment

aherrmann commented 2 years ago

Thanks for the repro! It looks like haskell_cc_libraries_aspect is missing or not forwarded correctly somewhere in this.