File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ library:
8383 - bytestring
8484 - Cabal
8585 - containers
86- - dhall >= 1.29.0
86+ - dhall >= 1.31.1
8787 - directory >= 1.3.4.0
8888 - either
8989 - exceptions
@@ -104,7 +104,7 @@ library:
104104 - prettyprinter
105105 - process
106106 - retry
107- - rio
107+ - rio >= 0.1.13.0
108108 - rio-orphans
109109 - safe
110110 - semver-range
Original file line number Diff line number Diff line change @@ -228,6 +228,9 @@ pretty = PrettyText.renderStrict
228228-- or die trying
229229findExecutableOrDie :: HasLogFunc env => String -> RIO env Text
230230findExecutableOrDie cmd = do
231- Directory. findExecutable cmd >>= \ case
231+ Directory. findExecutable cmd >>= \ case
232232 Nothing -> die [ " Executable was not found in path: " <> displayShow cmd ]
233- Just path -> pure $ Text. pack path
233+ -- Note: we ignore the path and just return the input because the one we get
234+ -- here is absolute, and Windows doesn't seem to be able to deal with that.
235+ -- See: https://github.com/purescript/spago/issues/635
236+ Just _path -> pure $ Text. pack cmd
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ module Spago.RunEnv where
33import Spago.Prelude
44import Spago.Env
55
6+ import qualified Data.Text as Text
67import qualified System.Environment as Env
78import qualified Distribution.System as OS
89import qualified Turtle
@@ -120,14 +121,13 @@ getPurs usePsa = do
120121 UsePsa -> findExecutable " psa" >>= \ case
121122 Just _ -> pure " psa"
122123 Nothing -> pure " purs"
123- try (findExecutableOrDie pursCandidate) >>= \ case
124- Right p -> pure p
125- -- one last try for Windows
126- Left (err :: SomeException ) -> case OS. buildOS of
127- OS. Windows -> do
128- logDebug $ displayShow err
129- findExecutableOrDie (pursCandidate <> " .cmd" )
130- _ -> throwIO err
124+ -- We first try this for Windows
125+ case OS. buildOS of
126+ OS. Windows -> do
127+ findExecutable (pursCandidate <> " .cmd" ) >>= \ case
128+ Just _ -> pure (Text. pack pursCandidate <> " .cmd" )
129+ Nothing -> findExecutableOrDie pursCandidate
130+ _ -> findExecutableOrDie pursCandidate
131131
132132getPackageSet :: (HasLogFunc env , HasConfigPath env ) => RIO env PackageSet
133133getPackageSet = do
You can’t perform that action at this time.
0 commit comments