stack-run icon indicating copy to clipboard operation
stack-run copied to clipboard

stack install stack-run fails

Open StevePoling opened this issue 7 years ago • 26 comments
trafficstars

Hi, I performed these steps on both my MacBook and Windows 10 laptops:

stack build stack build intero stack install QuickCheck stack install stack-run

The last step fails on both machines with the same message.

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

In the dependencies for stack-run-0.1.1.4: conduit-1.3.0.3 from stack configuration does not match >1.1 && <1.3 (latest matching version is 1.2.13.1) conduit-extra-1.3.0 from stack configuration does not match >=1.1 && <1.2 (latest matching version is 1.1.17) needed since stack-run is a build target.

Some different approaches to resolving this:

  • Set 'allow-newer: true' to ignore all version constraints and build anyway.

  • Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some working build configuration. This can be convenient when dealing with many complicated constraint errors, but results may be unpredictable.

  • Recommended action: try adding the following to your extra-deps in C:\Users\Steve\source\Workspaces\Haskell\MyFirstHaskellProject\stack.yaml:

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

In the dependencies for stack-run-0.1.1.4: conduit-1.3.0.3 from stack configuration does not match >1.1 && <1.3 (latest matching version is 1.2.13.1) conduit-extra-1.3.0 from stack configuration does not match >=1.1 && <1.2 (latest matching version is 1.1.17) needed since stack-run is a build target.

Some different approaches to resolving this:

  • Set 'allow-newer: true' to ignore all version constraints and build anyway.

  • Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some working build configuration. This can be convenient when dealing with many complicated constraint errors, but results may be unpredictable.

  • Recommended action: try adding the following to your extra-deps in C:\Users\Steve\source\Workspaces\Haskell\MyFirstHaskellProject\stack.yaml:

  • conduit-1.2.13.1
  • conduit-extra-1.1.17

Plan construction failed.

So, I edited the stack.yaml as directed and the build of stack-run-0.1.1.4 fails though it fails slightly differently in OSX vs Win10. Suggestions? Can I provide more detailed info?

StevePoling avatar Jul 05 '18 20:07 StevePoling

I also had this error. Once allowing newer versions I was met with the following error:

/tmp/stack28325/stack-run-0.1.1.4/src/Main.hs:18:1: error:
    Could not find module ‘Distribution.PackageDescription.Parse’
    Perhaps you meant
      Distribution.PackageDescription.Parsec (from Cabal-2.2.0.1)
      Distribution.PackageDescription.Check (from Cabal-2.2.0.1)
      Distribution.PackageDescription.Quirks (from Cabal-2.2.0.1)
    Use -v to see a list of the files searched for.
   |
18 | import           Distribution.PackageDescription.Parse
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Edit: I'm running Linux Ubuntu

fleverest avatar Jul 21 '18 06:07 fleverest

Same problem on windows 10x64. Would be nice if this is fixed, it's been around for a while.

Aphexus avatar Aug 27 '18 04:08 Aphexus

Getting the exact same issue on a fresh install of Ubuntu 18.04.1!

Herbstein avatar Aug 28 '18 09:08 Herbstein

I have the same problem when running stack install stack-run on Win10. After adding tons of extra-deps I was eventually left with the same error:

Could not find module ‘Distribution.PackageDescription.Parse’

bert2 avatar Sep 05 '18 19:09 bert2

Same here on Ubuntu

mrkaspa avatar Sep 06 '18 04:09 mrkaspa

I have the same problem when running stack install stack-run on Win10. After adding tons of extra-deps I was eventually left with the same error:

Could not find module ‘Distribution.PackageDescription.Parse’

Getting this same issue, also on Win10

extra-deps:
  - conduit-1.2.13.1
  - conduit-extra-1.1.17
  - resourcet-1.1.11
  - streaming-commons-0.1.19

adrianord avatar Sep 12 '18 01:09 adrianord

Has anyone found a workaround for this issue?

Hughlav avatar Sep 13 '18 12:09 Hughlav

Missing deps are easy to fix. But Could not find module ‘Distribution.PackageDescription.Parse’ is killing me.

Magicloud avatar Sep 17 '18 07:09 Magicloud

I found a workaround.

Create a file: ~/.stack/global-project/stack-cabal-1.24.yaml

flags: {}
extra-package-dbs: []
packages: []
extra-deps: []
resolver: lts-8.24

Basically it's using an old stack lts that was from around the time the last update to stack-run was made.

Then just run this:

stack --stack-yaml ~/.stack/global-project/stack-cabal-1.24.yaml install stack-run

and it should work (did for me, at least)

XertroV avatar Oct 06 '18 04:10 XertroV

Can confirm that this works for me on Ubuntu 18.04.1!

Herbstein avatar Oct 07 '18 11:10 Herbstein

This seems to install GHC 8.0.2 although 8.4.3 is already present. Which version will the installed stack-run use?

bert2 avatar Oct 07 '18 12:10 bert2

Afaik the problem is that the stack-run version doesn't work with the newest GHC version, so this forces the version used for installation. The runtime-semantics of stack-run should be indentical - specially because the functionality is fairly simple.

Herbstein avatar Oct 07 '18 13:10 Herbstein

This is still an issue. With a fresh install of stack on a mac.

poglesbyg avatar Feb 26 '19 13:02 poglesbyg

Please check if pull request #22 fixes your problem.

Magicloud avatar Feb 26 '19 15:02 Magicloud

Still an issue with latest haskell platform. @Magicloud , if you can help with instructions on how to use that pull request when running those commands, happy to check.

ashvds avatar Jul 25 '19 06:07 ashvds

@ashvds Hi, you can pull it from the source and build. https://github.com/Magicloud/stack-run

Magicloud avatar Jul 29 '19 07:07 Magicloud

@Magicloud , my understanding from further googling is that stack-run has been deprecated, in favour of the stack command run i.e. "stack run" which is supposed to do the same. Do you concur?

ashvds avatar Jul 30 '19 01:07 ashvds

@ashvds Yes, there is a new run command.

Magicloud avatar Jul 30 '19 09:07 Magicloud

@Magicloud @StevePoling , then wouldn't the solution to this issue just be to close it and use the run command?

ashvds avatar Jul 31 '19 00:07 ashvds

@ashvds I guess so. Just did not pay attention on this.

Magicloud avatar Jul 31 '19 06:07 Magicloud

@XertroV You save my evening I was in verge to give up :D

Akanoa avatar Aug 08 '19 17:08 Akanoa

@Akanoa , don't waste time trying to make stack-run work when stack run does the same and works out of the box.

ashvds avatar Aug 09 '19 01:08 ashvds

@ashvds Oh :O I didn't read the bottom of the thread ^^' I manage to run my first main.hs yesterday so I'm happy. But how can I undo the previous installation with stack install intero QuickCheck stack-run? The uninstall parameter seems to do nothing and the ghc-pkg command doesn't exist ( cf: https://stackoverflow.com/a/38639959 )

Akanoa avatar Aug 09 '19 07:08 Akanoa

@Akanoa , I would remove the dependencies on old libs that you set in the below, and run stack update, and then stack install intero QuickCheck

It should rebuild everything with the latest dependencies and resolver.

I found a workaround.

Create a file: ~/.stack/global-project/stack-cabal-1.24.yaml

flags: {}
extra-package-dbs: []
packages: []
extra-deps: []
resolver: lts-8.24

Basically it's using an old stack lts that was from around the time the last update to stack-run was made.

Then just run this:

stack --stack-yaml ~/.stack/global-project/stack-cabal-1.24.yaml install stack-run

and it should work (did for me, at least)

ashvds avatar Aug 12 '19 01:08 ashvds

You no longer need to install stack-run. Haskelly no longer actually depends on it, but instead uses the built in stack run, as evidenced here: https://github.com/haskelly-dev/Haskelly/blob/597a8e9408701791e05c00819db0f4d0e9cc8caa/src/Basic/commands.ts#L59

detuur avatar Aug 17 '19 21:08 detuur

@detuur , It is a simply a doco problem, there is a pull request to fix it.

ashvds avatar Aug 19 '19 01:08 ashvds