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

Hashable 1.4.2.0 fails to build on integer-simple GHC #268

Open
pdwhittaker opened this issue Mar 20, 2023 · 2 comments
Open

Hashable 1.4.2.0 fails to build on integer-simple GHC #268

pdwhittaker opened this issue Mar 20, 2023 · 2 comments

Comments

@pdwhittaker
Copy link

pdwhittaker commented Mar 20, 2023

I'm seeing compilation errors when I try to build Hashable 1.4.2.0 using integer-simple GHC releases, for example integer-simple GHC 8.10.6 on Alpine or integer-simple GHC 8.10.7 on Windows. There were no problems when I added a Cabal constraint to force version ==1.4.1.0 (and tested with integer-simple GHC 8.10.7 on Windows), or when I built using integer-gmp GHC releases on Linux.

I don't have them immediately to hand, but am happy to show my compiler errors and provide steps to reproduce on an Alpine container if this isn't easy to reproduce.

@phadej
Copy link
Contributor

phadej commented Mar 20, 2023

Reproduction steps would be nice. The non-GMP code branches are currently untested.

But FWIW, on GHC-9+ they should be the same as Integer stuff is handled via ghc-bignum

@pdwhittaker
Copy link
Author

Thanks for confirming that about GHC-9+. I'd wondered if this flavour of old GHC release would be covered by tests.

Here's the recipe I've been using to reproduce. I'm using LXD on Ubuntu 20.04, and the first two lxc commands bring up a clean Alpine container; I assume you can translate that as necessary if you're on another platform. But after that point, the rest of the commands should run exactly as-is inside the Alpine container.

Towards the end I build the default Cabal project, and run ldd to confirm that this really is an integer-simple (and not a libgmp) build. (I found that some GHC releases labeled as 'integer-simple' were nonetheless libgmp-based.)

Finally, I pull in hashable to demonstrate the build error.

  • Bring up an Alpine container for testing:

    lxc launch images:alpine/3.14 issue-268
    lxc shell issue-268
    
  • Unpack suitable GHC release:

    apk add curl
    cd /root
    curl -sS https://downloads.haskell.org/~ghc/8.10.6/ghc-8.10.6-x86_64-alpine3.10-linux-integer-simple.tar.xz | tar -xvJ 
    
  • Install GHC:

    apk add binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz
    cd /root/ghc-8.10.6-x86_64-unknown-linux
    ./configure --prefix=/root/ghc
    make install
    
  • Install Cabal:

    cd /root/ghc/bin
    curl -sS https://downloads.haskell.org/~cabal/cabal-install-3.6.2.0/cabal-install-3.6.2.0-x86_64-linux-alpine.tar.xz | tar -xvJ
    PATH=/root/ghc/bin:"$PATH"
    
  • Create (working, at this stage) default project:

    mkdir /root/proj
    cd /root/proj
    cabal init
    cabal run  # "Hello, Haskell!"
    
  • Confirm that this is definitely an integer-simple (not a libgmp) build:

    ldd /root/proj/dist-newstyle/build/x86_64-linux/ghc-8.10.6/proj-0.1.0.0/x/proj/build/proj/proj | grep gmp  # No output
    
  • Demonstrate issue by pulling in hashable-1.4.2.0 package:

    sed -i -e '/build-depends/ s/$/, hashable ==1.4.2.0/' proj.cabal
    cabal update
    cabal build  # Compilation fails
    

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