[GHC] #15594: --abi-hash with Backpack incorrectly loads modules from dependent packages
#15594: --abi-hash with Backpack incorrectly loads modules from dependent packages -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Keywords: backpack | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Repro at: https://github.com/alexbiehl/cabal-backpack-register- repro/blob/master/src/Lib.hs -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15594> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15594: --abi-hash with Backpack incorrectly loads modules from dependent packages -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5123 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * status: new => patch * differential: => Phab:D5123 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15594#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15594: --abi-hash with Backpack incorrectly loads modules from dependent packages -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5123 Wiki Page: | -------------------------------------+------------------------------------- Description changed by ezyang: Old description:
Repro at: https://github.com/alexbiehl/cabal-backpack-register- repro/blob/master/src/Lib.hs
New description: Repro at: https://github.com/alexbiehl/cabal-backpack-register-repro -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15594#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15594: --abi-hash with Backpack incorrectly loads modules from dependent packages -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5123 Wiki Page: | -------------------------------------+------------------------------------- Description changed by ezyang: Old description:
Repro at: https://github.com/alexbiehl/cabal-backpack-register-repro
New description: Repro at: https://github.com/alexbiehl/cabal-backpack-register-repro If you use Backpack with data families, you might fail during `--abi-hash` with: {{{ cabal: '/nix/store/m338klajhqlw7v4jd61fiqd82wx305fj-ghc-8.4.3-with- packages/bin/ghc' exited with an error: Failed to load interface for ‘Stuff’ no unit id matching ‘backpack-trans-0.1.0.0-L6CFTQZAAWWFpCQD2NXR4W-indef’ was found }}} -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15594#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15594: --abi-hash with Backpack incorrectly loads modules from dependent packages -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5123 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Edward Z. Yang <ezyang@…>): In [changeset:"13ff0b7ced097286e0d7b054f050871effe07f86/ghc" 13ff0b7c/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="13ff0b7ced097286e0d7b054f050871effe07f86" Fix #15594 (--abi-hash with Backpack sometimes fails) Summary: For holes, its necessary to "see through" the instantiation of the hole to get accurate family instance dependencies. For example, if B imports <A>, and <A> is instantiated with F, we must grab and include all of the dep_finsts from F to have an accurate transitive dep_finsts list. However, we MUST NOT do this for regular modules. First, for efficiency reasons, doing this bloats the the dep_finsts list, because we *already* had those modules in the list (it wasn't a hole module, after all). But there's a second, more important correctness consideration: we perform module renaming when running --abi-hash. In this case, GHC's contract to the user is that it will NOT go and read out interfaces of any dependencies (https://github.com/haskell/cabal/issues/3633); the point of --abi-hash is just to get a hash of the on-disk interfaces for this *specific* package. If we go off and tug on the interface for /everything/ in dep_finsts, we're gonna have a bad time. (It's safe to do do this for hole modules, though, because the hmap for --abi-hash is always trivial, so the interface we request is local. Though, maybe we ought not to do it in this case either...) Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: validate Reviewers: alexbiehl, goldfire, bgamari Subscribers: ppk, shlevy, rwbarton, carter GHC Trac Issues: #15594 Differential Revision: https://phabricator.haskell.org/D5123 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15594#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC