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

Build fails with "Prelude.chr: bad argument" #938

Closed
AliceRixte opened this issue Mar 13, 2023 · 11 comments · Fixed by #939
Closed

Build fails with "Prelude.chr: bad argument" #938

AliceRixte opened this issue Mar 13, 2023 · 11 comments · Fixed by #939

Comments

@AliceRixte
Copy link
Contributor

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 !

@Bodigrim
Copy link
Contributor

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

@AliceRixte
Copy link
Contributor Author

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.

@AliceRixte
Copy link
Contributor Author

AliceRixte commented Mar 13, 2023

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

packages:
- containers

in stack.yaml, everything compiles fine.

@Bodigrim
Copy link
Contributor

Bodigrim commented Mar 13, 2023

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?

@AliceRixte
Copy link
Contributor Author

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

@Bodigrim
Copy link
Contributor

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.

@treeowl
Copy link
Contributor

treeowl commented Mar 13, 2023

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

@treeowl treeowl reopened this Mar 13, 2023
@treeowl
Copy link
Contributor

treeowl commented Mar 13, 2023

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

@Bodigrim
Copy link
Contributor

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

@AliceRixte
Copy link
Contributor Author

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

@treeowl
Copy link
Contributor

treeowl commented Mar 13, 2023

I'm working on that.

treeowl added a commit to treeowl/containers that referenced this issue Mar 13, 2023
* The `stack.yaml` was quite stale. It also was not obviously very
  useful in the context of a GHC boot package. Remove it, as well as the
  instructions for building and testing with `stack`.

* Expand the information on testing/benchmarking with `cabal`.

Closes haskell#938
treeowl added a commit that referenced this issue Mar 13, 2023
* The `stack.yaml` was quite stale. It also was not obviously very
  useful in the context of a GHC boot package. Remove it, as well as the
  instructions for building and testing with `stack`.

* Expand the information on testing/benchmarking with `cabal`.

Closes #938
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

Successfully merging a pull request may close this issue.

3 participants