haskell / haskell/cabal

Haskell-only "headers" stil require C preprocessor

Open
#6,466 6 comments 1 reaction 0 assignees View on GitHub
blocked: ghc compiler: ghcjs type: user-question
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**

Some packages the `includes:` stanza just for CPP'ing Haskell, e.g. `bifunctors-5.5.5`. When compiling with GHCJS (or CLaSH) we might not want to not provide a C compiler, because C is non-trivial (or impossible) to compile for these platforms. However Cabal will want to use a C compiler to ensure the header exists.

**To Reproduce**
`cabal configure --with-gcc=false` `bifunctors-5.5.5`. Command fails with:
```
...
Setup: Missing dependency on a foreign library:
* Missing (or bad) header file: bifunctors-common.h
...
```

**Expected behavior**

If we wish to better support CPP for Haskell (and perhaps this is too jank and doesn't warrant it) I see two basic options options:

1. Use GHC if CC doesn't exist probe for headers and cross fingers.
2. In the Cabal file distinguish the language the included file is for.

1 is the quite quick and dirty, 2 is the quite overwrought. There might be decent designs between?

CC @angerman

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.