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

Package for import is guessed incorrectly #90

Open
edsko opened this issue Jun 24, 2013 · 4 comments
Open

Package for import is guessed incorrectly #90

edsko opened this issue Jun 24, 2013 · 4 comments

Comments

@edsko
Copy link
Collaborator

edsko commented Jun 24, 2013

It seems that if an import is for a module which is available both in the home package and in a package installed in the system, we might construct the wrong IdInfo (the ghc-error test for issue #88 fails for this reason when the gitlib-cross package is installed, because it exports module "Foo").

Mikolaj added a commit that referenced this issue Jun 24, 2013
One of them with the failing parts commented out. See #90.
@Mikolaj
Copy link
Collaborator

Mikolaj commented Jun 24, 2013

I've verified the problem is unrelated to #88 and very minor. I've pushed tests that confirm that. I'm suspending the work on this issue until further orders.

18:45 < mikolaj> from http://www.haskell.org/ghc/docs/7.4.2/html/users_guide/packages.html#package-overlaps
18:45 < mikolaj> It is possible that by using packages you might end up with a program that contains two modules with the same name: perhaps you used a package P that has a hidden module M, and there is also a module M in your program.
Or perhaps the dependencies of packages that you used contain some overlapping modules. Perhaps the program even contains multiple versions of a certain package, due to dependencies from other packages.
18:45 < mikolaj> None of these scenarios gives rise to an error on its own[8], but they may have some interesting consequences. For instance, if you have a type M.T from version 1 of package P, then this is not the same as the type M.T
from version 2 of package P, and GHC will report an error if you try to use one where the other is expected.
18:46 < mikolaj> so it seems it's unspecified which module will be used --- it just happens that our idInfo code picks a different package than GHC API in this case

@edsko
Copy link
Collaborator Author

edsko commented Jun 25, 2013

[18:46] but I am surprised that the test fails, since defOpts includes -hide-all-packages, so Foo from gitlib-cross should not be visible
[18:47] mikolaj: ^^
[18:47] mikolaj: maybe it's enough to fx our code to look at visible packages only?

@Mikolaj
Copy link
Collaborator

Mikolaj commented Jun 25, 2013

12:50 < mikolaj> so I added -hide-all-packages to the test
12:50 < edsko> but isn't that what we provide by default?
12:50 < mikolaj> not on master and experimental
12:50 < edsko> ah
12:50 < edsko> ok
12:50 < edsko> so with -hide-all-packages it works?
12:50 < mikolaj> yep
12:50 < edsko> great
12:50 < mikolaj> see my commit

@edsko
Copy link
Collaborator Author

edsko commented Dec 19, 2013

This is due to a TODO in ghc itself; see #95 (comment) for details. (And this is still a TODO in ghc 7.8, incidentally.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants