Plutonomicon / plutarch-plutus

Typed eDSL for writing UPLC /ˈpluː.tɑːk/
MIT License
123 stars 64 forks source link

CI for GHC 8.10 #145

Closed srid closed 2 years ago

srid commented 2 years ago

Once staging is merged, will Plutarch continue to support GHC 8.10?

I think it should, because not all smart contracts will be moving over to GHC 9.2.

L-as commented 2 years ago

I think yes, and AFAICT the core library should still compile fine, even if the tests don't.

TotallyNotChase commented 2 years ago

So, when using the flake.nix from this PR, and changing ghcVersion to ghc8107 - I seem to be getting compile errors for fourmolu during nix develop-

src/Ormolu/Utils/Extensions.hs:24:1: error:
    Could not find module ‘Distribution.Utils.Path’
    Perhaps you meant
      Distribution.Utils.IOData (from Cabal-3.2.1.0)
      Distribution.Utils.MD5 (from Cabal-3.2.1.0)
      Distribution.Utils.Base62

is it expecting a more up to date cabal version?

L-as commented 2 years ago

That flake which is internal to MLabs is not designed to support GHC 8.10.7. If you don't use the same cabalProjectLocal, etc. it should work absolutely fine with GHC 8.10.7.

TotallyNotChase commented 2 years ago

FWIW I did get that flake and everything to work with 8.10.7 by removing fourmolu.

srid commented 2 years ago

@TotallyNotChase Why not modify Plutarch's flake.nix? Basically https://github.com/Plutonomicon/plutarch/commit/2c4690e4767c5f0490283ff504faf55473dd0e0c Did you notice it requiring more than compiler version change?

TotallyNotChase commented 2 years ago

¯_(ツ)_/¯ I'm just not very good with nix. It works flawlessly on my testbed with ghc8107 after removing fourmolu. I'm sure you could make it work with fourmolu as well by modifying the nix a bit.

srid commented 2 years ago

For the record, it only requires changing compiler version, removing fourmolu/ format checks and adding back HLS.

Diff: https://github.com/Plutonomicon/plutarch/compare/staging...srid/ghc8107

Everything but the examples build:

https://hercules-ci.com/github/Plutonomicon/plutarch/jobs/354

I wonder if all of this can be parameterized so we can do nix develop using either of the compilers.

L-as commented 2 years ago

I think we should at the very least in CI make sure compilation with GHC 8.10.7 works.

L-as commented 2 years ago

I changed the name of the issue.

srid commented 2 years ago

188 adds CI for the library, but we are not running tests.

L-as commented 2 years ago

The tests can't be run. They depend on GHC 9.2.1.

blamario commented 2 years ago

Only a couple of test suites depend on GHC 9, Fields and API I think. We could guard them in examples/Main.hs with #if MIN_VERSION_GLASGOW_HASKELL(9,1).

L-as commented 2 years ago

@blamario Do you know of a way to check for GHC version in plutarch.cabal?

blamario commented 2 years ago

https://cabal.readthedocs.io/en/3.4/cabal-package.html#conditions

if impl(ghc >= 9.0) should do it.

L-as commented 2 years ago

I didn't know you could do that!

srid commented 2 years ago

8.10 generates a slightly different error for pattern match failures, and that broke one golden test:

image
TotallyNotChase commented 2 years ago

I'm starting to think most compilation outputs are rather flaky

srid commented 2 years ago

At least it is flakiness across space (ghc versions) rather than flakiness across time. The latter being non-deterministic is the annoying one.

srid commented 2 years ago

This also happens in 8.10 (but not 9.2):

image

EDIT: seems to be false alarm