[GHC] #14482: GHC -M mode fails to ensure that boot files are built before source files

#14482: GHC -M mode fails to ensure that boot files are built before source files -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Imagine we have a module with a boot file. In general it is necessary to ensure that we compile the boot file *before* the source file to ensure that the `hi-boot` file exists when we go to typecheck the module (triggering the behavior observed in #14481). However, `ghc -M` doesn't guarantee this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14482 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14482: GHC -M mode fails to ensure that boot files are built before source files -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14481 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * related: => #14481 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14482#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14482: GHC -M mode fails to ensure that boot files are built before source files -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14481 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): The repro from which I deduced this can be found here: https://github.com/bgamari/T14481-repro -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14482#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14482: GHC -M mode fails to ensure that boot files are built before source files -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14481 | Differential Rev(s): Phab:D4208 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D4208 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14482#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14482: GHC -M mode fails to ensure that boot files are built before source files -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14481 | Differential Rev(s): Phab:D4208 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I think the payload of the patch is: * Make `M.o` depend on `M.hi-boot`. But let me ask this: in what program will that that not happen without this patch? I think only on programs where * Neither `M.hs` nor any of the module that `M.hs` imports, transitively, does a `{-# SOURCE #-}` import of `M`. And in those cases we can just get rid of `M.hs-boot` entirely. It's not needed. I've had a look at the example in #14481. (I'm not sure why this ticket is distinct from #14481, incidentally.) I believe it has the same property: no one imports `Instances1` in fact. I grant that GHC should not crash. But rather than simply adding an extra dependency, if we find that if there is no transitive edge from `M.hs` to `M.hs-boot`, we should a) add one b) emit a warning that `M.hs-boot` is apparently redundant. Failing to do (b) seems wrong. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14482#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14482: GHC -M mode fails to ensure that boot files are built before source files -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14481 | Differential Rev(s): Phab:D4208 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: (none) => bgamari -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14482#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14482: GHC -M mode fails to ensure that boot files are built before source files -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14481 | Differential Rev(s): Phab:D4208 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): The original problem (which isn't clearly stated above): * `A.hs-boot` must be compiled before `A.hs`. Otherwise there is no check that `A.hs-boot` correctly reflects `A.hs`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14482#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14482: GHC -M mode fails to ensure that boot files are built before source files -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.10.1 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14481 | Differential Rev(s): Phab:D4208 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.8.1 => 8.10.1 Comment: This won't happen for 8.8. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14482#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC