[GHC] #13168: Ambiguous interface errors in GHCi, even with -XPackageImports

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Originally reported in https://github.com/haskell/cabal/issues/4253, but I moved it here after being reassured that this was a GHCi bug, not a `Cabal` one. To reproduce this issue, you'll need to install two libraries that export two constructors with the same name. The original issue uses `GLFW` and `GLFW-b` as examples, but for the puposes of test case minimalization, I've prepared a repo here (https://github.com/RyanGlScott/cabal-gh4253) with as small of an example as I can manage. To reproduce the issue, do the following: {{{ $ git clone https://github.com/RyanGlScott/cabal-gh4253 $ cd cabal-gh4253/ $ cabal install package1/ package2/ $ ghci -XPackageImports GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci λ> import "package1" DuplicateModuleName λ> Window <interactive>:1:1: error: Ambiguous interface for ‘DuplicateModuleName’: it was found in multiple packages: package1-0.1.0.0 package2-0.1.0.0 }}} This seems to be specific to GHCi, because I cannot find a way to trigger the same issue with `ghc --make`. I've reproduced this with GHC 8.0.2 and HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13168 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13168#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #5979 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: => #5979 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13168#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #5979 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by saurabhnanda): Is this related -- http://stackoverflow.com/questions/41896211/how-to-use- packageimports-extension-to-shadow-a-module ? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13168#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #5979 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by saurabhnanda): What's the easiest way to get the following in GHCi? * List of all modules exported by a package * List of all names exported by a module -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13168#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #5979 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): * I don't think there is a command to do this in GHCi specifically. I would use `ghc-pkg describe <pkg>` or `ghc-pkg field <pkg> exposed- modules`. * Use `:browse Data.List`, for example. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13168#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: ak3n Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #5979 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ak3n): * owner: (none) => ak3n -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13168#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: ak3n Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #5979 | Differential Rev(s): Phab:D3738 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ak3n): * differential: => Phab:D3738 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13168#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: ak3n
Type: bug | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 8.0.2
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: #5979 | Differential Rev(s): Phab:D3738
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: ak3n
Type: bug | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 8.0.2
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: #5979 | Differential Rev(s): Phab:D3738
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13168: Ambiguous interface errors in GHCi, even with -XPackageImports -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: ak3n Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: GHCi | Version: 8.0.2 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #5979 | Differential Rev(s): Phab:D3738 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.4.1 Comment: Thanks ak3n! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13168#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC