commercialhaskell / commercialhaskell/stack

Recompilation checking issue with multiple packages, --fast and TH

Open
#6,248 22 comments 0 reactions 0 assignees View on GitHub
component: build resolution: upstream issue
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

### Summary

We noticed that some of our tests that used TH were sometimes not recompiling with stack. This led to stale test results.

I've managed to extract the following reproducer.

NB: this is reproducible with GHC 9.2.8 so it's not related to the recompilation changes in 9.4.

### Steps to reproduce

Clone this repository https://github.com/TeofilC/stack-recomp-checking-issue.

Then run `./repro.sh`

This does the following:
1. Build everything
2. Edits a file
3. Only rebuilds the package that file belongs to
4. Then tries to build the dependent package, which doesn't recompile <- the bug

### Expected

I would expect the file to recompile even with --fast and cabal-install does this correctly, so it seems like this is a bug in stack rather than GHC/Cabal.
### Actual

The file doesn't recompile.

I couldn't attach the verbose log as its too long, but should be easy to generate from the reproducer.

### Stack version

~~~text
stack --version
2.11.1 x86_64 hpack-0.35.2
~~~

### Method of installation

nix

### Platform

WSL2 x86_64

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.