<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <p>Hi Simon,</p>
    <p>The issue is that:<br>
      1. Make build system doesn't respect package dependencies, only
      module dependencies (afaik)<br>
      2. The build system isn't aware that most modules implicitly
      depend on GHC.Num.Integer/Natural (to desugar Integer/Natural
      literals)</p>
    <p>That's why we have several fake imports in `base` that look like:</p>
    <p>> import GHC.Num.Integer () -- See Note [Depend on
      GHC.Num.Integer] in GHC.Base</p>
    <p><font face="monospace">Note [Depend on GHC.Num.Integer]<br>
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
        <br>
        The Integer type is special because GHC.Iface.Tidy uses
        constructors in<br>
        GHC.Num.Integer to construct Integer literal values. Currently
        it reads the<br>
        interface file whether or not the current module *has* any
        Integer literals, so<br>
        it's important that GHC.Num.Integer is compiled before any other
        module.<br>
        <br>
        (There's a hack in GHC to disable this for packages ghc-prim and
        ghc-bignum<br>
        which aren't allowed to contain any Integer literals.)<br>
        <br>
        Likewise we implicitly need Integer when deriving things like Eq
        instances.<br>
        <br>
        The danger is that if the build system doesn't know about the
        dependency<br>
        on Integer, it'll compile some base module before
        GHC.Num.Integer,<br>
        resulting in:<br>
          Failed to load interface for ‘GHC.Num.Integer’<br>
            There are files missing in the ‘ghc-bignum’ package,<br>
        <br>
        Bottom line: we make GHC.Base depend on GHC.Num.Integer; and
        everything<br>
        else either depends on GHC.Base, or does not have
        NoImplicitPrelude<br>
        (and hence depends on Prelude).<br>
        <br>
        Note: this is only a problem with the make-based build system.
        Hadrian doesn't<br>
        seem to interleave compilation of modules from separate packages
        and respects<br>
        the dependency between `base` and `ghc-bignum`.</font><br>
      <br>
      So we should add a similar fake import into
      libraries/base/GHC/Exception/Type.hs-boot. I will open a MR.<br>
    </p>
    <p>Sylvain<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 14/03/2021 21:53, Simon Peyton Jones
      via ghc-devs wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:AM0PR83MB027676B5200CE41287DF9C60AD6D9@AM0PR83MB0276.EURPRD83.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-top:6.0pt;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:6.0pt;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:36.0pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}p.Code, li.Code, div.Code
        {mso-style-name:Code;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:22.7pt;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-language:EN-US;
        font-weight:bold;}span.EmailStyle18
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}.MsoPapDefault
        {mso-style-type:export-only;
        margin-top:6.0pt;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:0cm;}div.WordSection1
        {page:WordSection1;}ol
        {margin-bottom:0cm;}ul
        {margin-bottom:0cm;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">I’m getting this (with ‘sh validate
          –legacy’).  Oddly<o:p></o:p></p>
        <ul style="margin-top:0cm" type="disc">
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo1">It does not
            happen on HEAD<o:p></o:p></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo1">It does
            happen on wip/T19495, a tiny patch with one innocuous change
            to GHC.Tc.Gen.HsType<o:p></o:p></li>
        </ul>
        <p class="MsoNormal">I can’t see how my patch could possible
          cause “missing files” in ghc-bignum!<o:p></o:p></p>
        <p class="MsoNormal">I’m guessing that there is a missing
          dependency that someone doesn’t show up in master, but does in
          my branch, randomly.<o:p></o:p></p>
        <p class="MsoNormal">There’s something funny about ghc-bignum;
          it doesn’t seem to be a regular library<span lang="EN-US"><o:p></o:p></span></p>
        <p class="MsoNormal">Can anyone help?<o:p></o:p></p>
        <p class="MsoNormal">Thanks<o:p></o:p></p>
        <p class="MsoNormal">Simon<o:p></o:p></p>
        <p class="Code">"inplace/bin/ghc-stage1" -hisuf hi -osuf  o
          -hcsuf hc -static  -O -H64m -Wall
          -fllvm-fill-undef-with-garbage    -Werror    -this-unit-id
          base-4.16.0.0 -hide-all-packages -package-env - -i
          -ilibraries/base/. -ilibraries/base/dist-install/build
          -Ilibraries/base/dist-install/build
          -ilibraries/base/dist-install/build/./autogen
          -Ilibraries/base/dist-install/build/./autogen
          -Ilibraries/base/include
          -Ilibraries/base/dist-install/build/include    -optP-include
          -optPlibraries/base/dist-install/build/./autogen/cabal_macros.h
          -package-id ghc-bignum-1.0 -package-id ghc-prim-0.8.0
          -package-id rts -this-unit-id base -Wcompat
          -Wnoncanonical-monad-instances -XHaskell2010 -O -dcore-lint
          -ticky -Wwarn  -no-user-package-db -rtsopts 
          -Wno-trustworthy-safe -Wno-deprecated-flags    
          -Wnoncanonical-monad-instances  -outputdir
          libraries/base/dist-install/build  -dynamic-too -c
          libraries/base/./GHC/Exception/Type.hs-boot -o
          libraries/base/dist-install/build/GHC/Exception/Type.o-boot
          -dyno
          libraries/base/dist-install/build/GHC/Exception/Type.dyn_o-boot<o:p></o:p></p>
        <p class="Code">Failed to load interface for ‘GHC.Num.Integer’<o:p></o:p></p>
        <p class="Code">There are files missing in the ‘ghc-bignum’
          package,<o:p></o:p></p>
        <p class="Code">try running 'ghc-pkg check'.<o:p></o:p></p>
        <p class="Code">Use -v (or `:set -v` in ghci) to see a list of
          the files searched for.<o:p></o:p></p>
        <p class="Code">make[1]: *** [libraries/base/ghc.mk:4:
          libraries/base/dist-install/build/GHC/Exception/Type.o-boot]
          Error 1<o:p></o:p></p>
        <p class="Code">make[1]: *** Waiting for unfinished jobs....<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
ghc-devs mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a>
</pre>
    </blockquote>
  </body>
</html>