mlabs-haskell / hydra-auction

An auction system running on Hydra L2 solution
Apache License 2.0
7 stars 5 forks source link

`haskell-language-server` fails to startup due to failure in `HydraAuction.OnChain` #184

Closed MangoIV closed 1 year ago

MangoIV commented 1 year ago

For some reason haskell-language-server doesn't work properly because when compiling HydraAuction.OnChain it fails with:

  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.Base..
  No unfolding
  Context: Compiling expr: PlutusTx.Base..
  Context: Compiling expr: PlutusTx.Base..
  @ (HydraAuction.Types.StandingBidDatum
  -> HydraAuction.Types.StandingBidRedeemer
  -> Plutus.V2.Ledger.Contexts.ScriptContext
  -> GHC.Types.Bool)
  Context: Compiling expr: PlutusTx.Base..
  @ (HydraAuction.Types.StandingBidDatum
  -> HydraAuction.Types.StandingBidRedeemer
  -> Plutus.V2.Ledger.Contexts.ScriptContext
  -> GHC.Types.Bool)
  @ Plutus.Extras.ValidatorType
  Context: Compiling expr: PlutusTx.Base..
  @ (HydraAuction.Types.StandingBidDatum
  -> HydraAuction.Types.StandingBidRedeemer
  -> Plutus.V2.Ledger.Contexts.ScriptContext
  -> GHC.Types.Bool)
  @ Plutus.Extras.ValidatorType
  @ HydraAuction.Types.AuctionTerms
  Context: Compiling expr: PlutusTx.Base..
  @ (HydraAuction.Types.StandingBidDatum
  -> HydraAuction.Types.StandingBidRedeemer
  -> Plutus.V2.Ledger.Contexts.ScriptContext
  -> GHC.Types.Bool)
  @ Plutus.Extras.ValidatorType
  @ HydraAuction.Types.AuctionTerms
  (Plutus.Extras.wrapValidator
  @ HydraAuction.Types.StandingBidDatum
  @ HydraAuction.Types.StandingBidRedeemer
  @ Plutus.V2.Ledger.Contexts.ScriptContext
  HydraAuction.Types.$fUnsafeFromDataStandingBidDatum
  HydraAuction.Types.$fUnsafeFromDataStandingBidRedeemer
  Plutus.V2.Ledger.Contexts.$fUnsafeFromDataScriptContext)
  Context: Compiling expr: PlutusTx.Base..
  @ (HydraAuction.Types.StandingBidDatum
  -> HydraAuction.Types.StandingBidRedeemer
  -> Plutus.V2.Ledger.Contexts.ScriptContext
  -> GHC.Types.Bool)
  @ Plutus.Extras.ValidatorType
  @ HydraAuction.Types.AuctionTerms
  (Plutus.Extras.wrapValidator
  @ HydraAuction.Types.StandingBidDatum
  @ HydraAuction.Types.StandingBidRedeemer
  @ Plutus.V2.Ledger.Contexts.ScriptContext
  HydraAuction.Types.$fUnsafeFromDataStandingBidDatum
  HydraAuction.Types.$fUnsafeFromDataStandingBidRedeemer
  Plutus.V2.Ledger.Contexts.$fUnsafeFromDataScriptContext)
  HydraAuction.OnChain.StandingBid.mkStandingBidValidator
  Context: Compiling expr at "main:HydraAuction.OnChain:(77,8)-(77,69)"

It looks like this is a PlutusTx related error, I cannot reproduce it only with cabal, though.

Commit hash is 104f217d21a2674fff63d799e87378a94c45eeeb

uhbif19 commented 1 year ago

Please check Plutus Troubleshooting page, maybe I introduced bug not caught by CI somehow.

Will check on that later.

uhbif19 commented 1 year ago

Current consensus for solution is:

I think you're right. While I generally prefer "strict by default", I don't think it's possible to non-awkwardly turn on defer-errors for editors. Perhaps if we document this properly in the README, we can go ahead with defer-errors by default and no-defer-errors for CI.