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

Bring back sandboxes #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Bring back sandboxes #3

wants to merge 1 commit into from

Conversation

hasufell
Copy link
Owner

No description provided.

@@ -339,7 +340,8 @@ mainWorker args = do
CommandHelp help -> printGlobalHelp help
CommandList opts -> printOptionsList opts
CommandErrors errs -> printErrors errs
CommandReadyToGo (globalFlags, commandParse) ->
CommandReadyToGo (globalFlags', commandParse) -> do
globalFlags <- CmdSandbox.updateGlobalFlags Nothing globalFlags'
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we inject the --store-dir=foo thing for all commands.

Comment on lines +747 to +753
isSandbox <- Sandbox.isSandbox Nothing
let merged = savedClientInstallFlags savedConfig `mappend` existingClientInstallFlags
if isSandbox
then do
cwd <- getCurrentDirectory
pure $ merged { cinstEnvironmentPath = Flag cwd }
else pure $ merged
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we check during cabal install whether we're in a sanbdox and if so pass the --package-env=. flag, creating a ghc environment file.

It seems the env file already acts as a "world file"... it will (except for base) only contain the targets we specified via cabal install --lib. So I'm not sure it's necessary to play tricks with recreation of the env file to allow new resolutions.

Instead, I think it is reasonable to have users specify multiple targets to avoid resolution issues, such as cabal install --lib text attoparsec.

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