Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Cannot build basement with GHC 9.0: unsafeCoerce# no longer exported by GHC.Prim in base 4.15+ #548

Closed
Tracked by #17 ...
LaurentRDC opened this issue Feb 5, 2021 · 7 comments

Comments

@LaurentRDC
Copy link

Hello,

I wanted to bring to your attention that I could not build my package pandoc-plot with GHC 9.0.1 because in basement-0.0.11, unsafeCoerce# is imported from GHC.Prim:

...
basement                         > [16 of 84] Compiling Basement.Floating
basement                         > [17 of 84] Compiling Basement.Monad
basement                         > 
basement                         > /tmp/stack-68bc6b9780c2c4d5/basement-0.0.11/Basement/Monad.hs:98:31: error:
basement                         >     Variable not in scope:
basement                         >       unsafeCoerce#
...

From the migrating guide:

The unsafeCoerce# function has been moved from GHC.Prim to Unsafe.Coerce. As a result, attempting to import unsafeCoerce# from GHC.Prim (or GHC.Base, which previously re-exported unsafeCoerce#) will result in an error with GHC 9.0. A backwards-compatible way to fix the error is to import unsafeCoerce# from GHC.Exts instead.

@sjakobi
Copy link

sjakobi commented Feb 22, 2021

Ping @vincenthz. This is blocking support for GHC 9.0 in a lot of projects.

@sjakobi
Copy link

sjakobi commented Mar 3, 2021

Ping @vincenthz! :)

@sjakobi
Copy link

sjakobi commented Mar 12, 2021

Ping @vincenthz! :) Is there anything particular that keeps you from addressing this?

@sjakobi
Copy link

sjakobi commented Mar 12, 2021

FYI: As a Hackage trustee, I have created a Hackage revision that prevents basement-0.0.11 from building with GHC 9.0.1: http://hackage.haskell.org/package/basement-0.0.11/revisions/

@ghost
Copy link

ghost commented Apr 5, 2021

I have found that hoogle also can't be build with currently released basement-0.0.11 under ghc-9.0.1.
I have checked - basement from master seems to be compiling fine with ghc-9.0.1.
It looks like latest commit from 7 hours ago has helped 3c19590
I have created local package for basement from master and was able to move forward in compiling hoogle.
Then I have found compilation issue in foundation with 9.0.1

I have application of changes from #540 I was able to compile foundation under ghc-9.0.1
It seems that the only thing missing in support for 9.0.1 for basement/foundation:

  1. merging Eta convert a lambda to fix GHC 9 type error #540
  2. releasing new versions of basement and foundation

@LaurentRDC
Copy link
Author

This issue should be fixed by commit 3c19590

@andreasabel
Copy link

Blocking ocharles/weeder#65.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants