IntersectMBO / plutus

The Plutus language implementation and tools
Apache License 2.0
1.56k stars 479 forks source link

I am not able to run repl agains plutus-helloworld executable from Alonzo-testnet plutus-sources #3659

Closed ssledz closed 3 years ago

ssledz commented 3 years ago

Area

[] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code [] Plutus Application Framework Related to the Plutus application backend (PAB), emulator, Plutus libraries [] Marlowe Related to Marlowe [x] Other Any other topic (Playgrounds, etc.)

Summary

I am not able to run repl agains plutus-helloworld executable

I am getting following error

GHC Core to PLC plugin: E049:Error: Found invalid marker, not applied correctly in expression plc

But I can build the app using following commnad

cabal build exe:plutus-helloworld -w ghc-8.10.4

Steps to reproduce

fetch sources

git clone https://github.com/input-output-hk/Alonzo-testnet/
cd Alonzo-testnet/resources/plutus-sources/plutus-helloworld

run repl

cabal repl plutus-helloworld -w ghc-8.10.4 

output:

Build profile: -w ghc-8.10.4 -O1
In order, the following will be built (use -v for more details):
 - plutus-helloworld-1.27.0 (lib) (first run)
Preprocessing library for plutus-helloworld-1.27.0..
GHCi, version 8.10.4: https://www.haskell.org/ghc/  :? for help

<interactive>:1:8: error: Variable not in scope: return

<interactive>:1:15: error:
    Variable not in scope: ($) :: t2 -> t3 -> t1

<interactive>:1:43: error:
    Variable not in scope: (++) :: t1 -> GHC.Base.String -> t0

<interactive>:1:48: error:
    Variable not in scope:
      (++) :: t0 -> t4 -> ghc-prim-0.6.1:GHC.Types.IO GHC.Base.String
Loaded GHCi configuration from /home/ssledz/.ghc/ghci.conf

<no location info>: warning: [-Wunused-packages]
    The following packages were specified via -package or -package-id flags,
    but were not needed for compilation:
      - serialise-0.2.3.0
      - plutus-tx-plugin-0.1.0.0
      - plutus-tx-0.1.0.0
      - plutus-ledger-api-0.1.0.0
      - plutus-ledger-0.1.0.0
      - cardano-api-1.27.0
      - bytestring-0.10.12.0
[1 of 2] Compiling Cardano.PlutusExample.HelloWorld ( src/Cardano/PlutusExample/HelloWorld.hs, interpreted )

src/Cardano/PlutusExample/HelloWorld.hs:48:18: warning: [-Wunused-matches]
    Defined but not used: ‘redeemer’
   |
48 | helloWorld datum redeemer context = if datum P.== hello then () else (P.error ())
   |                  ^^^^^^^^

src/Cardano/PlutusExample/HelloWorld.hs:48:27: warning: [-Wunused-matches]
    Defined but not used: ‘context’
   |
48 | helloWorld datum redeemer context = if datum P.== hello then () else (P.error ())
   |                           ^^^^^^^
GHC Core to PLC plugin: E049:Error: Found invalid marker, not applied correctly in expression plc

Expected behavior

I should be able to run repl

System info (please complete the following information):

lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal
uname -a
Linux ssledz-desktop 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Screenshots and attachments

N/A

Additional context

N/A

ghost commented 3 years ago

Please try to add

  ghc-options: -fobject-code -fno-ignore-interface-pragmas -fno-omit-interface-pragmas

to plutus-helloworld.cabal or checkout the branch from the aforementioned PR. Or wait until it lands the master.

ssledz commented 3 years ago

thanks it works