Agda 2.5.2 is not compatible with Happy 1.19.6 (see https://github.com/agda/agda/issues/2731). Why these versions of these two programs were included in LTS 9.3?
You can reproduce the incompatibility by running the following commands (please note I'm not familiar with the Stackage tools):
$ cat stack-8.0.2.yaml
resolver: lts-9.3
# Local packages, usually specified by relative directory name
packages:
- '.'
$ export ARGS="--stack-yaml stack-8.0.2.yaml --system-ghc"
$ cabal get Agda-2.5.2
$ cd Agda-2.5.2
$ stack build $ARGS --no-terminal --only-dependencies
$ stack build $ARGS --no-terminal
...
[ 94 of 334] Compiling Agda.Syntax.Parser.Parser ( .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Agda/Syntax/Parser/Parser.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Agda/Syntax/Parser/Parser.o )
/<PATH>/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Agda/Syntax/Parser/Parser.hs:2441:19: error:
• Couldn't match type ‘t13’ with ‘()’
‘t13’ is a rigid type variable bound by
the type signature for:
happyReduce_114 :: forall t13 t14 t15 t38 t41 t44 t45 t46 t54 t55 t84.
Happy_GHC_Exts.Int#
-> Token
-> Happy_GHC_Exts.Int#
-> Happy_IntList
-> HappyStk
(HappyAbsSyn t13 t14 t15 t38 t41 t44 t45 t46 t54 t55 t84)
-> Parser (HappyAbsSyn t13 t14 t15 t38 t41 t44 t45 t46 t54 t55 t84)
at .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Agda/Syntax/Parser/Parser.hs:2440:20
Expected type: Happy_GHC_Exts.Int#
-> Token
-> Happy_GHC_Exts.Int#
-> Happy_IntList
-> HappyStk
(HappyAbsSyn t13 t14 t15 t38 t41 t44 t45 t46 t54 t55 t84)
-> Parser (HappyAbsSyn t13 t14 t15 t38 t41 t44 t45 t46 t54 t55 t84)
Actual type: Happy_GHC_Exts.Int#
-> Token
-> Happy_GHC_Exts.Int#
-> Happy_IntList
-> HappyStk
(HappyAbsSyn () t14 t15 t38 t41 t44 t45 t46 t54 t55 t84)
-> Parser (HappyAbsSyn () t14 t15 t38 t41 t44 t45 t46 t54 t55 t84)
...
Process exited with code: ExitFailure 1
Yep, I can reproduce this with stack build Agda happy for LTS-9.3.
Please note that I run the following command for testing Agda with a different version of Alex or Happy:
$ rm -r dist/build/Agda/Syntax/Parser
Edited: The above command is used with cabal-install.
@asr A small but important correction on your last command: Stack does not use dist, but files inside dist. For me your command becomes rm -r .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Agda/Syntax/Parser/ — I'd probably recommend rm -r .stack-work/dist/*/Cabal-*/build/Agda/Syntax/Parser/ after checking the expansion isn't stupid.
But the problem reproduces anyway.
On possible reasons for this issue: I suspect this might have to do with the known build-tools issues (that IIRC Stack inherits from Cabal-the-library but I'm not sure). Or have those finally been fixed?
Since (IIRC) those build-tools issues have been open for a while, should Stackage meanwhile just build alex and happy first—and maybe other common build tools? That would at least ensure snapshots are consistent.
For the record: stack build has a custom-setup related warning—I don't expect this is relevant to the issue, but mentioning it for completeness.
$ stack build
Agda-2.5.3: unregistering (local file changes: Agda.cabal CHANGELOG.md README.md Setup.hs src/agda-mode/Main.hs src/data/Agda.css src/data/JS/ag...)
Agda-2.5.3: configure (lib + exe)
Package Agda uses a custom Cabal build, but does not use a custom-setup stanza
Using the explicit setup deps approach based on configuration
Strongly recommend fixing the package's cabal file
@Blaisorblade thanks for the correction. I mentioned that the command is used with cabal-install.
This should be fixed in LTS-9.4 (please see https://github.com/fpco/stackage/issues/2852#issuecomment-328464216), please test it out if you get a chance, thanks!
Fixed in LTS-9.4, thanks for the report!
please test it out if you get a chance, thanks!
I hadn't problems using LTS 9.4. Thanks!