commercialhaskell / commercialhaskell/stack

Stack gives an UnlistedModule warning for modules added via cabal hooks

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

Description

I have a custom Setup.hs which uses cabal hooks to add extra generated modules into cabal's package description. Between build and copy steps message ""Warning: modules not listed in foo.cabal for library component (add to other-modules)" appears, generated by stack (I believe).

Steps to reproduce:
1. clone https://github.com/rblaze/cabal-hooks-sample.git
2. run "env PATH=.:$PATH stack build"

Expected: library built cleanly
Actual: there is warning about unlisted modules, Foo.First and Foo.Second

$ stack --version
Version 1.0.4, Git revision cf18703b1392a96a5a4896a560309e501af63260 (3220 commits) x86_64

$ env PATH=.:$PATH stack build
foo-0.1.0.0: configure
[1 of 1] Compiling Main ( /tmp/cabal-hooks-sample/Setup.hs, /tmp/cabal-hooks-sample/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/Main.o )
Linking /tmp/cabal-hooks-sample/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/setup ...
Configuring foo-0.1.0.0...
foo-0.1.0.0: build
"build hook"
Preprocessing library foo-0.1.0.0...
[1 of 3] Compiling Foo.Second ( .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/autogen/Foo/Second.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Foo/Second.o )
[2 of 3] Compiling Foo.First ( .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/autogen/Foo/First.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Foo/First.o )
[3 of 3] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Lib.o )
In-place registering foo-0.1.0.0...
"build finished"
Warning: modules not listed in foo.cabal for library component (add to other-modules):
Foo.First
Foo.Second
foo-0.1.0.0: copy/register
"copy hook"
Installing library in
/tmp/cabal-hooks-sample/.stack-work/install/x86_64-linux/lts-5.5/7.10.3/lib/x86_64-linux-ghc-7.10.3/foo-0.1.0.0-6bylsnNRJPuHxByS3dKqs5
"copy finished"
"reg hook"
Registering foo-0.1.0.0...
"reg finished"

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.