Skip to content

Conversation

@philderbeast
Copy link
Contributor

@philderbeast philderbeast commented Sep 22, 2022

I'm using this package with ghc-8.10.7 but would soon like to use it with ghc-9.2.4 and ghc-9.4.2.. The hackage build is failing:

Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: stack2cabal-1.0.14 (user goal)
[__1] trying: base-4.16.3.0/installed-4.16.3.0 (dependency of stack2cabal)
[__2] next goal: Cabal (dependency of stack2cabal)
[__2] rejecting: Cabal-3.6.3.0/installed-3.6.3.0 (conflict: stack2cabal =>
Cabal>=3.0 && <=3.4)
[__2] skipping: Cabal-3.8.1.0, Cabal-3.6.3.0, Cabal-3.6.2.0, Cabal-3.6.1.0,
Cabal-3.6.0.0, Cabal-3.4.1.0, Cabal-3.4.0.0 (has the same characteristics that
caused the previous version to fail: excluded by constraint '>=3.0 && <=3.4'
from 'stack2cabal')
[__2] rejecting: Cabal-3.2.1.0 (conflict: base==4.16.3.0/installed-4.16.3.0,
Cabal => base>=4.6 && <4.15)
[__2] skipping: Cabal-3.2.0.0, Cabal-3.0.2.0, Cabal-3.0.1.0, Cabal-3.0.0.0,
Cabal-2.4.1.0 (has the same characteristics that caused the previous version
to fail: excludes 'base' version 4.16.3.0)
[__2] rejecting: Cabal-2.4.0.1 (conflict: stack2cabal => Cabal>=3.0 && <=3.4)
[__2] skipping: Cabal-2.4.0.0, Cabal-2.2.0.1, Cabal-2.2.0.0, Cabal-2.0.1.1,
Cabal-2.0.1.0, Cabal-2.0.0.2, Cabal-1.24.2.0, Cabal-1.24.0.0, Cabal-1.22.8.0,
Cabal-1.22.7.0, Cabal-1.22.6.0, Cabal-1.22.5.0, Cabal-1.22.4.0,
Cabal-1.22.3.0, Cabal-1.22.2.0, Cabal-1.22.1.1, Cabal-1.22.1.0,
Cabal-1.22.0.0, Cabal-1.20.0.4, Cabal-1.20.0.3, Cabal-1.20.0.2,
Cabal-1.20.0.1, Cabal-1.20.0.0, Cabal-1.18.1.7, Cabal-1.18.1.6,
Cabal-1.18.1.5, Cabal-1.18.1.4, Cabal-1.18.1.3, Cabal-1.18.1.2,
Cabal-1.18.1.1, Cabal-1.18.1, Cabal-1.18.0, Cabal-1.16.0.3, Cabal-1.16.0.2,
Cabal-1.16.0.1, Cabal-1.16.0, Cabal-1.14.0, Cabal-1.12.0, Cabal-1.10.2.0,
Cabal-1.10.1.0, Cabal-1.10.0.0, Cabal-1.8.0.6, Cabal-1.8.0.4, Cabal-1.8.0.2,
Cabal-1.6.0.3, Cabal-1.6.0.2, Cabal-1.6.0.1, Cabal-1.4.0.2, Cabal-1.4.0.1,
Cabal-1.4.0.0, Cabal-1.2.4.0, Cabal-1.2.3.0, Cabal-1.2.2.0, Cabal-1.2.1,
Cabal-1.1.6, Cabal-1.24.1.0 (has the same characteristics that caused the
previous version to fail: excluded by constraint '>=3.0 && <=3.4' from
'stack2cabal')
[__2] fail (backjumping, conflict set: Cabal, base, stack2cabal)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: stack2cabal, Cabal, base

I bumped the stack resolver slightly and got the package compiling with ghc-8.10.7, ghc-9.2.4 and ghc-9.4.2 building with cabal.

> cabal build all --enable-tests
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - aeson-2.1.1.0 (lib) (requires build)
 - http-client-0.7.13.1 (lib) (requires build)
 - yaml-0.11.8.0 (lib) (requires build)
 - http-client-tls-0.3.6.1 (lib) (requires build)
 - hpack-0.35.0 (lib) (requires build)
 - stack2cabal-1.0.14 (lib) (first run)
 - stack2cabal-1.0.14 (exe:stack2cabal) (first run)
...
> cabal build all --enable-tests
Resolving dependencies...
Build profile: -w ghc-9.2.4 -O1
In order, the following will be built (use -v for more details):
 - stack2cabal-1.0.14 (lib) (first run)
 - stack2cabal-1.0.14 (exe:stack2cabal) (first run)
...
> cabal build all --enable-tests
Resolving dependencies...
Build profile: -w ghc-9.4.2 -O1
In order, the following will be built (use -v for more details):
 - stack2cabal-1.0.14 (lib) (first run)
 - stack2cabal-1.0.14 (exe:stack2cabal) (first run)
...

@hasufell
Copy link
Owner

Why would we delete the freeze file?

@philderbeast
Copy link
Contributor Author

philderbeast commented Sep 24, 2022

I deleted the index-state, allow-newer and the freeze file. As for the freeze file I did a little experiment on this branch using ghc-8.10.7, ghc-9.2.4 and ghc-9.4.2. As it stands I can build the project with all three compiler versions. Freezing with any one then prevents compilation with the other two.

freeze-files.zip

@hasufell
Copy link
Owner

The freeze file doesn't need to support multiple GHCs. What is the reason? If you build from hackage, there is no freeze file. Building from the repo is supposed to be reproducible.

You can also if-else on ghc version in cabal.project, see https://cabal.readthedocs.io/en/stable/cabal-project.html?highlight=conditionals#conditionals-and-imports

@philderbeast
Copy link
Contributor Author

philderbeast commented Sep 27, 2022

What is the reason?

The project builds fine without the freeze file on this branch and freeze files have their problems and caveats:

@hasufell
Copy link
Owner

Well. I don't want the freeze file deleted.

@philderbeast
Copy link
Contributor Author

philderbeast commented Sep 28, 2022

I added back a freeze file generated with ghc-8.10.7 and set the Cabal upper bounds <3.8.

@hasufell hasufell merged commit 4d6d6a4 into hasufell:master Sep 30, 2022
@philderbeast philderbeast mentioned this pull request Mar 17, 2024
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 this pull request may close these issues.

2 participants