<html 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=utf-8"><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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> >       </p><p class=MsoNormal>> > 2) The other problem is that the paths specified have to be relative to the application.</p><p class=MsoNormal>> >    (Of the top of my head) It doesn't support absolute paths. Which</p><p class=MsoNormal>> >    means I can't have GHC generate the entry because I have no idea</p><p class=MsoNormal>> >    where the testsuite intends to run the binary.</p><p class=MsoNormal>> >    One way around this is to have the testsuite generate the needed config file. That should be do-able.</p><p class=MsoNormal>> >    </p><p class=MsoNormal>> > I'll investigate this method first. I had discarded it for some reason before but now can't remember...</p><p class=MsoNormal>> ></p><p class=MsoNormal>> Right, it sounds like this is a workable option and the fact that it</p><p class=MsoNormal>> requires adding no further complexity to the compiler is quite a merit.</p><p class=MsoNormal>> The only question is what other use-cases might run into this same issue.</p><p class=MsoNormal>> For instance, what happens when I run `cabal build` and try to run an</p><p class=MsoNormal>> executable from `dist/build`. Then I run `cabal install` and run it from</p><p class=MsoNormal>> `.cabal/bin`. Surely Cabal will need to take some sort of action in this</p><p class=MsoNormal>> case. I suppose this means that using plain `ghc -dynamic` alone is</p><p class=MsoNormal>> probably out of the question.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>No, this would only be the case for development versions of GHC. For the end user, the GHC core libraries</p><p class=MsoNormal>*should* be registered in the SxS cache (much like the Microsoft, Intel, etc compilers do). This is part of</p><p class=MsoNormal>the distribution story we still have to have a chat about.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For user libraries, it wouldn't matter since the application would check the SxS Cache and it would always work.</p><p class=MsoNormal>Also the SxS assembly creation is opt-in. So if you rely on a dll, even one created by GHC (and not a core library) then by default it won't be an SxS assembly (as is currently the case.).</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This does however mean, that if you just use the tarball, you can't run programs created with -dynamic.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In the implementation I also have an override `-fno-gen-sxs-assembly` which will create a binary which will not try to use SxS at all to find it's depencencies. In this case you'd have to have the proper PATH entries.</p><p class=MsoNormal>So by adjusting your PATH you can still get the development/in-place ghc to run from abritrary locations. Since this method can't be used to satisfy the loader than that the right runtime was already loaded it does mean that Stack won't be able to support -dynamic out of the box. However they can probably get it to work using the same methods the testsuite uses.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The testsuite always compiles applications using this override, and then corrects the PATH entries before running. This is why a large part of the tests still run fine.</p></div></body></html>