8.8.x change in lookupModule / findModule semantics?
Daniel Gröber
dxld at darkboxed.org
Wed Feb 26 23:04:14 UTC 2020
Hi,
looking at `importsOnly`:
#if MIN_VERSION_GLASGOW_HASKELL(8,8,1,0)
pp <- liftIO $ preprocess sess file Nothing Nothing
let (dflags, tmp) = case pp of
Left _ -> error $ "preprocessing failed " <> show file
Right success -> success
#else
Since 8.8.1 `preprocess` takes an addition argument of type `Maybe
StringBuffer` that you're setting to `Nothing` here, so the pipeline will
read your on-disk file instead of using the buffer.
The whole point of that change was to allow passing in-memory buffers
straight into the pipeline for tooling so I'm hoping you can use that to
simplify your workarounds, see
https://gitlab.haskell.org/ghc/ghc/merge_requests/1014/ for context.
--Daniel
On Wed, Feb 26, 2020 at 09:58:31PM +0000, Tseen She wrote:
> Hi ghc-devs,
>
> When upgrading my dev tool to use the 8.8.x api I have found that calls to
> lookupModule / findModule are failing on uncompilable code, whereas these
> calls succeeded on 8.4 and 8.6.
>
> Unlike another question that I have asked [1] which seems related, I don't
> intend to do any typechecking here, I only want access to the ModuleInfo.
>
> Has this been an intentional change? Is there a way to recover the original
> behaviour?
>
> If I cannot get this to work then it means that a new feature introduced in
> https://gitlab.haskell.org/ghc/ghc/merge_requests/1541 that I was quite
> excited about is unusable :-(
>
> [1] https://mail.haskell.org/pipermail/ghc-devs/2020-February/018655.html
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20200227/e3ef0b5f/attachment.sig>
More information about the ghc-devs
mailing list