Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support GHC 9.2 #28

Closed
Bodigrim opened this issue Dec 11, 2021 · 8 comments
Closed

Support GHC 9.2 #28

Bodigrim opened this issue Dec 11, 2021 · 8 comments

Comments

@Bodigrim
Copy link

$ cabal build -w ghc-9.2
[ 1 of 18] Compiling Data.Primitive.Unlifted.Array.Primops

src/Data/Primitive/Unlifted/Array/Primops.hs:45:25: error:
    Module ‘GHC.Exts’ does not export ‘RuntimeRep(UnliftedRep)’
   |
45 |                 , TYPE, RuntimeRep (UnliftedRep), unsafeCoerce#)

What's worse is that when I fix imports, GHC 9.2 ends up panicking with a message beyond my comprehension.

@Bodigrim
Copy link
Author

As a Hackage Trustee I made two revisions to prohibit unbuildable configurations:
https://hackage.haskell.org/package/primitive-unlifted-0.1.0.0/revisions/
https://hackage.haskell.org/package/primitive-unlifted-0.1.1.0/revisions/

@andrewthad
Copy link
Collaborator

Thanks! Also, the current approach in the 1.x series was designed by @treeowl. I am not sure if it is possible to remedy the compiler panics that it causes in newer GHCs, but he might know. The older approach in the 0.x series still works with newer versions of GHC though.

@treeowl
Copy link
Contributor

treeowl commented Dec 21, 2021

Lovely. barf. Have you made any progress getting this legit in GHC?

@Bodigrim
Copy link
Author

Not really, I was experimenting in /tmp and abandoned it once discovered that fixed imports cause GHC panic.

@wz1000
Copy link

wz1000 commented Jan 5, 2022

@sheaf
Copy link

sheaf commented Jan 9, 2022

I don't think the uses of unsafeCoerce# in the implementation of unlifted MVars are correct, as they coerce between TYPE (BoxedRep Lifted) and TYPE (BoxedRep Unlifted) (causing the issue Zubin linked to above).

In GHC MR !7299 I'm adding support for levity-polymorphic MVar# (and arrays, MutVar# etc). Do you have tests or other programs that rely on unlifted MVar#? I want to avoid releasing a version of GHC with a subtly broken feature.

@chessai
Copy link
Member

chessai commented Jan 10, 2022

fixed in 9b16b79

@chessai chessai closed this as completed Jan 10, 2022
@hasufell
Copy link

Users are seeing this when compiling HLS for GHC 9.2.5.

Building library for primitive-unlifted-1.0.0.0..
[ 1 of 18] Compiling Data.Primitive.Unlifted.Array.Primops ( src/Data/Primitive/Unlifted/Array/Primops.hs, dist/build/Data/Primitive/Unlifted/Array/Primops.o, dist/build/Data/Primitive/Unlifted/Array/Primops.dyn_o )

src/Data/Primitive/Unlifted/Array/Primops.hs:45:25: error:
    Module ‘GHC.Exts’ does not export ‘RuntimeRep(UnliftedRep)’
   |
45 |                 , TYPE, RuntimeRep (UnliftedRep), unsafeCoerce#)
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants