From 09a8a0bda04d43260c70ac7b2a869ae64a14e751 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 10 Feb 2022 18:35:25 +0100 Subject: [PATCH] Fix build on windows and stack --- app/ghcup/GHCup/OptParse/Run.hs | 8 +++++--- ghcup.cabal | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/ghcup/GHCup/OptParse/Run.hs b/app/ghcup/GHCup/OptParse/Run.hs index 1b5b05d..8321fac 100644 --- a/app/ghcup/GHCup/OptParse/Run.hs +++ b/app/ghcup/GHCup/OptParse/Run.hs @@ -205,9 +205,11 @@ run RunOptions{..} runAppState runLogger = runRUN runAppState (do [] -> liftIO $ putStr tmp (cmd:args) -> do newEnv <- liftIO $ addToPath tmp - if isWindows - then liftE $ lEM @_ @'[ProcessError] $ exec cmd args Nothing (Just newEnv) - else liftIO $ SPP.executeFile cmd True args (Just newEnv) +#ifndef IS_WINDOWS + liftIO $ SPP.executeFile cmd True args (Just newEnv) +#else + liftE $ lEM @_ @'[ProcessError] $ exec cmd args Nothing (Just newEnv) +#endif pure () ) >>= \case VRight _ -> do diff --git a/ghcup.cabal b/ghcup.cabal index 46cb67d..fb75a02 100644 --- a/ghcup.cabal +++ b/ghcup.cabal @@ -267,6 +267,9 @@ executable ghcup if os(windows) cpp-options: -DIS_WINDOWS + else + build-depends: + , unix ^>=2.7 if flag(no-exe) buildable: False