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

cannot include 5.0.1 in stack project #63

Closed
ndwarshuis opened this issue Feb 11, 2023 · 3 comments
Closed

cannot include 5.0.1 in stack project #63

ndwarshuis opened this issue Feb 11, 2023 · 3 comments

Comments

@ndwarshuis
Copy link

ndwarshuis commented Feb 11, 2023

I might be missing something very basic about how cabal works, but I cannot use 5.0.1 in a stack project without getting this error:

Error: While constructing the build plan, the following exceptions were encountered:                                                                                                           
                                                                                                                                                                                               
In the dependencies for mybin-0.1.0.0:                                                                                                                                                        
    persistent-mtl is a library dependency, but the package provides no library                                                                                                                
needed since budget is a build target.                                                                                                                                                         

stack file:

resolver: lts-20.9

extra-deps:
- persistent-mtl-0.5.0.1@sha256:44e14fdf2906676e8d40262ab1a4da6d22f766d4b6140be7321f662c05fb0ae2,3011
# other stuff...

package.yaml

name: mybin
# version/repo stuff...

dependencies:
- persistent-mtl >= 0.5.0.1
# other deps

library:
  source-dirs: lib/
  ghc-options:
  - -Wall
  - -Wcompat
  - -Widentities
  - -Wincomplete-record-updates
  - -Wincomplete-uni-patterns
  - -Wredundant-constraints
  - -Wpartial-fields
  - -Werror
  - -O2

executables:
  mybin:
    main:                Main.hs
    source-dirs:         app
    ghc-options:
    - -Wall
    - -Wcompat
    - -Widentities
    - -Wincomplete-record-updates
    - -Wincomplete-uni-patterns
    - -Wredundant-constraints
    - -Wpartial-fields
    - -Werror
    - -O2
    - -threaded
    dependencies:
    - mybin

Downgrading to 5.0.0 works, which makes me wonder if it has to do with the buildable: False directive in the persistent-mtl .cabel file.

@brandonchinn178
Copy link
Owner

Yes, GHC 9.2 has a bug that breaks persistent-mtl: #45

5.0 might build, but it'll probably fail at runtime

@brandonchinn178 brandonchinn178 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2023
@ndwarshuis
Copy link
Author

thanks for clarifying, does this just affect 5.0.1 or all of 5.0.x? (eg do I need to drop down further to 4.x if I want to stick with ghc 9.2?)

@brandonchinn178
Copy link
Owner

Unfortunately, the MonadSqlQuery (TransactionM m) constraint is the thing causing issues, which was added in 4.0. So you'd need to drop to 3.0. I guess theoretically we could avoid adding the constraint in GHC 9.2, which would allow general use of the library to work with GHC 9.2, but using functions polymorphically wouldn't typecheck.

If you want to tinker around and put up a PR, I could merge it! I won't be able to try anything this weekend.

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