Opened 5 years ago

Closed 7 months ago

Last modified 5 months ago

#3103 closed bug (worksforme)

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 (2)

out (36.6 KB) - added by Lemmih 5 years ago.
Output of 'cabal build -v --ghc-options="-fext-core"'
cabal.out (18.4 KB) - added by nh2 7 months ago.
base-4.7-compiled-with-cabal-1.17

Download all attachments as: .zip

Change History (21)

Changed 5 years ago by Lemmih

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

comment:1 Changed 5 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.

comment:2 Changed 5 years ago by Lemmih

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

comment:3 Changed 5 years ago by Lemmih

  • Cc lemmih@… added

comment:4 Changed 5 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.

comment:5 Changed 4 years ago by igloo

  • Milestone changed from 6.12 branch to 6.12.3

comment:6 Changed 4 years ago by igloo

  • Milestone changed from 6.12.3 to 6.14.1
  • Priority changed from normal to low

comment:7 Changed 4 years ago by simonmar

  • Priority changed from low to normal
  • Type of 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.

comment:8 Changed 4 years ago by elliottt

  • Cc trevor@… added

comment:9 Changed 3 years ago by igloo

  • Milestone changed from 7.0.1 to 7.0.2

comment:10 Changed 3 years ago by igloo

  • Milestone changed from 7.0.2 to 7.2.1

comment:11 Changed 3 years ago by igloo

  • Milestone changed from 7.2.1 to 7.4.1
  • Priority changed from normal to high
  • Test Case set to T3103

Test added in rename/should_compile/T3103.

comment:12 Changed 2 years 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(-)

comment:13 Changed 2 years 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.

comment:14 Changed 19 months ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2

comment:15 Changed 17 months ago by igloo

  • Milestone changed from 7.6.2 to 7.8.1

comment:16 Changed 15 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.

Changed 7 months ago by nh2

base-4.7-compiled-with-cabal-1.17

comment:17 Changed 7 months ago by nh2

I managed to compile base 4.7 with cabal 1.17.

I got

cabal: thread blocked indefinitely in an MVar operation

probably in the preprocessing step, but apart from that, it seems to work (see attached output file).

comment:18 Changed 7 months ago by bgamari

  • Resolution set to worksforme
  • Status changed from new to closed

I was also able to compile base-4.7 with cabal 1.18 but without the MVar warning during preprocessing nor the interface file warning. Closing this for now. Reopen if the daemons resurface.

comment:19 Changed 5 months ago by Joachim Breitner <mail@…>

In 2e161a4753c439d25b67a9a141180657642d7f91/testsuite:

#3103 no longer broken, it seems
Note: See TracTickets for help on using tickets.