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

Stack Build dependencies error #1774

Closed
Dave-Lindberg opened this issue Aug 16, 2022 · 2 comments
Closed

Stack Build dependencies error #1774

Dave-Lindberg opened this issue Aug 16, 2022 · 2 comments

Comments

@Dave-Lindberg
Copy link

Cannot complete 'stack build'.

Running Mac OS Monterey v12.5 on an M1, following the Yesod Quick Start Guide

When running stack build I receive the following output:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for newsite-0.0.0:
    aeson-2.0.3.0 from stack configuration does not match ==1.4.*  (latest matching version
                  is 1.4.7.1)
    fast-logger-3.1.1 from stack configuration does not match >=2.2 && <3.1  (latest matching
                      version is 3.0.5)
    persistent-2.13.3.5 from stack configuration does not match >=2.9 && <2.11  (latest matching
                        version is 2.10.5.4)
    persistent-sqlite-2.13.1.0 from stack configuration does not match >=2.9 && <2.11  (latest
                               matching version is 2.10.6.2)
    persistent-template-2.12.0.0 from stack configuration does not match >=2.5 && <2.9  (latest
                                 matching version is 2.8.3.1)
    wai-extra-3.1.12.1 from stack configuration does not match ==3.0.*  (latest matching version
                       is 3.0.32)
    wai-logger-2.4.0 from stack configuration does not match >=2.2 && <2.4  (latest matching
                     version is 2.3.7)
    yesod-form-1.7.0 from stack configuration does not match ==1.6.*  (latest matching version
                     is 1.6.7)
needed since newsite is a build target.

Some different approaches to resolving this:

  * Set 'allow-newer: true'
    in /Users/dlindberg/.stack/config.yaml to ignore all version constraints and build anyway.

  * Recommended action: try adding the following to your extra-deps
    in /Users/dlindberg/Code/haskell/newsite/stack.yaml:

- aeson-1.4.7.1@sha256:6199a98b072e5a7748e81ab72476a0992cf23d925ebe4fefd5b917cbda9c2af8,7098
- fast-logger-3.0.5@sha256:fd430f998045aa86226faa29652ee797410a11edd9b77b709be1bedc96f77c4d,2398
- persistent-2.10.5.4@sha256:5bba82e29e731d9e1c11e5099798b58304d07cb1d29a154af4221ea0d019cac8,4785
- persistent-sqlite-2.10.6.2@sha256:054637283f68e662562eb8e9deb0ca021f2c797733b8c0f86fb71ebe6664e5cd,5190
- persistent-template-2.8.3.1@sha256:3397b5bc68efd66e6dcc4564bef476b20f902b519c324fbbfb98bfb02e84344a,2864
- wai-extra-3.0.32@sha256:7a9e65c4555e1b937dc788b8ba249dbacd4f36840c60581bc27115a5c4a48079,7044
- wai-logger-2.3.7@sha256:19a0dc5122e22d274776d80786fb9501956f5e75b8f82464bbdad5604d154d82,1671
- yesod-form-1.6.7@sha256:b216bb4eb0575d4fcc497b1d7f47edf25fc9035ab3ae8b77bf7fcbedc15dd2ea,3350

Plan construction failed.

My current stack.yaml file contains:

 packages:
  1 - .
  2 resolver: lts-19.19

see development environment gist: https://gist.github.com/Dave-Lindberg/7d9bc77757e9502ccd19f7b7cdec450d

Any guidance is appreciated.

@Dave-Lindberg
Copy link
Author

After a bit of research, I added the missing items to my project's stack.yaml. Running stack build produced a new, smaller set of required dependencies, which I also added.

Now running stack build produces the following:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for aeson-1.4.7.1:
    bytestring must match >=0.10.8.1 && <0.11, but this GHC boot package has been pruned (issue
               #4510); you need to add the package explicitly to extra-deps  (latest matching
               version is 0.10.12.1)
    text must match >=1.2.3.0 && <1.3, but this GHC boot package has been pruned (issue #4510); you
         need to add the package explicitly to extra-deps  (latest matching version is 1.2.5.0)
needed due to newsite-0.0.0 -> aeson-1.4.7.1

In the dependencies for alex-3.2.7.1:
    directory needed, but this GHC boot package has been pruned (issue #4510); you need to add the
              package explicitly to extra-deps  (latest matching version is 1.3.7.0)
needed due to newsite-0.0.0 -> alex-3.2.7.1

In the dependencies for appar-0.1.8:
    bytestring needed, but this GHC boot package has been pruned (issue #4510); you need to add the
               package explicitly to extra-deps  (latest matching version is 0.11.2.0)
needed due to newsite-0.0.0 -> appar-0.1.8

...

In the dependencies for yesod-static-1.6.1.0:
    bytestring must match >=0.9.1.4, but this GHC boot package has been pruned (issue #4510); you
               need to add the package explicitly to extra-deps  (latest matching version
               is 0.11.2.0)
    directory must match >=1.0, but this GHC boot package has been pruned (issue #4510); you need
              to add the package explicitly to extra-deps  (latest matching version is 1.3.7.0)
    process needed, but this GHC boot package has been pruned (issue #4510); you need to add the
            package explicitly to extra-deps  (latest matching version is 1.6.13.2)
    text must match >=0.9, but this GHC boot package has been pruned (issue #4510); you need to add
         the package explicitly to extra-deps  (latest matching version is 2.0)
needed due to newsite-0.0.0 -> yesod-static-1.6.1.0

In the dependencies for zlib-0.6.3.0:
    bytestring must match >=0.9 && <0.12, but this GHC boot package has been pruned (issue
               #4510); you need to add the package explicitly to extra-deps  (latest matching
               version is 0.11.2.0)
needed due to newsite-0.0.0 -> zlib-0.6.3.0

Some different approaches to resolving this:

  * Build requires unattainable version of base. Since base is a part of GHC, you most likely need
    to use a different GHC version with the matching base.

Plan construction failed.

@Dave-Lindberg
Copy link
Author

Resolved this issue by:

  1. Cleaned out existing installation
  2. Re-ran steps 2 and 3 from the Yesod Quick Start Guide
  3. Ran stack config set resolver lts as per Issue 1693
  4. Re-ran stack install yesod-bin --install-ghc which produced the list of mismatched dependencies
  5. Updated package.yaml to reflect the necessary package versions
  6. Added {-# LANGUAGE DataKinds #-} to src/Model.hs

at this point, stack build runs successfully

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

1 participant