Hi!
I was following the install instructions... and immediately after cloning, this pops:
$ cabal v2-run install.hs --project-file install/shake.project help
Resolving dependencies...
Build profile: -w ghc-8.10.1 -O1
In order, the following will be built (use -v for more details):
- fake-package-0 (exe:script) (configuration changed)
Configuring executable 'script' for fake-package-0..
Preprocessing executable 'script' for fake-package-0..
Building executable 'script' for fake-package-0..
[1 of 1] Compiling Main ( Main.hs, /home/ulidtko/src/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-8.10.1/fake-package-0/x/script/build/script/script-tmp/Main.dyn_o )
Main.hs:18:1: error: parse error on input ‘import’
|
Ehhhh... wat. This is apparently about the 19th line of install.hs. What's wrong?
Yeah that's weird, what version of cabal-install are you using?
> cabal --version
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library
GHC 8.10.1. System is Arch Linux.
Ok i was able to reproduce it with
cabal v2-run install.hs --ghc-options "-haddock" --project-file install/shake.project help
But no with a raw
cabal v2-run install.hs --project-file install/shake.project help
so the unique other way to trigger it i can imagine is to have in install/shake.project or in the global cabal config --haddock in ghc params, as described in the readme . Note that there is a warning about enabling globally the option, because it can cause parse errors like yours.
So i would advise to not set the flag globally, only for individual projects.
@jneira thanks. I thought more than once about the -haddock (I did add it globally), but somehow the Compiling Main line just above (and no Linking line after it) has convinced me that it's not docs.
So this is Haddock not "getting" the shebang, right? It's still weird that it doesn't understand the import keyword.
Yeah, cabal/stack scripts feature is relatively recent and it is not widely used, so the interaction with haddock has not been tested.
The resolution could be:
We have to take in account -haddock errors are going to be demoted to warnings, hopefully soon.
Most helpful comment
Ok i was able to reproduce it with
But no with a raw
so the unique other way to trigger it i can imagine is to have in
install/shake.projector in the global cabal config--haddockin ghc params, as described in the readme . Note that there is a warning about enabling globally the option, because it can cause parse errors like yours.So i would advise to not set the flag globally, only for individual projects.