haskell / haskell/cabal

C++ sources don't get rebuilt when flags change

Open
#7,232 0 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/build type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I have a package which fails to compile a C++ source when a flag is set. I can:

- observe this failing with `cabal build -fmy-flag`
- build successfully with `cabal build -f-my-flag`
- build successfully with `cabal build -fmy-flag`! This is quite surprising as it failed just before

The flag in this case controls a `cxx-options`: https://github.com/expipiplus1/vulkan/blob/2c79f7b6ee76ed82bd3175bea250a9cb3886bae3/VulkanMemoryAllocator/VulkanMemoryAllocator.cabal#L71-L72

This is a log of my interaction with cabal: https://gist.github.com/1ee3f2f7c1497ccec7f58311c22fe594

I would expect that everything listed in `cxx-sources` be recompiled when `cxx-options` changes.

```
❯ cabal --version && ghc --version
cabal-install version 3.2.0.0
compiled using version 3.2.1.0 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 8.10.3
```

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.