Skip to content

Commit

Permalink
Add the --skip-msys flag #377
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Jul 2, 2015
1 parent 985eb18 commit a08da83
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* stack can act as a script interpreter (see [Script interpreter] (https://github.com/commercialhaskell/stack/wiki/Script-interpreter) and [Reddit discussion](http://www.reddit.com/r/haskell/comments/3bd66h/stack_runghc_turtle_as_haskell_script_solution/))
* Add the __`--file-watch`__ flag to auto-rebuild on file changes [#113](https://github.com/commercialhaskell/stack/issues/113)
* Rename `stack docker exec` to `stack exec --plain`
* Add the `--skip-msys` flag [#377](https://github.com/commercialhaskell/stack/issues/377)

## 0.1.1.0

Expand Down
8 changes: 7 additions & 1 deletion src/Stack/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ configFromConfigMonoid configStackRoot mproject configMonoid@ConfigMonoid{..} =
configSystemGHC = fromMaybe True configMonoidSystemGHC
configInstallGHC = fromMaybe False configMonoidInstallGHC
configSkipGHCCheck = fromMaybe False configMonoidSkipGHCCheck
configSkipMsys = fromMaybe False configMonoidSkipMsys

configExtraIncludeDirs = configMonoidExtraIncludeDirs
configExtraLibDirs = configMonoidExtraLibDirs
Expand Down Expand Up @@ -159,7 +160,7 @@ configFromConfigMonoid configStackRoot mproject configMonoid@ConfigMonoid{..} =
-- | Command-line arguments parser for configuration.
configOptsParser :: Bool -> Parser ConfigMonoid
configOptsParser docker =
(\opts systemGHC installGHC arch os jobs includes libs skipGHCCheck -> mempty
(\opts systemGHC installGHC arch os jobs includes libs skipGHCCheck skipMsys -> mempty
{ configMonoidDockerOpts = opts
, configMonoidSystemGHC = systemGHC
, configMonoidInstallGHC = installGHC
Expand All @@ -169,6 +170,7 @@ configOptsParser docker =
, configMonoidJobs = jobs
, configMonoidExtraIncludeDirs = includes
, configMonoidExtraLibDirs = libs
, configMonoidSkipMsys = skipMsys
})
<$> Docker.dockerOptsParser docker
<*> maybeBoolFlags
Expand Down Expand Up @@ -209,6 +211,10 @@ configOptsParser docker =
"skip-ghc-check"
"skipping the GHC version and architecture check"
idm
<*> maybeBoolFlags
"skip-msys"
"skipping the local MSYS installation (Windows only)"
idm

-- | Get the directory on Windows where we should install extra programs. For
-- more information, see discussion at:
Expand Down
10 changes: 7 additions & 3 deletions src/Stack/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ data SetupOpts = SetupOpts
-- ^ Run a sanity check on the selected GHC
, soptsSkipGhcCheck :: !Bool
-- ^ Don't check for a compatible GHC version/architecture
, soptsSkipMsys :: !Bool
-- ^ Do not use a custom msys installation on Windows
}
deriving Show
data SetupException = UnsupportedSetupCombo OS Arch
Expand Down Expand Up @@ -125,6 +127,7 @@ setupEnv = do
, soptsForceReinstall = False
, soptsSanityCheck = False
, soptsSkipGhcCheck = configSkipGHCCheck $ bcConfig bconfig
, soptsSkipMsys = configSkipMsys $ bcConfig bconfig
}
mghcBin <- ensureGHC sopts
menv0 <- getMinimalEnvOverride
Expand Down Expand Up @@ -262,9 +265,10 @@ ensureGHC sopts = do
let tools =
case configPlatform config of
Platform _ Windows ->
[ ($(mkPackageName "ghc"), Just expected)
, ($(mkPackageName "git"), Nothing)
]
($(mkPackageName "ghc"), Just expected)
: (if soptsSkipMsys sopts
then []
else [($(mkPackageName "git"), Nothing)])
_ ->
[ ($(mkPackageName "ghc"), Just expected)
]
Expand Down
7 changes: 7 additions & 0 deletions src/Stack/Types/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ data Config =
-- version is available? Can be overridden by command line options.
,configSkipGHCCheck :: !Bool
-- ^ Don't bother checking the GHC version or architecture.
,configSkipMsys :: !Bool
-- ^ On Windows: don't use a locally installed MSYS
,configLocalBin :: !(Path Abs Dir)
-- ^ Directory we should install executables into
,configRequireStackVersion :: !VersionRange
Expand Down Expand Up @@ -416,6 +418,8 @@ data ConfigMonoid =
-- ^ See: 'configInstallGHC'
,configMonoidSkipGHCCheck :: !(Maybe Bool)
-- ^ See: 'configSkipGHCCheck'
,configMonoidSkipMsys :: !(Maybe Bool)
-- ^ See: 'configSkipMsys'
,configMonoidRequireStackVersion :: !VersionRange
-- ^ See: 'configRequireStackVersion'
,configMonoidOS :: !(Maybe String)
Expand All @@ -441,6 +445,7 @@ instance Monoid ConfigMonoid where
, configMonoidSystemGHC = Nothing
, configMonoidInstallGHC = Nothing
, configMonoidSkipGHCCheck = Nothing
, configMonoidSkipMsys = Nothing
, configMonoidRequireStackVersion = anyVersion
, configMonoidOS = Nothing
, configMonoidArch = Nothing
Expand All @@ -457,6 +462,7 @@ instance Monoid ConfigMonoid where
, configMonoidSystemGHC = configMonoidSystemGHC l <|> configMonoidSystemGHC r
, configMonoidInstallGHC = configMonoidInstallGHC l <|> configMonoidInstallGHC r
, configMonoidSkipGHCCheck = configMonoidSkipGHCCheck l <|> configMonoidSkipGHCCheck r
, configMonoidSkipMsys = configMonoidSkipMsys l <|> configMonoidSkipMsys r
, configMonoidRequireStackVersion = intersectVersionRanges (configMonoidRequireStackVersion l)
(configMonoidRequireStackVersion r)
, configMonoidOS = configMonoidOS l <|> configMonoidOS r
Expand All @@ -478,6 +484,7 @@ instance FromJSON ConfigMonoid where
configMonoidSystemGHC <- obj .:? "system-ghc"
configMonoidInstallGHC <- obj .:? "install-ghc"
configMonoidSkipGHCCheck <- obj .:? "skip-ghc-check"
configMonoidSkipMsys <- obj .:? "skip-msys"
configMonoidRequireStackVersion <- unVersionRangeJSON <$>
obj .:? "require-stack-version"
.!= VersionRangeJSON anyVersion
Expand Down
1 change: 1 addition & 0 deletions src/main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ setupCmd SetupCmdOpts{..} go@GlobalOpts{..} = do
, soptsForceReinstall = scoForceReinstall
, soptsSanityCheck = True
, soptsSkipGhcCheck = False
, soptsSkipMsys = configSkipMsys $ lcConfig lc
}
case mpaths of
Nothing -> $logInfo "GHC on PATH would be used"
Expand Down

0 comments on commit a08da83

Please sign in to comment.