@@ -41,12 +41,7 @@ import qualified Data.Text.Encoding as T
4141import Data.Time (UTCTime )
4242import qualified Data.Version (showVersion , parseVersion )
4343import Distribution.Version (mkVersion , mkVersion' )
44- #if MIN_VERSION_path(0,7,0)
45- import Path hiding (replaceExtension )
46- #else
4744import Path
48- #endif
49- import Path.Extended (replaceExtension )
5045import Path.Extra (toFilePathNoTrailingSep )
5146import Path.IO hiding (canonicalizePath )
5247import qualified Paths_stack as Meta
@@ -156,7 +151,17 @@ getCmdArgs docker imageInfo isRemoteDocker = do
156151 exePath <- ensureDockerStackExe dockerContainerPlatform
157152 cmdArgs args exePath
158153 cmdArgs args exePath = do
159- exeBase <- replaceExtension " " exePath
154+ -- MSS 2020-04-21 previously used replaceExtension, but semantics changed in path 0.7
155+ -- In any event, I'm not even sure _why_ we need to drop a file extension here
156+ -- Originally introduced here: https://github.com/commercialhaskell/stack/commit/6218dadaf5fd7bf312bb1bd0db63b4784ba78cb2
157+ #if MIN_VERSION_path(0, 7, 0)
158+ let exeBase =
159+ case splitExtension exePath of
160+ Left _ -> exePath
161+ Right (x, _) -> x
162+ #else
163+ exeBase <- exePath -<.> " "
164+ #endif
160165 let mountPath = hostBinDir FP. </> toFilePath (filename exeBase)
161166 return (mountPath, args, [] , [Mount (toFilePath exePath) mountPath])
162167
0 commit comments