<div dir="ltr"><div dir="ltr"><div>Thanks Daniel,</div><div><br></div><div>I think we might be mixing up the two threads here, please let me know if I've misunderstood, so I'll respond as if this was in response to the thread about in-memory buffers: the function you've hightlighted is working as intended (thanks for clarifying the API change, I had to work that out myself and was just guessing) and produces the minimal buffer that is then used by the next function.</div><div><br></div>As to the relation between importsOnly and lookupModule / findModule, they are independent.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 26 Feb 2020 at 23:05, Daniel Gröber <<a href="mailto:dxld@darkboxed.org">dxld@darkboxed.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
looking at `importsOnly`:<br>
<br>
    #if MIN_VERSION_GLASGOW_HASKELL(8,8,1,0)<br>
      pp <- liftIO $ preprocess sess file Nothing Nothing<br>
      let (dflags, tmp) = case pp of<br>
            Left _ -> error $ "preprocessing failed " <> show file<br>
            Right success -> success<br>
    #else<br>
<br>
Since 8.8.1 `preprocess` takes an addition argument of type `Maybe<br>
StringBuffer` that you're setting to `Nothing` here, so the pipeline will<br>
read your on-disk file instead of using the buffer.<br>
<br>
The whole point of that change was to allow passing in-memory buffers<br>
straight into the pipeline for tooling so I'm hoping you can use that to<br>
simplify your workarounds, see<br>
<a href="https://gitlab.haskell.org/ghc/ghc/merge_requests/1014/" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/merge_requests/1014/</a> for context.<br>
<br>
--Daniel<br>
<br>
On Wed, Feb 26, 2020 at 09:58:31PM +0000, Tseen She wrote:<br>
> Hi ghc-devs,<br>
><br>
> When upgrading my dev tool to use the 8.8.x api I have found that calls to<br>
> lookupModule / findModule are failing on uncompilable code, whereas these<br>
> calls succeeded on 8.4 and 8.6.<br>
><br>
> Unlike another question that I have asked [1] which seems related, I don't<br>
> intend to do any typechecking here, I only want access to the ModuleInfo.<br>
><br>
> Has this been an intentional change? Is there a way to recover the original<br>
> behaviour?<br>
><br>
> If I cannot get this to work then it means that a new feature introduced in<br>
> <a href="https://gitlab.haskell.org/ghc/ghc/merge_requests/1541" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/merge_requests/1541</a> that I was quite<br>
> excited about is unusable :-(<br>
><br>
> [1] <a href="https://mail.haskell.org/pipermail/ghc-devs/2020-February/018655.html" rel="noreferrer" target="_blank">https://mail.haskell.org/pipermail/ghc-devs/2020-February/018655.html</a><br>
<br>
> _______________________________________________<br>
> ghc-devs mailing list<br>
> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div></div>