commercialhaskell / commercialhaskell/stack

stack build does unnecessary rebuild if more than one stack file

Open
#4,883 9 comments 0 reactions 0 assignees View on GitHub
component: build further investigation required
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

### General summary/comments (optional)

Performing `stack build` twice in a row should be a noop the second time.

See also https://github.com/haskell/haskell-ide-engine/issues/1289#issuecomment-503025524

### Steps to reproduce

```bash
$ git clone https://github.com/haskell/haskell-ide-engine.git
$ cd haskell-ide-engine
$ git submodule update --init --recursive
$ stack --stack-yaml=stack-8.6.5.yaml build
```
A build happens, which (eventually) finishes

```bash
$ stack --stack-yaml=stack-8.6.5.yaml build
$ stack --stack-yaml=stack-8.6.5.yaml build
$
```
No further build activity takes place.

Now build for GHC 8.6.4

```bash
$ stack --stack-yaml=stack-8.6.4.yaml build
```

The build eventually ends

Invoke the build again

```bash
$ stack --stack-yaml=stack-8.6.4.yaml build
```

### Expected

The build is idempotent, i.e. no-ops the second and subsequent times, with each separate `stack-xxx.yaml`.

### Actual

It rebuilds the submodules

And oddly enough, doing

```
$ stack --stack-yaml=stack-8.6.4.yaml bulld --verbose
```
generates a lot of output, but does not rebuild anything.

### Stack version

```
$ stack --version
Version 2.1.1, Git revision f612ea85316bbc327a64e4ad8d9f0b150dc12d4b (7648 commits) x86_64 hpack-0.31.2
```

### Method of installation

* Official binary, downloaded from stackage.org or fpcomplete's package repository, then `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.