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

Stackage.Environment #2

Closed
chrisdone opened this issue May 5, 2015 · 5 comments
Closed

Stackage.Environment #2

chrisdone opened this issue May 5, 2015 · 5 comments

Comments

@chrisdone
Copy link
Member

We'll need some functionality for determining the right environment variables based on the configuration. Making this issue to track any discussion needed.

-- | Handling of environment variables, such as the PATH,
-- GHC_PACKAGE_SANDBOX, etc.
module Stackage.Environment where
getEnvironmentVariables :: (MonadLogger m,MonadIO m,MonadThrow m)
                        => Config -> m (Map Text Text)
getPATH :: (MonadLogger m,MonadIO m,MonadThrow m)
        => Config -> m Text
withConfiguredEnvironment :: (MonadLogger m,MonadIO m,MonadThrow m)
                          => Config -> (m a -> m a) -> m a
@snoyberg
Copy link
Contributor

snoyberg commented May 5, 2015

One point along the lines of GHC_PACKAGE_SANDBOX: cabal (IMO quite mistakenly) refuses to work if that variable is set. What would make more sense would be to instead parse the variable and pass the appropriate values to GHC. Perhaps that's something we should be fixing here to make our tooling more composable: if that environment variable is set, do the parsing and update the package databases, and automatically strip that environment variable when calling the Cabal library. This way, it would be possible, for example, to run stackage build from inside a stackage shell.

@chrisdone
Copy link
Member Author

due the parsing

:trollface:

I must've re-read that sentence about 5 times. This approach makes sense to me.

@snoyberg
Copy link
Contributor

snoyberg commented May 5, 2015

Doh, edited.

@snoyberg
Copy link
Contributor

@chrisdone This can be closed based on conversations today, correct?

@chrisdone
Copy link
Member Author

Yep.

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