Build woes (cabal configure can't find sandboxed deps)

Hi list, I've got a number of modules in a project set up like this: project |-- foo |-- bar |-- baz `-- sandbox where 'foo', 'bar' and 'baz' are modules which depend on one another, and 'sandbox' is a sandbox. Before building from scratch, I do a $(cabal sandbox init --sandbox=../sandbox) in each of the module folders. If I run $(cabal install ./foo ./bar ./baz) from the projects/ directory, everything is happy. However, if I reconfigure one of the sub-modules with different flags, it fails with missing dependencies: # in foo/ $ cabal build Package has never been configured. Configuring with default flags. If this fails, please run configure manually. # module builds correctly $ cabal configure --enable-tests Resolving dependencies... Configuring foo-0.1... $ cabal build dist/setup/setup.hs:13:8: Could not find module ‘System.FilePath.Glob’ Perhaps you meant System.FilePath (from filepath-1.3.0.2) System.FilePath.Posix (from filepath-1.3.0.2) Use -v to see a list of the files searched for. Glob is installed in the sandbox. I've tried pointing to the sandbox config file manually with both $(cabal --sandbox-config-file=project/foo/cabal.sandbox.config) and $(cabal --sandbox-config-file=project/cabal.sandbox.config) with the same result. Cabal insists that Glob isn't installed until I nuke the foo/dist directory and start over. I figure there's some flag I need to pass to `cabal configure` that I'm missing, but I can't figure out what it is. Anybody have any hints? Cheers, Alex

Hmm, nuking ~/.cabal and ~/.ghc seems to have fixed it.
Good old cabal. When in doubt, delete everything.
On Mon, Feb 2, 2015 at 10:22 AM, Alex Hammel
Hi list,
I've got a number of modules in a project set up like this:
project |-- foo |-- bar |-- baz `-- sandbox
where 'foo', 'bar' and 'baz' are modules which depend on one another, and 'sandbox' is a sandbox. Before building from scratch, I do a $(cabal sandbox init --sandbox=../sandbox) in each of the module folders.
If I run $(cabal install ./foo ./bar ./baz) from the projects/ directory, everything is happy. However, if I reconfigure one of the sub-modules with different flags, it fails with missing dependencies:
# in foo/ $ cabal build Package has never been configured. Configuring with default flags. If this fails, please run configure manually. # module builds correctly
$ cabal configure --enable-tests Resolving dependencies... Configuring foo-0.1...
$ cabal build
dist/setup/setup.hs:13:8: Could not find module ‘System.FilePath.Glob’ Perhaps you meant System.FilePath (from filepath-1.3.0.2) System.FilePath.Posix (from filepath-1.3.0.2) Use -v to see a list of the files searched for.
Glob is installed in the sandbox.
I've tried pointing to the sandbox config file manually with both $(cabal --sandbox-config-file=project/foo/cabal.sandbox.config) and $(cabal --sandbox-config-file=project/cabal.sandbox.config) with the same result. Cabal insists that Glob isn't installed until I nuke the foo/dist directory and start over.
I figure there's some flag I need to pass to `cabal configure` that I'm missing, but I can't figure out what it is. Anybody have any hints?
Cheers, Alex

On Mon, Feb 2, 2015 at 3:40 PM, Alex Hammel
Hmm, nuking ~/.cabal and ~/.ghc seems to have fixed it. Good old cabal. When in doubt, delete everything.
That says to me you didn't have the sandbox set up right. I'd have set up the sandbox and then used --add-source for foo, bar, and baz... or, sometimes, symlink the original sandbox into those dirs, but I suspect that's asking for trouble :) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

That's exactly what I did. From my setup script:
cabal sandbox init --sandbox sandbox
for folder in $SUBMODULES; do
(cd "$folder"; cabal sandbox init --sandbox ../sandbox)
cabal sandbox add-source "$folder"
done
$SUBMODULES contains ./foo, ./bar, and ./baz
On Mon, Feb 2, 2015 at 12:44 PM, Brandon Allbery
On Mon, Feb 2, 2015 at 3:40 PM, Alex Hammel
wrote: Hmm, nuking ~/.cabal and ~/.ghc seems to have fixed it. Good old cabal. When in doubt, delete everything.
That says to me you didn't have the sandbox set up right. I'd have set up the sandbox and then used --add-source for foo, bar, and baz... or, sometimes, symlink the original sandbox into those dirs, but I suspect that's asking for trouble :)
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (2)
-
Alex Hammel
-
Brandon Allbery