<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
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;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";
mso-fareast-language:EN-GB;}
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.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-fareast-language:EN-US;}
span.EmailStyle24
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:350382314;
mso-list-template-ids:662065696;}
@list l0:level1
{mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level4
{mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level7
{mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l1
{mso-list-id:728382975;
mso-list-template-ids:760495938;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
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]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Thanks Sylvain<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">So we should add a similar fake import into libraries/base/GHC/Exception/Type.hs-boot. I will open a MR.<o:p></o:p></p>
<p class="MsoNormal">Thank you! Don’t forget to comment it – especially because it is fake.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">Make build system doesn't respect package dependencies, only module dependencies (afaik)<o:p></o:p></p>
<p class="MsoNormal">Does Hadrian suffer from this malady too? Are the fake imports needed? Or can we sweep them away when we sweep away make?<o:p></o:p></p>
<p class="MsoNormal">Simon<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin:0cm"><b><span lang="EN-US" style="mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-GB"> ghc-devs <ghc-devs-bounces@haskell.org>
<b>On Behalf Of </b>Sylvain Henry<br>
<b>Sent:</b> 15 March 2021 08:30<br>
<b>To:</b> ghc-devs@haskell.org<br>
<b>Subject:</b> Re: Build failure -- missing dependency? Help!<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi Simon,<span style="mso-fareast-language:EN-GB"><o:p></o:p></span></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)<o:p></o:p></p>
<p>That's why we have several fake imports in `base` that look like:<o:p></o:p></p>
<p>> import GHC.Num.Integer () -- See Note [Depend on GHC.Num.Integer] in GHC.Base<o:p></o:p></p>
<p><span style="font-family:"Courier New"">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`.</span><br>
<br>
So we should add a similar fake import into libraries/base/GHC/Exception/Type.hs-boot. I will open a MR.<o:p></o:p></p>
<p>Sylvain<o:p></o:p></p>
<p><o:p> </o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 14/03/2021 21:53, Simon Peyton Jones via ghc-devs wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">I’m getting this (with ‘sh validate –legacy’). Oddly<o:p></o:p></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo3">It does not happen on HEAD<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo3">It does happen on wip/T19495, a tiny patch with one innocuous change to GHC.Tc.Gen.HsType<o:p></o:p></li></ol>
<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<o:p></o:p></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....<o:p></o:p></p>
<p class="MsoNormal" style="margin:0cm"><span style="mso-fareast-language:EN-GB"><br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>ghc-devs mailing list<o:p></o:p></pre>
<pre><a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><o:p></o:p></pre>
<pre><a href="https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-devs&data=04%7C01%7Csimonpj%40microsoft.com%7Cc275ff3bbab342f7a26508d8e78c9369%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637513938702730130%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=piDkvXfdWip%2FxOKiYwYUb1G%2FvCpliL9dBuV8ltIdE10%3D&reserved=0">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><o:p></o:p></pre>
</blockquote>
</div>
</div>
</body>
</html>