Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transitive re-exporting does not work #1145

Closed
eltix opened this issue Nov 14, 2019 · 3 comments
Closed

Transitive re-exporting does not work #1145

eltix opened this issue Nov 14, 2019 · 3 comments
Assignees
Labels

Comments

@eltix
Copy link

eltix commented Nov 14, 2019

Describe the bug

When there are at least two levels of re-exporting, the innermost modules do not get exported.

To Reproduce
Consider the following example:

haskell_library(
    name = "lib",
    exports = [
        ":a",
        ":b",
        ":c",
    ],
    deps = [
        ":a",
        ":b",
        ":c",
    ],
)

haskell_library(
    name="pipeline",
    exports = [":lib"],
    deps=[
      "@hackage//:aeson",
      ":lib",
     ]

haskell_binary(
    name="exe",
    srcs=["src/Main.hs"],
    deps=[
        "@hackage//:base",
        ":pipeline",
    ],
)

The above will fail upon building with this error:

src/Main.hs:21:1: error:
    Could not load module ‘A’
    It is a member of the hidden package ‘a’.
    You can run ‘:set -package a’ to expose it.
    (Note: this unloads all the modules in the current scope.)
    Use -v to see a list of the files searched for.
   |
21 | import qualified A  as A

where A.hs is a Haskell source file of the library ":a"

Everything works fine when ":lib" is added to the deps of the haskell binary.

Expected behavior
We shouldn't have to add ":lib" to the deps of the haskell binary since it's already re-exported by ":pipeline"

Environment

  • OS name + version: Ubuntu 19.10
  • Bazel version: "Build label: 0.28.0- (@Non-Git)"
  • Version of the rules: "23c6b64cae7db676485a1e401698520f4cdd8254"
@aherrmann aherrmann added the P3 minor: not priorized label Feb 21, 2022
@aherrmann
Copy link
Member

At a cursory look, fixing this will probably require tracking exports transitively here instead of just the direct exports. This should probably be done by using a depset instead of a list to track these.

@aherrmann
Copy link
Member

@prednaz was this resolved by #2125? If so, please close. 🙂

@prednaz
Copy link
Member

prednaz commented Mar 13, 2024

fixed by #2125

@prednaz prednaz closed this as completed Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants