[GHC] #11755: Seed unsafeGlobalDynFlags with enough information to use ppr
#11755: Seed unsafeGlobalDynFlags with enough information to use ppr -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 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: -------------------------------------+------------------------------------- At the moment the pretty-printer isn't functional if used before `DynFlags` is initialized by `initGhcMonad`. In particular things like `pprPanic` aren't usable since `unsafeGlobalDynFlags` isn't yet initialized. This is quite annoying during development. It seems like it should be possible to seed `unsafeGlobalDynFlags` with some minimal `DynFlags`, presumably with rather verbose output (as this is presumably what you want when debugging a compiler crash early in startup). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11755> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11755: Seed unsafeGlobalDynFlags with enough information to use ppr -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: task | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2036 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D2036 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11755#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11755: Seed unsafeGlobalDynFlags with enough information to use ppr -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: task | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2036 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"4e98b4ff98e127aa9ef4fa1e85bdf0efa41f0902/ghc" 4e98b4f/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="4e98b4ff98e127aa9ef4fa1e85bdf0efa41f0902" DynFlags: Initialize unsafeGlobalDynFlags enough to be useful Previously unsafeGlobalDynFlags would bottom if used prior to initialization. This meant that any attempt to use the pretty-printer early in the initialization process of the compiler would fail. This is quite inconvenient. Here we initialize unsafeGlobalDynFlags with defaultDynFlags, bottoming only if settings is accessed. See #11755. Test Plan: Validate Reviewers: austin Reviewed By: austin Subscribers: thomie, gridaphobe Differential Revision: https://phabricator.haskell.org/D2036 GHC Trac Issues: #11755 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11755#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11755: Seed unsafeGlobalDynFlags with enough information to use ppr -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: task | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2036 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"e8d356773b56c1e56911b6359a368fe2f5d3ed1c/ghc" e8d3567/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="e8d356773b56c1e56911b6359a368fe2f5d3ed1c" Panic: Try outputting SDocs This works in conjunction with D2036 to allow useful debug output before DynFlags has been initializated. See #11755. Reviewers: austin Reviewed By: austin Subscribers: thomie, gridaphobe Differential Revision: https://phabricator.haskell.org/D2037 GHC Trac Issues: #11755 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11755#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11755: Seed unsafeGlobalDynFlags with enough information to use ppr -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: task | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2036 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * failure: None/Unknown => Compile-time crash * resolution: => fixed * milestone: => 8.0.1 Comment: Merged to `ghc-8.0` as well. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11755#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC