Ticket #3103 (new bug)

Opened 4 years ago

Last modified 4 months ago

Compiling base with cabal fails.

Reported by: Lemmih Owned by:
Priority: high Milestone: 7.8.1
Component: Compiler Version: 6.10.1
Keywords: Cc: lemmih@…, trevor@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: T3103 Blocked By:
Blocking: Related Tickets:

Description

Compiling base with -fext-core fails with ghc-6.10.1 and ghc-6.10.1rc.

Reproduce with: cd libraries/base/ && cabal build -v --ghc-options="-fext-core"

I've attached the output from my machine.

Attachments

out Download (36.6 KB) - added by Lemmih 4 years ago.
Output of 'cabal build -v --ghc-options="-fext-core"'

Change History

Changed 4 years ago by Lemmih

  • attachment out Download added

Output of 'cabal build -v --ghc-options="-fext-core"'

Changed 4 years ago by Lemmih

  • summary changed from Compiling base with -fext-core. to Compiling base.

Turns out the same thing happens without the -fext-core flag.

Changed 4 years ago by Lemmih

  • summary changed from Compiling base. to Compiling base with cabal fails.

Changed 4 years ago by Lemmih

  • cc lemmih@… added

Changed 4 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.12 branch

This is also reproducible with

make rebuild.library.base

in libraries/ in a GHC build tree. (note: rebuild, rather than the normal remake. It uses Cabal to build, and thus ultimately ends up using ghc --make).

This did work at one point, but I don't know how long ago it broke.

Changed 3 years ago by igloo

  • milestone changed from 6.12 branch to 6.12.3

Changed 3 years ago by igloo

  • priority changed from normal to low
  • milestone changed from 6.12.3 to 6.14.1

Changed 3 years ago by simonmar

  • priority changed from low to normal
  • failure set to None/Unknown

Still happens with HEAD today:

[ 66 of 170] Compiling Foreign.Ptr      ( Foreign/Ptr.hs, dist/build/Foreign/Ptr.o )
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 6.13.20100902 for x86_64-unknown-linux):
        tcIfaceGlobal (local): not found:
    base:GHC.Word.W#{d 6w}
    [(32R, Type constructor `base:GHC.Word.Word{tc 32R}'),
     (32U, Type constructor `base:GHC.Word.Word8{tc 32U}'),
     (32X, Type constructor `base:GHC.Word.Word16{tc 32X}'),
     (333, Type constructor `base:GHC.Word.Word32{tc 333}'),
     (339, Type constructor `base:GHC.Word.Word64{tc 339}'),
...

additionally, it's not possible to build base outside a GHC tree, because:

Preprocessing library base-4.3.0.0...
Building base-4.3.0.0...

GHC/Constants.hs:7:0:
     error: ../../../compiler/stage1/ghc_boot_platform.h: No such file or directory

GHC/Constants.hs:9:0:
     error: ../../../includes/HaskellConstants.hs: No such file or directory

It would be nice if it was possible to build base independently of GHC, for people trying to process base with the GHC API for exmple.

Changed 3 years ago by elliottt

  • cc trevor@… added

Changed 2 years ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

Changed 2 years ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

Changed 21 months ago by igloo

  • priority changed from normal to high
  • testcase set to T3103
  • milestone changed from 7.2.1 to 7.4.1

Test added in rename/should_compile/T3103.

Changed 18 months ago by marlowsd@…

commit f85c084c0d6e8f7ac8b282220eb93c69e356b5e1

Author: Simon Marlow <marlowsd@gmail.com>
Date:   Wed Nov 30 11:32:23 2011 +0000

    Include a stack trace in the panic message, when GHC is compiled profiled.
    
    I tried this out on the panic we're currently getting for #3103:
    
    ghc-stage2: panic! (the 'impossible' happened)
      (GHC version 7.3.20111128 for x86_64-unknown-linux):
            tcIfaceGlobal (local): not found:
        base:GHC.Word.W#{d 6w}
        [(32R, Type constructor `base:GHC.Word.Word{tc 32R}'),
         (r6O, Identifier `base:GHC.Word.$fNumWord{v r6O}'),
         (r6P, Identifier `base:GHC.Word.$fEqWord{v r6P}'),
         (r6Q, Identifier `base:GHC.Word.$fNumWord1{v r6Q}'),
         (r6R, Identifier `base:GHC.Word.$fNumWord2{v r6R}'),
         (r6S, Data constructor `base:GHC.Word.W#{d r6S}'),
         (r6U, Identifier `base:GHC.Word.W#{v r6U}'),
         (r75, Identifier `base:GHC.Word.$fNumWord_$csignum{v r75}'),
         (r76, Identifier `base:GHC.Word.$fEqWord_$c/={v r76}'),
         (r77, Identifier `base:GHC.Word.$fEqWord_$c=={v r77}')]
    { Main.main
       GHC.defaultErrorHandler
        GHC.runGhc
         GhcMonad.>>=
          GhcMonad.>>=.\
           Main.main'
            Main.doMake
             GhcMake.load
              GhcMake.load2
               GhcMake.upsweep
                GhcMake.upsweep.upsweep'
                 GhcMake.reTypecheckLoop
                  GhcMake.typecheckLoop
                   GhcMake.typecheckLoop.\
                    TcRnMonad.initIfaceCheck
                     TcRnMonad.initTcRnIf
                      IOEnv.runIOEnv
                       IOEnv.thenM
                        IOEnv.thenM.\
                         TcIface.typecheckIface
                          TcIface.typecheckIface.\
                           LoadIface.loadDecls
                            LoadIface.loadDecl
                             TcIface.tcIfaceDecl
                              TcIface.tc_iface_decl
                               TcIface.tcIdInfo
                                MonadUtils.foldlM
                                 TcIface.tcIdInfo.tcPrag
                                  TcIface.tcUnfolding
                                   TcIface.tcPragExpr
                                    TcIface.tcIfaceExpr
                                     TcIface.tcIfaceAlt
                                      TcIface.tcIfaceDataCon }

 compiler/utils/Panic.lhs |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

Changed 17 months ago by simonpj

  • milestone changed from 7.4.1 to 7.6.1

This is a bug, but it's to do with wired-in things in the base package, and the base package is usually built with the GHC build system. So we'll punt this for now.

Changed 8 months ago by igloo

  • milestone changed from 7.6.1 to 7.6.2

Changed 6 months ago by igloo

  • milestone changed from 7.6.2 to 7.8.1

Changed 4 months ago by monoidal

Not sure if this matters, but when I do "cabal build" with HEAD only a warning is given instead of a panic:

[ 69 of 196] Compiling Foreign.Ptr      ( Foreign/Ptr.hs, dist/build/Foreign/Ptr.o )
The interface for `base:GHC.Num'
Declaration for $fNumWord_$csignum
Unfolding of GHC.Num.$fNumWord_$csignum:
  Can't find interface-file declaration for data constructor GHC.Types.W#
    Probable cause: bug in .hi-boot file, or inconsistent .hi file
    Use -ddump-if-trace to get an idea of which file caused the error

and the compilation succeeds. The warning is suspect, though.

Note: See TracTickets for help on using tickets.