Skip to content

Commit

Permalink
Disable nix integration when run in windows #3600
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Jan 31, 2018
1 parent a08ecad commit 415c798
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Other enhancements:
See [#3716](https://github.com/commercialhaskell/stack/issues/3716)
* Improve the error message when an `extra-dep` from a path or git reference can't be found
See [#3808](https://github.com/commercialhaskell/stack/pull/3808)
* Nix integration is now disabled on windows even if explicitly enabled,
since it isn't supported. See
[#3600](https://github.com/commercialhaskell/stack/issues/3600)

Bug fixes:
* 1.6.1 introduced a change that made some precompiled cache files use
Expand Down
14 changes: 11 additions & 3 deletions src/Stack/Config/Nix.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ module Stack.Config.Nix
import Stack.Prelude
import qualified Data.Text as T
import Distribution.System (OS (..))
import Stack.Constants
import Stack.Types.Version
import Stack.Types.Nix
import Stack.Types.Compiler
import Stack.Types.Runner

-- | Interprets NixOptsMonoid options.
nixOptsFromMonoid
:: MonadUnliftIO m
:: HasRunner env
=> NixOptsMonoid
-> OS
-> m NixOpts
-> RIO env NixOpts
nixOptsFromMonoid NixOptsMonoid{..} os = do
let nixEnable = fromFirst False nixMonoidEnable
let nixEnable0 = fromFirst False nixMonoidEnable
defaultPure = case os of
OSX -> False
_ -> True
Expand All @@ -32,6 +34,12 @@ nixOptsFromMonoid NixOptsMonoid{..} os = do
nixShellOptions = fromFirst [] nixMonoidShellOptions
++ prefixAll (T.pack "-I") (fromFirst [] nixMonoidPath)
nixAddGCRoots = fromFirst False nixMonoidAddGCRoots
nixEnable <-
if nixEnable0 && osIsWindows
then do
logInfo "Note: Disabling nix integration, since this is being run in Windows"
return False
else return nixEnable0
when (not (null nixPackages) && isJust nixInitFile) $
throwIO NixCannotUseShellFileAndPackagesException
return NixOpts{..}
Expand Down

0 comments on commit 415c798

Please sign in to comment.