Skip to content

Bring back sandboxes - #3

Open
hasufell wants to merge 1 commit into
masterfrom
cabal-sandbox
Open

hasufell wants to merge 1 commit into
masterfrom
cabal-sandbox

Conversation

@hasufell

Copy link
Copy Markdown
Owner

No description provided.

CommandErrors errs -> printErrors errs
CommandReadyToGo (globalFlags, commandParse) ->
CommandReadyToGo (globalFlags', commandParse) -> do
globalFlags <- CmdSandbox.updateGlobalFlags Nothing globalFlags'

Copy link
Copy Markdown
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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

1 participant