plutus icon indicating copy to clipboard operation
plutus copied to clipboard

Plutus Compilation Bug

Open jonathanfishbein1 opened this issue 1 year ago • 4 comments

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

plutus compilation bug repo

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

haskell dependencies

jonathanfishbein1 avatar Dec 25 '23 19:12 jonathanfishbein1

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 #-}

jonathanfishbein1 avatar Dec 26 '23 18:12 jonathanfishbein1

Does it not give you a type error?

michaelpj avatar Jan 02 '24 10:01 michaelpj

I tried cabal build all (after removing no-typecheck) and it succeeded. Please tell us more about how to reproduce it.

zliu41 avatar Jan 13 '24 15:01 zliu41

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

effectfully avatar Jan 15 '24 19:01 effectfully

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.

effectfully avatar Mar 13 '24 01:03 effectfully