commercialhaskell / commercialhaskell/stack

Changing cc-options does not recompile files

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

Description

### Steps to reproduce

Put into your `.cabal` file:

```
c-sources: myfile.c
cc-options: -DSOMETHING
```

then `stack build`; change `-DSOMETHING` to `-DSOMETHING -garbage` and run `stack build` again.

### Expected

Stack should recompile the `.c` file, and the illegal option `-garbage` should make compilation fail.

### Actual

`stack build` does not recompile the C file with the new flags and so no error occurs.

### Stack version

```
$ stack --version
2.1.3.1 x86_64 hpack-0.32.0
```

---

I have not investigated yet whether this happens with the plain `Cabal` library or `cabal-install`.

---

Repro'd by @lehins

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.