<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Tamar,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I think the difficulty here is more with dynamic *outputs* rather than dynamic inputs/dependencies. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We do not statically know which of the following three alternatives holds:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<ul>
<li>`*.dyn_o/hi` files are not built at all.</li><li>`*.dyn_o/hi` files are built via a separate execution of GHC.</li><li>`*.dyn_o/hi` files are built together with `*.o/hi` files, in a single <span style="font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important">
execution of </span>GHC with `-dynamic-too`.</li></ul>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Here is the current implementation: </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a href="https://gitlab.haskell.org/ghc/ghc/blob/master/hadrian/src/Rules/Compile.hs#L51-69">https://gitlab.haskell.org/ghc/ghc/blob/master/hadrian/src/Rules/Compile.hs#L51-69</a><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I believe the last person looking into this was James Foster, so CC-ing to him in case he has any insights.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Cheers,</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Andrey</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Phyx <lonetiger@gmail.com><br>
<b>Sent:</b> 10 December 2019 07:47<br>
<b>To:</b> Andrey Mokhov <andrey.mokhov@newcastle.ac.uk><br>
<b>Cc:</b> Simon Peyton-Jones (simonpj@microsoft.com) <simonpj@microsoft.com>; Ben Gamari <ben@well-typed.com>; ghc-devs@haskell.org <ghc-devs@haskell.org><br>
<b>Subject:</b> Re: More failure</font>
<div> </div>
</div>
<div>
<div dir="auto">
<div dir="auto">Hi Andrey, </div>
<div dir="auto"><br>
</div>
<div dir="auto">I'm not sure what the original issue here is (should probably find the original message) but</div>
<div dir="auto">
<div dir="auto"><br>
</div>
<div dir="auto">> <span style="font-family:sans-serif; font-size:12.8px">The Make build system happens to do the right thing, somehow. I believe we should be able to express the same logic in Shake, but it's not easy.</span></div>
<div dir="auto"><font face="sans-serif"><span style="font-size:12.8px"><br>
</span></font></div>
<div dir="auto"><font face="sans-serif"><span style="font-size:12.8px">I believe this typically works because GCC and GHC support dumping the dependencies that a command would have caused to a file. So your dynamic dependencies don't matter as their static
to the build system after this invocation. </span></font></div>
<div dir="auto"><font face="sans-serif"><span style="font-size:12.8px"><br>
</span></font></div>
<div dir="auto"><font face="sans-serif"><span style="font-size:12.8px">See <br>
</span></font><a href="https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/separate_compilation.html#dependency-generation">https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/separate_compilation.html#dependency-generation</a></div>
<div dir="auto"><br>
</div>
<div dir="auto">These Compilers are able to dump out make rules which enabled better dependency handling.. </div>
<div dir="auto"><br>
</div>
<div dir="auto">Kind regards, </div>
<div dir="auto">Tamar </div>
<div dir="auto"><br>
<div dir="auto">Sent from my Mobile</div>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, Dec 10, 2019, 00:58 Andrey Mokhov <<a href="mailto:andrey.mokhov@newcastle.ac.uk" target="_blank" rel="noreferrer">andrey.mokhov@newcastle.ac.uk</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div lang="EN-GB">
<div>
<p class="x_MsoNormal">Hi Simon,<u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal">(Re-sending from the email address that’s allowed on the mailing list.)<u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal">> Ugh. That's not a very happy state of affairs, is it? It didn't happen with 'make'.
<u></u><u></u></p>
<p class="x_MsoNormal">> Is it a fundamental problem, or just not yet fixed?<u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal">I think this is not a fundamental problem, but the problem of getting dependencies right.<u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal">In this case, the complexity comes from the fact that a single invocation of GHC produces a set of files, and which set depends on the command line flags, which are in turn determined dynamically by reading environment settings (specifically,
`platformSupportsSharedLibs`). <u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal">Such rules are hard to describe precisely, because build systems are tuned to the typical case where we statically know, for every output file, which rule produces it -- recall the Tasks = k -> Maybe Task function from our paper. In this
case, we deal with something like k -> f (Maybe Task) instead, i.e. with `f` around the Maybe.<u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal">The Make build system happens to do the right thing, somehow. I believe we should be able to express the same logic in Shake, but it's not easy.<u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal">(I never really had a chance to look at dynamic builds, since they are not supported on Windows. I guess I should finally find a Linux box for Hadrian.)<u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal">Cheers,<u></u><u></u></p>
<p class="x_MsoNormal">Andrey<u></u><u></u></p>
</div>
</div>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" rel="noreferrer noreferrer" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>