8

Creating a fresh haskell-stack project fails to find the project-exec executable, despite searching the appropriate path. I'm not sure why. In particular,

stack build creates the project-exec inside $PROJECT_DIR/.stack-work/install/x86_64-linux-ncurses6/.../bin/project-exe

However, stack exec project-exec fails with:

Executable named rse8-exec not found on path: ["$PROJECT_DIR/.stack-work/install/x86_64-linux-ncurses6/lts-7.14/8.0.1/bin", ]

(to clarify, $PROJECT_DIR references and ... are (hopefully) obvious placeholders for paths. the actual error contains the full path)

clo_jur
  • 1,359
  • 1
  • 11
  • 27
  • Does the file have executable permissions? – jberryman Dec 29 '16 at 21:06
  • @jberryman yes it does. :( – clo_jur Dec 29 '16 at 21:55
  • Hmm I have seen this same issue just now too on a fresh ubuntu VM install. `stack exec mytest` gives Executable named mytest not found on path: [...] but `stack exec .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/mytest-exe/mytest-exe` runs the executable fine. Also I seemed to have no trouble with running 'stack exec simpletest' stack build of a project created with `stack new simpletest simple`. I am new to stack so not sure if I am doing something obviously wrong. – Jamin Apr 27 '17 at 01:43

2 Answers2

11

Apologies for the lack of attention showed here. This question should probably just be deleted.

Stack creates a file named <project>-exe not <project>-exec.

clo_jur
  • 1,359
  • 1
  • 11
  • 27
1

Stack replaces dashes - with underscores _. Try stack exec project_exec see if it works.

This should have been a comment actually, but I don't have enough reputation to write a comment, while I have enough to post an answer!

Hapal
  • 135
  • 5
  • Unfortunately, this doesn't work. If I call `stack exec full/path/to/bin/project-exec` it works. This is a bit frustrating. It was working yesterday. I'm not sure what changed :/ – clo_jur Dec 30 '16 at 05:48