Skip to content

Commit

Permalink
Merge pull request #495 from commercialhaskell/windowsintegersimple
Browse files Browse the repository at this point in the history
For windowsintegersimple resolve flags as if Windows OS
  • Loading branch information
snoyberg committed Jul 3, 2015
2 parents 1515ab1 + fe41c7b commit 897fd05
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Stack/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import qualified Data.Set as S
import qualified Data.Text as T
import Data.Text.Encoding (encodeUtf8, decodeUtf8)
import qualified Data.Yaml as Yaml
import Distribution.System (OS (Windows), Platform (..), buildPlatform)
import Distribution.System (OS (..), Platform (..), buildPlatform)
import qualified Distribution.Text
import Distribution.Version (simplifyVersionRange)
import Network.HTTP.Client.Conduit (HasHttpManager, getHttpManager, Manager, parseUrl)
Expand Down
4 changes: 2 additions & 2 deletions src/Stack/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import Distribution.Package hiding (Package,PackageName,packageName,pa
import Distribution.PackageDescription hiding (FlagName)
import Distribution.PackageDescription.Parse
import Distribution.Simple.Utils
import Distribution.System (OS, Arch, Platform (..))
import Distribution.System (OS (..), Arch, Platform (..))
import Distribution.Text (display)
import Distribution.Version (intersectVersionRanges)
import Path as FL
Expand Down Expand Up @@ -615,7 +615,7 @@ mkResolveConditions :: Version -- ^ GHC version
mkResolveConditions ghcVersion (Platform arch os) flags = ResolveConditions
{ rcFlags = flags
, rcGhcVersion = ghcVersion
, rcOS = os
, rcOS = if isWindows os then Windows else os
, rcArch = arch
}

Expand Down
5 changes: 0 additions & 5 deletions src/Stack/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,6 @@ stripTrailingSlashT t = fromMaybe t $ T.stripSuffix
(T.singleton FP.pathSeparator)
t

isWindows :: OS -> Bool
isWindows Windows = True
isWindows (OtherOS "windowsintegersimple") = True
isWindows _ = False

-- | Ensure GHC is installed and provide the PATHs to add if necessary
ensureGHC :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
=> SetupOpts
Expand Down
9 changes: 8 additions & 1 deletion src/Stack/Types/BuildPlan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module Stack.Types.BuildPlan
, MiniPackageInfo (..)
, renderSnapName
, parseSnapName
, isWindows
) where

import Control.Applicative
Expand Down Expand Up @@ -51,7 +52,7 @@ import Data.Time (Day)
import qualified Data.Traversable as T
import Data.Typeable (TypeRep, Typeable, typeOf)
import Data.Vector (Vector)
import Distribution.System (Arch, OS)
import Distribution.System (Arch, OS (..))
import qualified Distribution.Text as DT
import qualified Distribution.Version as C
import GHC.Generics (Generic)
Expand Down Expand Up @@ -386,3 +387,9 @@ data MiniPackageInfo = MiniPackageInfo
}
deriving (Generic, Show, Eq)
instance Binary.Binary MiniPackageInfo


isWindows :: OS -> Bool
isWindows Windows = True
isWindows (OtherOS "windowsintegersimple") = True
isWindows _ = False

0 comments on commit 897fd05

Please sign in to comment.