plutus
plutus copied to clipboard
Plutus Compilation Bug
Summary
Plutus is failing to compile
Error: cabal: Failed to build. The build process terminated with exit code -4
however with the following ghc pragma it will compile
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-typecheck #-}
however, with this pragma set the serialized output of a script is very strange and is not CBOR as far as I can tell
Steps to reproduce the behavior
Here is a repo that will reproduce the bug
Actual Result
without the ghc pragma compilation will fail. With it the serialized plutus script ouput won't be CBOR
Expected Result
a CBOR encoded compiled plutus script
Describe the approach you would take to fix this
No response
System info
NixOS
I've manged to export CBOR by using functions within the Data.ByteString module instead of using Prelude.show so that problem is fixed. It's still failing to compile though without the ghc pragma set to
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-typecheck #-}
Does it not give you a type error?
I tried cabal build all (after removing no-typecheck) and it succeeded. Please tell us more about how to reproduce it.
I can't even nix develop into that repo without trusting some public keys that I know nothing about:
$ nix develop
warning: Git tree '/home/effectfully/code/iohk/plutus-compilation-bug' is dirty
do you want to allow configuration setting 'extra-substituters' to be set to 'https://horizon.cachix.org' (y/N)? N
do you want to permanently mark this value as untrusted (y/N)? N
warning: ignoring untrusted flake configuration setting 'extra-substituters'.
Pass '--accept-flake-config' to trust it
do you want to allow configuration setting 'extra-trusted-public-keys' to be set to 'horizon.cachix.org-1:MeEEDRhRZTgv/FFGCv3479/dmJDfJ82G6kfUDxMSAw0=' (y/N)? N
do you want to permanently mark this value as untrusted (y/N)? N
warning: ignoring untrusted flake configuration setting 'extra-trusted-public-keys'.
Pass '--accept-flake-config' to trust it
It's been three months and we can't reproduce the problem, so I'm closing the issue.
If anybody has any additional input, it'd be great if you could share it and do feel free to reopen the issue any time.