commercialhaskell / commercialhaskell/stack

stack doesn't rebuild internal build-tool-depends

Open
#5,342 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

### General summary/comments (optional)

The `dhall-lsp-server` package has an integration test suite with a registered dependency on an executable of the same package

```
build-tool-depends: dhall-lsp-server:dhall-lsp-server
```

[Documentation for `build-tool-depends`](https://cabal.readthedocs.io/en/stable/developing-packages.html?highlight=build-tool-depends#pkg-field-build-tool-depends)

`stack test` should ensure that this executable is up-to-date before running the testsuite, but it doesn't.

As a workaround one can specify the executable as a target with `stack test my-package:my-exe my-package:testsuite`.

### Steps to reproduce

```
$ git clone https://github.com/sjakobi/dhall-haskell
$ cd dhall-haskell
$ git checkout sjakobi/dhall-lsp-server-build-tool-depends
$ stack test dhall-lsp-server:tests
$ echo bla >> dhall-lsp-server/app/Main.hs # Break the executable
$ stack test dhall-lsp-server:tests
```

### Expected

`stack test` fails while re-building the executable

### Actual

`stack test` doesn't re-build the executable, and runs the test suite with an outdated executable version.

### Stack version

```
$ stack --version
Version 2.3.1, Git revision de2a7b694f07de7e6cf17f8c92338c16286b2878 (8103 commits) x86_64 hpack-0.33.0
```

### Method of installation

`stack upgrade`

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.