plutus icon indicating copy to clipboard operation
plutus copied to clipboard

Add PyF>=0.11 constraint to cabal

Open zeme-iohk opened this issue 1 year ago • 5 comments

PyF < 0.11 is broken on ghc >= 9.2

zeme-iohk avatar Sep 20 '22 13:09 zeme-iohk

You saw the link to the 1PyF issue, right? https://github.com/guibou/PyF/issues/111

I didn't try to minimize it, but that might be a good next step.

michaelpj avatar Sep 20 '22 13:09 michaelpj

I was unable to replicate the bug, so I hoped that adding the 0.11 constraint Would Just Work :( What did you test it on? Which ghc/PyF versions? cabal repl or ghci? I'm testing on ghc8107 and PyF 0.11.0.0 with cabal repl and it works fine... yet the nix build fails.

zeme-iohk avatar Sep 20 '22 16:09 zeme-iohk

I could replicate it with cabal build in the nix-shell, I think? I'll check.

michaelpj avatar Sep 20 '22 16:09 michaelpj

Yep, can reproduce.

michaelpj avatar Sep 21 '22 10:09 michaelpj

cabal build plutus-tx-plugin

michaelpj avatar Sep 21 '22 10:09 michaelpj

@zliu41 I've been informed you were the proponent of PyF. PyF does have a more powerful and slimmer API, but again this is blocking the ghc9.2 migration. Are you happy replacing it with string-interpolate?

zeme-iohk avatar Sep 23 '22 14:09 zeme-iohk

Hello, PyF author here.

I'm sorry to learn about your problem and I would like to find a solution suitable for your needs.

  • I can fix PyF <= 0.10 for ghc 9.2 (and 9.4), it should be easy.
  • I can also, as proposed in https://github.com/guibou/PyF/issues/115, avoid the unsafeRunTcm trick, or at least set a flag to disable it. Actually, I'm using this "trick" in two contexts, one for error reporting with correct location, and one to detect if a variable is in scope, which was the problem observed in https://github.com/guibou/PyF/issues/111.

Do you have a reproduction of the issue which may help me try and see what solution would be the best?

guibou avatar Sep 24 '22 10:09 guibou

Hey @guibou thank you for reaching out.

Fixing PyF 0.10 for ghc >=9.2 would be great!

We can reproduce the error only when using PyF 0.11 as a build dependency using the patched GHC coming from haskell-nix on linux (macSO works fine it seems).

To reproduce you could enter the nix-shell (any revision behind the current master, which now uses string-interpolate) after setting PyF to ==0.11.0.0 in the cabal files, and running e.g. cabal build plutus-tx-plugin.

But that is not at all a minimal reproducible example...

zeme-iohk avatar Sep 24 '22 10:09 zeme-iohk

~~Would you mind testing https://github.com/guibou/PyF/pull/117 which move the "dangerous" function under the cabal flag -unsafe_error_reporting.~~

~~You may want to use PyF with this flag set to True when developing locally (i.e. no cross compilation, better error reporting) and set the flag to False in your CI.~~

guibou avatar Sep 24 '22 11:09 guibou

But that is not at all a minimal reproducible example...

That's minimal enough, I'll try that, thank you ;)

guibou avatar Sep 24 '22 11:09 guibou

https://hackage.haskell.org/package/PyF-0.11.1.0/changelog fixs the build in your codebase.

guibou avatar Sep 24 '22 17:09 guibou

@bezirg this is getting reverted

michaelpj avatar Sep 26 '22 13:09 michaelpj