Haskell — eitherParsec error using cabal update

Adrien Pellegrini
1 min readJul 21, 2021

--

Once in a while, I try new things and this time is playing with Haskell, cabal, and Plutus Pioneer program.

In WSL2 with Ubuntu, I got this error using cabal.project file from Plutus Pioneer Program GitHub repo when simply running cabal update :

“<eitherParsec>” (line 2, column 1):
unexpected ‘p’
expecting space or end of input

The error occurred on this block near subdir:


...
source-repository-package
type: git
location: https://github.com/input-output-hk/plutus.git
subdir:
freer-extras
playground-common
plutus-chain-index
plutus-core
plutus-contract
plutus-ledger
plutus-ledger-api
plutus-tx
plutus-tx-plugin
prettyprinter-configurable
quickcheck-dynamic
word-array
tag: ea0ca4e9f9821a9dbfc5255fa0f42b6f2b3887c4
...

The “fix” (if we can call this a fix…) is to use subdir on each line like this:

source-repository-package
type: git
location: https://github.com/input-output-hk/plutus.git
subdir: freer-extras
subdir: playground-common
subdir: plutus-chain-index
subdir: plutus-core
subdir: plutus-contract
subdir: plutus-ledger
subdir: plutus-ledger-api
subdir: plutus-tx
subdir: plutus-tx-plugin
subdir: prettyprinter-configurable
subdir: quickcheck-dynamic
subdir: word-array
tag: 81ba78edb1d634a13371397d8c8b19829345ce0d

I hope it will help someone not wasting as much time as myself on such compatibility error (cabal version was old, GHC also).

Specifically for the Plutus Pioneer repo, this error can be avoided using Nix-shell. It solves a lot of issues and run perfectly within WSL2 (with bash shell).

Tools versions:

  • GHC — The Glorious Glasgow Haskell Compilation System, version 8.8.4
  • cabal — cabal-install version 3.0.0.0
  • Ubuntu — Ubuntu 21.04

--

--