Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no instance for HasLink #1608

Closed
benz0li opened this issue Sep 5, 2022 · 2 comments
Closed

There is no instance for HasLink #1608

benz0li opened this issue Sep 5, 2022 · 2 comments

Comments

@benz0li
Copy link

benz0li commented Sep 5, 2022

This error occurs when trying to build pandoc 2.19.2 with GHC 9.4.2.

Steps to reproduce

  1. Clone repository:
    git clone https://github.com/jgm/pandoc.git
  2. Checkout 2.19.2:
    cd pandoc
    git checkout 2.19.2
  3. Update codebase:
    diff --git a/Makefile b/Makefile
    index f5beb0a44..587b0f764 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -3,7 +3,7 @@ pandoc=$(shell find dist -name pandoc -type f -exec ls -t {} \; | head -1)
     SOURCEFILES?=$(shell git ls-tree -r master --name-only | grep "\.hs$$")
     BRANCH?=master
     ARCH=$(shell uname -m)
    -DOCKERIMAGE=registry.gitlab.b-data.ch/ghc/ghc4pandoc:9.2.3
    +DOCKERIMAGE=registry.gitlab.b-data.ch/ghc/ghc4pandoc:9.4.2
     COMMIT=$(shell git rev-parse --short HEAD)
     TIMESTAMP=$(shell date "+%Y%m%d_%H%M")
     LATESTBENCH=$(word 1,$(shell ls -t bench_*.csv 2>/dev/null))
    diff --git a/linux/make_artifacts.sh b/linux/make_artifacts.sh
    index 4653a0c19..c30440976 100644
    --- a/linux/make_artifacts.sh
    +++ b/linux/make_artifacts.sh
    @@ -27,7 +27,8 @@ ghc --version
     
     cabal update
     cabal clean
    -cabal configure -f-export-dynamic -fembed_data_files --enable-executable-static --ghc-options '-j4 +RTS -A256m -RTS -split-sections -optc-Os -optl=-pthread' pandoc
    +cabal configure -f-export-dynamic -fembed_data_files --allow-newer --enable-executable-static --ghc-options '-j4 +RTS -A256m -RTS -split-sections -optc-Os 
    +-optl=-pthread' pandoc
     cabal build -j4
     for f in $(find dist-newstyle -name 'pandoc' -type f -perm /400); do cp $f $ARTIFACTS/; done
     
  4. Make Debian package:
    make debpkg

Log file: docker-log.txt

@Taneb
Copy link
Contributor

Taneb commented Sep 5, 2022

Extracting the error from the linked logs, for others' convenience:

[31 of 33] Compiling Servant.Links    ( src/Servant/Links.hs, dist/build/Servant/Links.o, dist/build/Servant/Links.dyn_o )

src/Servant/Links.hs:650:10: error:
    • There is no instance for HasLink (arr :> ...)
      arr expects 1
                  GHC.TypeNats.+ Servant.API.TypeErrors.Arity' b more arguments
    • In the ambiguity check for an instance declaration
      In the instance declaration for ‘HasLink ((arr :: a -> b) :> sub)’
    |
650 | instance TypeError (PartialApplication HasLink arr) => HasLink ((arr :: a -> b) :> sub)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Servant/Links.hs:656:31: error:
    • There is no instance for HasLink (ty :> ...)
    • In the ambiguity check for an instance declaration
      In the instance declaration for ‘HasLink (ty :> sub)’
    |
656 | instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub HasLink ty) => HasLink (ty :> sub)
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@benz0li
Copy link
Author

benz0li commented Oct 28, 2022

Resolved by #1592

@benz0li benz0li closed this as completed Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants