commercialhaskell / commercialhaskell/stack
sdist hooks are ignored when running stack sdist
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
The `preSDist`, `sDistHook`, `postSDist` hooks aren't run when I run `stack sdist`.
To reproduce:
- `stack new presdist`
- Set `build-type: Custom` in `presdist.cabal`
- Put this in `Setup.hs`:
``` Haskell
import Distribution.Simple
main = defaultMainWithHooks $ simpleUserHooks
{ preSDist = \a b -> putStrLn "preSDist" >> preSDist simpleUserHooks a b,
sDistHook = \a b c d -> putStrLn "sdisthook" >> sDistHook simpleUserHooks a b c d,
postSDist = \a b c d -> putStrLn "postSDist" >> postSDist simpleUserHooks a b c d}
```
- `stack sdist -v`
Output [here](https://gist.github.com/enolan/4fed3cc8abd2e424abb5f7a9cf512e1d). Expected behavior is to print "preSDist", "sdisthook" and "postSDist" in order before exiting. It doesn't print any of them. Here's `cabal-install`'s output.
```
$ cabal sdist
[1 of 1] Compiling Main ( dist/setup/setup.hs, dist/setup/Main.o )
Linking ./dist/setup/setup ...
preSDist
sdisthook
Warning: Cannot run preprocessors. Run 'configure' command first.
Building source dist for presdist-0.1.0.0...
postSDist
Source tarball created: dist/presdist-0.1.0.0.tar.gz
```
### Stack version
```
$ stack --version
Version 1.2.0, Git revision 241cd07d576d9c0c0e712e83d947e3dd64541c42 (4054 commits) x86_64 hpack-0.14.0
```
### Method of installation
FPComplete Ubuntu package.
Contributor guide
Assessment
This issue has not been assessed yet.