commercialhaskell / commercialhaskell/stack

--file-watch and --exec with running server like command does not build again

Open
#4,153 6 comments 9 reactions 0 assignees View on GitHub
awaiting pull request component: build help wanted type: enhancement
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

### General summary

If you run any command via the `--exec` flag which does not exit (like a server), then `--file-watch` does not build again if the files changes.

I can understand why that is, and it is probably how the implementation is - but it is counter-intuitive.
Other dev tools (like gunicorn, go's reflex) works as expected. If a file changes, even with server like commands, it rebuilds/reloads and runs the commands again.

### Steps to reproduce
1.
```
stack build --fast --exec "sleep infinity" --file-watch
```
2. Change a file in the same project

### Expected

The build happens again, and the exec command is run again.

### Actual

Nothing happens. (Because the exec command never exited)

### Stack version

```
$ stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
```

### Method of installation

* Official binary, downloaded from stackage.org or fpcomplete's package repository

---
PS: There is an issue #2955 . But that is different than this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.