yamadapc / stack-run

Like cabal run for stack
MIT License
29 stars 10 forks source link

stack install stack-run fails #17

Open StevePoling opened 6 years ago

StevePoling commented 6 years ago

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:

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:

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?

fleverest commented 6 years ago

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

Aphexus commented 6 years ago

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

Herbstein commented 6 years ago

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

bert2 commented 6 years ago

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’

mrkaspa commented 6 years ago

Same here on Ubuntu

adrianord commented 6 years ago

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
Hughlav commented 6 years ago

Has anyone found a workaround for this issue?

Magicloud commented 6 years ago

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

XertroV commented 6 years ago

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)

Herbstein commented 6 years ago

Can confirm that this works for me on Ubuntu 18.04.1!

bert2 commented 6 years ago

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

Herbstein commented 6 years ago

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.

poglesbyg commented 5 years ago

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

Magicloud commented 5 years ago

Please check if pull request #22 fixes your problem.

ashvds commented 5 years ago

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.

Magicloud commented 5 years ago

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

ashvds commented 5 years ago

@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?

Magicloud commented 5 years ago

@ashvds Yes, there is a new run command.

ashvds commented 5 years ago

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

Magicloud commented 5 years ago

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

Akanoa commented 5 years ago

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

ashvds commented 5 years ago

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

Akanoa commented 5 years ago

@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 )

ashvds commented 5 years ago

@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)

detuur commented 5 years ago

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

ashvds commented 5 years ago

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