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

Self-executing scripts don't pipe plan construction errors from runhaskell to terminal #3942

adlaika opened this issue Mar 23, 2018 · 1 comment


Copy link

adlaika commented Mar 23, 2018

General summary/comments

Self-executing scripts don't pipe plan construction errors from runhaskell to terminal.

Steps to reproduce

Given a stack.yaml that uses a package that relies on another package from extra-deps:

resolver: lts-8.22

- location:
    commit: c7068f25c41bcc0b4bdfc9b38ee5b05b5caefae5
  extra-dep: true

- optparse-applicative-

flags: {}

extra-package-dbs: []

...and a self-executing script that references that package, called script.hs:

#!/usr/bin/env stack
-- stack runhaskell --package cloud-seeder

main :: IO ()
main = putStrLn "yo"


With the - optparse-applicative- line in place, running gives the expected result:

$ ./script
$ stack runhaskell --package cloud-seeder ./script.hs


However, if we remove - optparse-applicative-, only the direct call to runhaskell returns useful error information:

$ ./script
Plan construction failed.
$ stack runhaskell --package cloud-seeder ./script.hs

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

In the dependencies for cloud-seeder-
    optparse-applicative- from stack configuration does not match >= (latest matching version is
needed since cloud-seeder is a build target.

Some potential ways to resolve this:

  * Recommended action: try adding the following to your extra-deps in /Users/marnold/Code/lambda/runhaskell-test/stack.yaml:

- optparse-applicative-

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

  * You may also want to try using the 'stack solver' command.

Plan construction failed.

Stack version

$ stack --version
Version 1.6.5, Git revision 24ab0d6ff07f28276e082c3ce74dfdeb1a2ca9e9 (5514 commits) x86_64 hpack-0.20.0

Method of installation

  • Official binary, downloaded from or fpcomplete's package repository
Copy link

#4114 addresses this

isovector added a commit that referenced this issue Jun 24, 2018
Fixes self-executing scripts not piping plan construction errors from runhaskell to terminal, issue #3942
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

4 participants