haskell / containers

Assorted concrete container types

Home Page:https://hackage.haskell.org/package/containers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build fails with "Prelude.chr: bad argument"

AliceRixte opened this issue · comments

Hello !

Compiling the package containers works fine but compiling containers-test fails with the following message :

ghc.exe: panic! (the 'impossible' happened)
  (GHC version 8.4.4 for x86_64-unknown-mingw32):
        Prelude.chr: bad argument: 3179719811

This happens using mingw on windows (I haven,'t tried to compile on an other OS yet).Any clue why ?

Cheers !

Any particular reason to use GHC 8.4? Is it with Stack?

Yes I used stack build on a clone of the current repository. The current stack.yaml uses the lts-12.26 so that's why. I've tried other resolvers though, and it also fails. More recent ones fail with broken dependencies. For instance when using
resolver: ghc-9.6.1
The build fails with broken dependencies :

While constructing the build plan, Stack encountered the following errors:   

       In the dependencies for containers-tests-0:
           QuickCheck needed, but the Stack configuration has no specified
                      version (latest matching version is 2.14.2)
           nothunks needed, but the Stack configuration has no specified
                    version (latest matching version is 0.1.3)
       needed since containers-tests is a build target.

Again, this only happens with containers-test, when setting

packages:
- containers

in stack.yaml, everything compiles fine.

I would recommend using vanilla cabal when working on containers. Given how outdated is stack.yaml you seem to be the first daring soul to use stack in quite a few years.

Try stack clean?

stack clean doesn't change anything. I guess I'll switch to cabal.
Thanks a lot for your quick answers ! :-)

The background is that this kind of error usually happens when there are stalled interface files, written by a newer version GHC but read by an old one or vice versa. Usually updating Stack, cleaning .stack-work and using a reasonably recent GHC (e. g., 9.2) solves it, but there might be some complications.

Last time I used Stack with boot libraries, it got somewhat confused and asked me to pin all boot dependencies as extra-deps. This basically limits any added value, and it is easier to use Cabal.

@Bodigrim , I don't remember who wanted a stack.yaml. Should we just get rid of it to reduce confusion?

Reopening because we don't want stale code that tricks people.

Yeah, I think it's better to drop stack.yaml.

The file CONTRIBUTING.md also contains some instructions to build via stack, so I guess it also would need an update :)

I'm working on that.