Closed segersb closed 3 years ago
It seems running cabal build
from /workspaces/plutus-starter
is key in order to reproduce the reported issue. When I first ran this up to cabal update
and let Dev Container load the file(it took some time) it got haskell-language-server working properly. I'm waiting on cabal build
to finish to see if it changes anything else
cabal build
finishing didn't change much with respect to the plugin error. I tried to repro my original behavior with a clean environment as the first run I did, but no luck. Taking a closer look
I tried doing a 'cabal clean' + running the VSCode command 'Haskell: Restart Haskell LSP server', but I still got the error.
I'm having the same issue
Same issue over here
Fixes have now landed on plutus-starter https://github.com/input-output-hk/plutus-starter/pull/29. Just ensure the flag defer-plugin-errors is enabled. Please reopen if you're still experiencing any problems
Thanks @silky for putting a new release of the container and bumping
Area
[X] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code [X] 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'm having troubles setting up VSCode to have code completion while developing with Plutus. The cleanest solution I have tried was to use a fresh Ubuntu VM in VirtualBox and start from the "plutus-starter" project: https://github.com/input-output-hk/plutus-starter
The full error can be found below, here is the start: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable PlutusTx.Eq.$fEqByteString
Steps to reproduce
VM (more than 1 cpu is needed otherwise haskell-language-server hangs) Install Ubuntu Install Docker Install VSCode Install the VSCode Remote Development extension pack
Clone https://github.com/input-output-hk/plutus-starter Execute 'mkdir -p ~/.cabal/packages' Open plutus-starter in VSCode, It will ask if you want to open it in the container, say yes. Execute 'cabal update' in terminal Execute 'cabal install' in terminal Open the file examples/src/Plutus/Contracts/Game.hs in VSCode Click in the file and wait for the processing to be done
Expected behavior
There should be no errors in the IDE since 'cabal build' is successful See the attached screenshot to see the error I get
System info (please complete the following information):
Screenshots and attachments
Additional context
Note I get the same error message when executing 'haskell-language-server' directly in the terminal.
Complete error message: Program error: GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable PlutusTx.Eq.$fEqByteString [DFunId(nt)] No unfolding Context: Compiling expr: PlutusTx.Eq.$fEqByteString Context: Compiling expr: PlutusTx.Eq.$fEqByteString_N
:: GHC.Types.Coercible
(PlutusTx.Eq.Eq Data.ByteString.Internal.ByteString)
(Data.ByteString.Internal.ByteString
-> Data.ByteString.Internal.ByteString -> GHC.Types.Bool))
Context: Compiling expr: (PlutusTx.Eq.$fEqByteString
_N
:: GHC.Types.Coercible
(PlutusTx.Eq.Eq Data.ByteString.Internal.ByteString)
(Data.ByteString.Internal.ByteString
-> Data.ByteString.Internal.ByteString -> GHC.Types.Bool)))
(ds_dqOC
_N
:: GHC.Types.Coercible
(PlutusTx.Eq.Eq Data.ByteString.Internal.ByteString)
(Data.ByteString.Internal.ByteString
-> Data.ByteString.Internal.ByteString -> GHC.Types.Bool)))
(ds_dqOC
_N
:: GHC.Types.Coercible
(PlutusTx.Eq.Eq Data.ByteString.Internal.ByteString)
(Data.ByteString.Internal.ByteString
-> Data.ByteString.Internal.ByteString -> GHC.Types.Bool)))
(ds_dqOC
_N
:: GHC.Types.Coercible
(PlutusTx.Eq.Eq Data.ByteString.Internal.ByteString)
(Data.ByteString.Internal.ByteString
-> Data.ByteString.Internal.ByteString -> GHC.Types.Bool)))
(ds_dqOC
cast
(PlutusTx.Eq.N:Eq[0]cast
(PlutusTx.Eq.N:Eq[0]cast
(Plutus.Contracts.Game.N:HashedString[0] :: GHC.Types.Coercible Plutus.Contracts.Game.HashedString Data.ByteString.Internal.ByteString)) Context: Compiling expr: (PlutusTx.Eq.$fEqByteStringcast
(PlutusTx.Eq.N:Eq[0]cast
(Plutus.Contracts.Game.N:HashedString[0] :: GHC.Types.Coercible Plutus.Contracts.Game.HashedString Data.ByteString.Internal.ByteString)) (PlutusTx.Builtins.sha2_256 (ds_dqODcast
(Plutus.Contracts.Game.N:ClearString[0] :: GHC.Types.Coercible Plutus.Contracts.Game.ClearString Data.ByteString.Internal.ByteString))) Context: Compiling expr: \ (ds_dqOD [Occ=Once] :: Plutus.Contracts.Game.ClearString) -> (PlutusTx.Eq.$fEqByteStringcast
(PlutusTx.Eq.N:Eq[0]cast
(Plutus.Contracts.Game.N:HashedString[0] :: GHC.Types.Coercible Plutus.Contracts.Game.HashedString Data.ByteString.Internal.ByteString)) (PlutusTx.Builtins.sha2_256 (ds_dqODcast
(Plutus.Contracts.Game.N:ClearString[0] :: GHC.Types.Coercible Plutus.Contracts.Game.ClearString Data.ByteString.Internal.ByteString))) Context: Compiling expr: \ (ds_dqOC [Occ=Once] :: Plutus.Contracts.Game.HashedString) (ds_dqOD [Occ=Once] :: Plutus.Contracts.Game.ClearString) -> (PlutusTx.Eq.$fEqByteStringcast
(PlutusTx.Eq.N:Eq[0]cast
(Plutus.Contracts.Game.N:HashedString[0] :: GHC.Types.Coercible Plutus.Contracts.Game.HashedString Data.ByteString.Internal.ByteString)) (PlutusTx.Builtins.sha2_256 (dsdqODcast
(Plutus.Contracts.Game.N:ClearString[0] :: GHC.Types.Coercible Plutus.Contracts.Game.ClearString Data.ByteString.Internal.ByteString))) Context: Compiling definition of: Plutus.Contracts.Game.isGoodGuess Context: Compiling expr: Plutus.Contracts.Game.isGoodGuess Context: Compiling expr: Plutus.Contracts.Game.isGoodGuess hs Context: Compiling expr: Plutus.Contracts.Game.isGoodGuess hs cs Context: Compiling expr: \ [Occ=Dead] -> Plutus.Contracts.Game.isGoodGuess hs cs Context: Compiling expr: \ (cs [Occ=Once] :: Plutus.Contracts.Game.ClearString) [Occ=Dead] -> Plutus.Contracts.Game.isGoodGuess hs cs Context: Compiling expr: \ (hs [Occ=Once] :: Plutus.Contracts.Game.HashedString) (cs [Occ=Once] :: Plutus.Contracts.Game.ClearString) [Occ=Dead] -> Plutus.Contracts.Game.isGoodGuess hs cs Context: Compiling definition of: Plutus.Contracts.Game.validateGuess Context: Compiling expr: Plutus.Contracts.Game.validateGuess Context: Compiling expr at "main:Plutus.Contracts.Game:(102,8)-(102,46)"