Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set HASKELL_PACKAGE_SANDBOX environment variable #76

Open
snoyberg opened this issue Dec 2, 2012 · 7 comments
Open

Set HASKELL_PACKAGE_SANDBOX environment variable #76

snoyberg opened this issue Dec 2, 2012 · 7 comments

Comments

@snoyberg
Copy link

snoyberg commented Dec 2, 2012

This is related to a few other issues in other projects: commercialhaskell/stackage#3 sol/doctest#39 faylang/fay#174

There are some packages which make use of the package database themselves. Fay calls GHC for type checking, doctest calls it to test code snippets, and there are likely others. This works fine when using the standard user package database, but when using a sandbox such as created by cabal-dev, this no longer works.

The solution we came up with for Stackage was to set a HASKELL_PACKAGE_SANDBOX environment variable. doctest now recognizes it, and in theory Fay can do so as well. I think it would make sense for cabal-dev to set this variable as well.

Note that this is similar to GHC_PACKAGE_PATH, but works around the fact that cabal-install will not allow that variable to be set.

Pinging @sol @chrisdone and @jwiegley who have each been affected by this somehow.

@jwiegley
Copy link

jwiegley commented Dec 2, 2012

Michael Snoyman notifications@github.com writes:

Pinging @sol @chrisdone and @jwiegley who have each been affected by this
somehow.

I updated and ran the build again, but I'm still seeing that same test failure in
conduit:

--8<---------------cut here---------------start------------->8---
Data/Conduit.hs:79:8:
Could not find module `Data.Void'
Perhaps you meant
Data.Word (from base)
Data.Word (needs flag -package haskell2010-1.1.0.1)
Use -v to see a list of the files searched for.
Test suite doctests: FAIL
--8<---------------cut here---------------end--------------->8---

John Wiegley
FP Complete Haskell tools, training and consulting
http://fpcomplete.com johnw on #haskell/irc.freenode.net

@snoyberg
Copy link
Author

snoyberg commented Dec 2, 2012

It's because the new doctest isn't on Hackage.

@sol
Copy link
Contributor

sol commented Dec 2, 2012

There are some issues that I have to resolve. I'm working on it, sorry for the delay.

@sol
Copy link
Contributor

sol commented Dec 2, 2012

doctest-0.9.4 has support for HASKELL_PACKAGE_SANDBOX.

@sol
Copy link
Contributor

sol commented Dec 4, 2012

Would it make sense to set GHC_PACKAGE_PATH before running the tests, instead?

Similar to commercialhaskell/stackage@2534579.

@snoyberg
Copy link
Author

snoyberg commented Dec 4, 2012

That change would probably have to take place in cabal-install instead, as I think it calls all of the tests itself.

@sol
Copy link
Contributor

sol commented Dec 4, 2012

@snoyberg Ah ok, I see what you mean. cabal-dev does not wrap the commands individually, so there is currently no easy way to tell whether it's cabal-dev test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants