Purescript with ghc 9.2.x

Has anyone succeeded yet with building a recent purescript version with ghc 9.2.x? I’m not looking for “officially supported” … “builds” is enough :wink:

I think this might be possible if you don’t care about using glibc 2.28 and can fix the GHC API issue. See Update codebase to GHC to 9.x series · Issue #4350 · purescript/purescript · GitHub

2 Likes

Can I ask why you want a compiler compiled with GHC 9.2.x, just out of interest?

Sure. I’m using Purescript on OpenBSD for which the ghc project doesn’t provide binary packages, so I don’t have a way to build purescript and spago with any other ghc but the one provided in the OpenBSD ports system.

1 Like

Thanks for the pointer! Applying the patches from that PR worked for me without any further issues on OpenBSD-current

2 Likes

Oh, interesting. For future reference, building the PureScript compiler with an alternative GHC is often quite a bit of effort and PureScript often lags behind the latest GHC; going forward you might find it easier in general to build the version of GHC that PureScript is based on yourself from source instead.

Getting another version of ghc to build properly on OpenBSD isn’t a walk in the park either, but typically using cabal install with —allow-newer worked quite well for me with purescript…

The only problem with --allow-newer is that you’ll be working with a completely untested set of dependencies and you can very easily end up introducing weird bugs that way. We’ve seen this in the past with language-javascript in particular, which is currently deliberately kept back because the latest version has a bug which makes it impossible to use certain PureScript libraries with the JS backend. (Although I suppose this is less of an issue in 0.15 as language-javascript is beginning to be phased out.)

2 Likes

Fully understood … it’s one of the downsides of running a platform that isn’t considered tier-1 for most development environments :slight_smile:

1 Like