Skip to content

Package build failures resolver ghc-9.0.1 #5486

Closed
@shayne-fletcher

Description

@shayne-fletcher

General summary

Building ghc-lib-parser with resolver ghc-9.0.1 fails (the package is known to build with cabal / ghc-9.0).

Steps to reproduce

#!/usr/bin/env bash

set -euo pipefail

# This version of ghc-lib-parser is known to build with cabal/ghc-9.0.
ghc_lib_parser=ghc-lib-parser-9.0.1.20210207
curl -o ${ghc_lib_parser}.tar.gz https://hackage.haskell.org/package/${ghc_lib_parser}/${ghc_lib_parser}.tar.gz
gunzip ${ghc_lib_parser}.tar.gz && tar xvf ${ghc_lib_parser}.tar
cd ${ghc_lib_parser}

# Select ghc-9.0.1 for the build compiler.
cat > stack.yaml <<EOF
resolver: ghc-9.0.1
packages:
- .
extra-deps:
- alex-3.2.6
- happy-1.20.0
EOF

# Try to build; observe errors.
stack build --verbosity=debug

Expected

The build succeeds.

Actual

After successfully compiling all the modules in the package an exception is raised.

....
2021-02-07 01:31:58.020433: [info] [264 of 264] Compiling GHC.Driver.Hooks
2021-02-07 01:32:02.694253: [debug] Process finished in 377998ms: /Users/shayne/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.4.0.0_ghc-9.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.4.0.0 build lib:ghc-lib-parser --ghc-options " -fdiagnostics-color=always"
2021-02-07 01:32:02.694375: [debug] Start: getPackageFiles /Users/shayne/tmp/tt/ghc-lib-parser-9.0.1.20210207/ghc-lib-parser.cabal
2021-02-07 01:32:03.373370: [debug] Failed to decode module interface:
/Users/shayne/tmp/tt/ghc-lib-parser-9.0.1.20210207/.stack-work/dist/x86_64-osx/Cabal-3.4.0.0/build/GHC/BaseDir.hi
Decoding failure: not enough bytes
...
2021-02-07 01:32:03.380782: [debug] Finished with exception in 686ms: getPackageFiles /Users/shayne/tmp/tt/ghc-lib-parser-9.0.1.20210207/ghc-lib-parser.cabal
Exception thrown: Prelude.chr: bad argument: 251658397
2021-02-07 01:32:03.381224: [error] Prelude.chr: bad argument: 251658397

Stack version

$ stack --version
Version 2.5.1, Git revision d6ab861544918185236cf826cb2028abb266d6d5 x86_64 hpack-0.33.0

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions