haskell / haskell/cabal

Cabal cannot upload hs-source-dirs that only have autogen-modules

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

Description

**Describe the bug**

If a Cabal package has a source directory listed in `hs-source-dirs` that only contains `autogen-modules` then the package cannot be uploaded without a workaround. Specifically: `cabal sdist` will omit the entire source directory when creating the sdist and then `cabal upload` and/or Hackage rejects the package because the sdist is missing the source directory listed in `hs-source-dirs`.

**To Reproduce**

Steps to reproduce the behavior:

```bash
$ cat > autogen-issue.cabal <=1.10

library
build-depends: base >=4.13 && <4.14
hs-source-dirs: src
other-modules: Example
autogen-modules: Example
default-language: Haskell2010
EOF

$ mkdir src

$ cat > ./src/Example.hs <

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.