[GHC] #16228: ghc-pkg and ghc do not agree about package with internal libraries

#16228: ghc-pkg and ghc do not agree about package with internal libraries --------------------------------------+--------------------------------- Reporter: michaelpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 8.6.3 Keywords: | Operating System: Linux Architecture: x86_64 (amd64) | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: --------------------------------------+--------------------------------- Initially I reported this to Cabal (https://github.com/haskell/cabal/issues/5857), but I think this is actually a GHC bug. Repro here: https://github.com/michaelpj/cabal-bug-package-db In particular, you can run the following. {{{ $ cabal build $ ghc-pkg field test exposed -f dist/package.conf.inplace exposed: True $ ghc-pkg find-module Test -f dist/package.conf.inplace dist/package.conf.inplace test-0.1.0.0 $ ghc -package-db dist/package.conf.inplace Use.hs [1 of 1] Compiling Use ( Use.hs, Use.o ) Use.hs:3:1: error: Could not load module ‘Test’ It is a member of the hidden package ‘test-0.1.0.0’. You can run ‘:set -package test’ to expose it. (Note: this unloads all the modules in the current scope.) Use -v to see a list of the files searched for. | 3 | import Test | ^^^^^^^^^^^ $ ghc -package-db dist/package.conf.inplace -package test Use.hs [1 of 1] Compiling Use ( Use.hs, Use.o ) }}} That is: * `ghc-pkg` thinks the package is present, exposed, and contains the module in question. * `ghc` thinks the package is hidden, and will accept it when specified with `-package`. If you comment out the internal library this does not happen, but regardless it seems bad that there's a disagreement between `ghc-pkg` and `ghc`. I've also observed (although I don't have a small reproduction for this) a similar case where `ghc` does not even think the module is hidden, but again will accept it with `-package`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16228 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16228: ghc-pkg and ghc do not agree about package with internal libraries ---------------------------------+-------------------------------------- Reporter: michaelpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 8.6.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+-------------------------------------- Comment (by michaelpj): Correction: the case where I do not get the "hidden package" message is using ghc 8.4.4, whereas in the other case I am using 8.6.3. I believe the latter has https://gitlab.haskell.org/ghc/ghc/commit/4c364402ad9edade698863a3684f395e73... but the former does not, so I think these are in fact exactly the same thing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16228#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16228: ghc-pkg and ghc do not agree about package with internal libraries ---------------------------------+-------------------------------------- Reporter: michaelpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 8.6.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+-------------------------------------- Comment (by michaelpj): With 8.6.3 I can now sometimes only fix the problem by passing the full package id, the package name no longer succeeds in unhiding it. Sadly that makes my workaround quite a bit trickier... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16228#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16228: ghc-pkg and ghc do not agree about package with internal libraries ---------------------------------+-------------------------------------- Reporter: michaelpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 8.6.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+-------------------------------------- Changes (by angerman): * cc: angerman (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16228#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16228: ghc-pkg and ghc do not agree about package with internal libraries ---------------------------------+-------------------------------------- Reporter: michaelpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 8.6.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+-------------------------------------- Comment (by michaelpj): This seems to only sometimes happen. In particular, depending on apparently unrelated downstream changes, the workaround of passing `-package foo` will occasionally stop working. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16228#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC