<div dir="ltr">Hi, <div><br></div><div style>I have a library that has some modules written as .hsc files and I want to include some executables that use those modules. Cabal doesn&#39;t seem to find the modules when it is building the executable. It complains that the module used by the executable is in a hidden package (of the same name as the package being built). Adding the package as a dependency in the executable section doesn&#39;t work since it references a library defined in the same package.  Is this a bug?   I&#39;ve attached three files illustrating the problem. A.hsc is a tiny module in the library, B.hs is the executable that uses A, foo.cabal defines both the library and the executable. I am using </div>
<div><br></div><div>$ cabal --version</div><div>cabal-install version 1.16.0.2</div><div style>using version 1.16.0.3 of the Cabal library </div><div style><br></div><div style>and when I run &quot;cabal install -v&quot; I get</div>
<div style><br></div><div style><div>$ cabal install --disable-library-profiling </div><div>Resolving dependencies...</div><div>Configuring foo-1.0...</div><div>Building foo-1.0...</div><div>Preprocessing library foo-1.0...</div>
<div>[1 of 1] Compiling A                ( dist/build/A.hs, dist/build/A.o )</div><div>In-place registering foo-1.0...</div><div>Preprocessing executable &#39;B&#39; for foo-1.0...</div><div><br></div><div>B.hs:3:8:</div>
<div>    Could not find module `A&#39;</div><div>    It is a member of the hidden package `foo-1.0&#39;.</div><div>    Perhaps you need to add `foo&#39; to the build-depends in your .cabal file.</div><div>    Use -v to see a list of the files searched for.</div>
<div>Failed to install foo-1.0</div><div>cabal: Error: some packages failed to install:</div><div>foo-1.0 failed during the building phase. The exception was:</div><div>ExitFailure 1</div></div></div>