[GHC] #15286: "Can't use Natural in base" when compiling GHC.Natural with -O0

GHC ghc-devs at haskell.org
Thu Feb 7 10:42:12 UTC 2019


#15286: "Can't use Natural in base" when compiling GHC.Natural with -O0
-------------------------------------+-------------------------------------
        Reporter:  alpmestan         |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  libraries/base    |              Version:  8.5
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Building GHC      |  Unknown/Multiple
  failed                             |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4880
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rockbmb):

 As part of ticket #15622 that I opened, I ran into this issue when I
 introduced an import to `GHC.TypeNats` in `libraries/base/Data/Fixed.hs`,
 having used it to replace an import to `GHC.TypeLits`.

 I also added two extensions, `{-# LANGUAGE DataKinds #-}` and `{-#
 LANGUAGE KindSignatures #-}`, which may be part of the problem. The
 associated commit is
 [here](https://gitlab.haskell.org/rockbmb/ghc/commit/c6726d732273785b53986f152a6e03fc0784c0f3),
 and the failure I got in CI was:

 ```
   HC [stage 1] libraries/base/dist-install/build/Data/Fixed.o
   HC [stage 1] libraries/base/dist-install/build/Data/Complex.o
 ghc-stage1: panic! (the 'impossible' happened)
   (GHC version 8.7.20190206 for x86_64-unknown-linux):
         Can't use Natural in base

 Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

 make[1]: *** [libraries/base/dist-install/build/Data/Fixed.o] Error 1
 make[1]: *** Waiting for unfinished jobs....
 libraries/base/ghc.mk:4: recipe for target 'libraries/base/dist-
 install/build/Data/Fixed.o' failed
 make: *** [all] Error 2
 Makefile:123: recipe for target 'all' failed
 ```.

 I included the error here because CI build logs in GitLab disappear after
 1 week.

 I hope this helps, and if there's anything I can do to help close this
 issue I'll be happy to help.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15286#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list