[Git][ghc/ghc][master] 2 commits: Windows: enforce path convention in ./configure
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 5939ceaf by sheaf at 2026-09-05T22:06:18-04:00 Windows: enforce path convention in ./configure As detailed in Note [MSYS paths] in Hadrian.Utilities, the standing convention (using Windows-style paths with forward slashes) is now enforced in ./configure instead of within Hadrian, removing the need for 'cygpath' calls within Hadrian. Fixes #26683 - - - - - a6061455 by sheaf at 2026-09-05T22:06:18-04:00 Hadrian: introduce ExeSpawnPath Specific details about the filepath used to specify the executable to spawn with CreateProcess matters on Windows: whether we use forward or backward slashes, a leading ./, or an absolute path changes how the executable is found. This commit introduces 'ExeSpawnPath' which is a path that is guaranteed to be found when spawning a process. All command invocations now go through this type to ensure the path has been properly sanitised. See Note [NeedCurrentDirectoryForExePath] in Hadrian.Utilities. The same treatment is applied to hsc2hs. Updates hsc2hs submodule. - - - - - 25 changed files: - configure.ac - hadrian/src/Base.hs - hadrian/src/Builder.hs - hadrian/src/Hadrian/Builder.hs - hadrian/src/Hadrian/Builder/Ar.hs - hadrian/src/Hadrian/Oracles/Path.hs - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Oracles/Setting.hs - hadrian/src/Oracles/TestSettings.hs - hadrian/src/Rules/BinaryDist.hs - hadrian/src/Rules/Changelog.hs - hadrian/src/Rules/Codes.hs - hadrian/src/Rules/Lint.hs - hadrian/src/Rules/Nofib.hs - hadrian/src/Rules/Test.hs - m4/find_python.m4 - + m4/fp_canonicalise_win_path.m4 - m4/fp_find_nm.m4 - m4/fp_find_root.m4 - m4/fp_prog_ar.m4 - m4/fp_prog_ar_args.m4 - m4/fp_prog_sh.m4 - m4/fptools_alex.m4 - m4/fptools_happy.m4 - utils/hsc2hs Changes: ===================================== configure.ac ===================================== @@ -238,16 +238,10 @@ if test "${WithGhc}" != "" then ghc_host_os=`"${WithGhc}" +RTS --info | grep 'Host OS' | sed -e 's/.*, "//' -e 's/")//'` + dnl NB: can't use FP_CANONICALISE_WIN_PATH here, as $windows is not yet set. if test "$ghc_host_os" = "mingw32" then - if test "${OSTYPE}" = "msys" - then - WithGhc=`echo "${WithGhc}" | sed "s#^/\([a-zA-Z]\)/#\1:/#"` - else - # Canonicalise to <drive>:/path/to/ghc - WithGhc=`cygpath -m "${WithGhc}"` - fi - echo "GHC path canonicalised to: ${WithGhc}" + WithGhc=`cygpath -m "${WithGhc}"` fi fi AC_SUBST([WithGhc]) @@ -329,12 +323,11 @@ else AC_CHECK_TARGET_TOOL([DlltoolCmd],[llvm-dlltool]) AC_CHECK_TARGET_TOOL([OBJDUMP],[objdump]) - WindresCmd="$(cygpath -m $WindresCmd)" - DlltoolCmd="$(cygpath -m $DlltoolCmd)" + FP_CANONICALISE_WIN_PATH([WindresCmd]) + FP_CANONICALISE_WIN_PATH([DlltoolCmd]) - if test "$Genlib" != ""; then - GenlibCmd="$(cygpath -m $Genlib)" - fi + GenlibCmd="$Genlib" + FP_CANONICALISE_WIN_PATH([GenlibCmd]) fi fi @@ -510,12 +503,8 @@ case $HostOS_CPP in ;; esac -if test "$HostOS" = "mingw32" -then - ObjdumpCmd=$(cygpath -m "$OBJDUMP") -else - ObjdumpCmd="$OBJDUMP" -fi +ObjdumpCmd="$OBJDUMP" +FP_CANONICALISE_WIN_PATH([ObjdumpCmd]) AC_SUBST([ObjdumpCmd]) dnl ** Which ranlib to use? @@ -524,12 +513,8 @@ AC_PROG_RANLIB if test "$RANLIB" = ":"; then AC_MSG_ERROR([cannot find ranlib in your PATH]) fi -if test "$HostOS" = "mingw32" -then - RanlibCmd=$(cygpath -m "$RANLIB") -else - RanlibCmd="$RANLIB" -fi +RanlibCmd="$RANLIB" +FP_CANONICALISE_WIN_PATH([RanlibCmd]) AC_SUBST([RanlibCmd]) LINKER_SUPPORTS_VERBATIM_LINKING @@ -791,13 +776,16 @@ AC_PROG_LN_S dnl ** Find the path to sed AC_PATH_PROGS(SedCmd,gsed sed,sed) +FP_CANONICALISE_WIN_PATH([SedCmd]) dnl ** check for tar dnl if GNU tar is named gtar, look for it first. AC_PATH_PROGS(TarCmd,gnutar gtar tar,tar) +FP_CANONICALISE_WIN_PATH([TarCmd]) dnl ** check for autoreconf AC_PATH_PROG(AutoreconfCmd, autoreconf, autoreconf) +FP_CANONICALISE_WIN_PATH([AutoreconfCmd]) dnl ** check for dtrace (currently only implemented for Mac OS X) AC_ARG_ENABLE(dtrace, @@ -822,17 +810,11 @@ fi AC_SUBST(HaveDtrace) AC_PATH_PROG(HSCOLOUR,HsColour) -# HsColour is passed to Cabal, so we need a native path -if test "$HostOS" = "mingw32" && \ - test "${OSTYPE}" != "msys" && \ - test "${HSCOLOUR}" != "" -then - # Canonicalise to <drive>:/path/to/gcc - HSCOLOUR=`cygpath -m ${HSCOLOUR}` -fi +FP_CANONICALISE_WIN_PATH([HSCOLOUR]) dnl ** check for Sphinx toolchain AC_PATH_PROG(SPHINXBUILD,sphinx-build) +FP_CANONICALISE_WIN_PATH([SPHINXBUILD]) AC_CACHE_CHECK([for version of sphinx-build], fp_cv_sphinx_version, changequote(, )dnl [if test -n "$SPHINXBUILD"; then @@ -851,14 +833,19 @@ fi dnl ** check for xelatex AC_PATH_PROG(XELATEX,xelatex) +FP_CANONICALISE_WIN_PATH([XELATEX]) AC_PATH_PROG(MAKEINDEX,makeindex) +FP_CANONICALISE_WIN_PATH([MAKEINDEX]) AC_PATH_PROG(GIT,git) +FP_CANONICALISE_WIN_PATH([GIT]) dnl ** check for makeinfo AC_PATH_PROG(MAKEINFO,makeinfo) +FP_CANONICALISE_WIN_PATH([MAKEINFO]) dnl ** check for cabal AC_PATH_PROG(CABAL,cabal) +FP_CANONICALISE_WIN_PATH([CABAL]) dnl ** check for Python for testsuite driver ===================================== hadrian/src/Base.hs ===================================== @@ -51,9 +51,9 @@ import Data.List.Extra import Data.Maybe import Data.Semigroup #if MIN_VERSION_shake(0,19,0) -import Development.Shake hiding (unit, (&%>), Normal) +import Development.Shake hiding (unit, (&%>), Normal, cmd, cmd_) #else -import Development.Shake hiding (unit, (&%>), (*>), Normal) +import Development.Shake hiding (unit, (&%>), (*>), Normal, cmd, cmd_) #endif import qualified Development.Shake as Shake import Development.Shake.Classes ===================================== hadrian/src/Builder.hs ===================================== @@ -254,38 +254,43 @@ instance H.Builder Builder where msgIn = "[askBuilder] Exactly one input file expected." needBuilders [builder] path <- H.builderPath builder + prog <- exeSpawnPath path -- we do not depend on bare builders. E.g. we won't depend on `clang` -- or `ld` or `ar`. Unless they are provided with fully qualified paths -- this is the job of the person invoking ./configure to pass e.g. -- CC=$(which clang) if they want the fully qualified clang path! when (path /= takeFileName path) $ need [path] - Stdout stdout <- cmd' [path] ["--no-user-package-db", "field", input, "depends"] + Stdout stdout <- cmd' prog ["--no-user-package-db", "field", input, "depends"] return stdout Testsuite GetExtraDeps -> do path <- builderPath builder + prog <- exeSpawnPath path withResources buildResources $ withTempFile $ \temp -> do - () <- cmd' [path] (buildArgs ++ ["--only-report-hadrian-deps", temp]) + () <- cmd' prog (buildArgs ++ ["--only-report-hadrian-deps", temp]) readFile' temp Git ListFiles -> do path <- builderPath builder + prog <- exeSpawnPath path withResources buildResources $ do -- NUL separated list of files -- We need to read this in the filesystem encoding enc <- liftIO getFileSystemEncoding - Stdout stdout <- cmd' BinaryPipes [path] buildArgs + Stdout stdout <- cmd' prog BinaryPipes buildArgs liftIO $ BS.useAsCStringLen stdout $ \fp -> GHC.peekCStringLen enc fp Win32Tarballs ListTarballs -> do path <- builderPath builder + prog <- exeSpawnPath path withResources buildResources $ do - Stdout stdout <- cmd' [path] buildArgs + Stdout stdout <- cmd' prog buildArgs pure stdout _ -> error $ "Builder " ++ show builder ++ " can not be asked!" runBuilderWith :: Builder -> BuildInfo -> Action () runBuilderWith builder BuildInfo {..} = do path <- builderPath builder + prog <- exeSpawnPath path withResources buildResources $ do verbosity <- getVerbosity let input = fromSingleton msgIn buildInputs @@ -294,52 +299,54 @@ instance H.Builder Builder where msgOut = "[runBuilderWith] Exactly one output file expected." -- Capture stdout and write it to the output file. captureStdout = do - Stdout stdout <- cmd' [path] buildArgs buildOptions + Stdout stdout <- cmd' prog buildArgs buildOptions -- see Note [Capture stdout as a ByteString] writeFileChangedBS output stdout case builder of Ar Pack stg -> do useTempFile <- arSupportsAtFile stg - if useTempFile then runAr output path buildArgs buildInputs buildOptions - else runArWithoutTempFile path buildArgs buildInputs buildOptions + if useTempFile then runAr output prog buildArgs buildInputs buildOptions + else runArWithoutTempFile prog buildArgs buildInputs buildOptions - Ar Unpack _ -> cmd' [Cwd output] [path] buildArgs buildOptions + Ar Unpack _ -> cmd' prog [Cwd output] buildArgs buildOptions Autoreconf dir -> do - bash <- bashPath - cmd' [Cwd dir] [bash, path] buildArgs buildOptions + sh <- shPath + shProg <- exeSpawnPath sh + cmd' shProg [Cwd dir] [path] buildArgs buildOptions Configure dir -> do - -- Inject /bin/bash into `libtool`, instead of /bin/sh, + -- Also inject the shell into `libtool` via CONFIG_SHELL, -- otherwise Windows breaks. TODO: Figure out why. - bash <- bashPath - let env = AddEnv "CONFIG_SHELL" bash - cmd' env [Cwd dir] ["sh", path] buildOptions buildArgs + sh <- shPath + shProg <- exeSpawnPath sh + let env = AddEnv "CONFIG_SHELL" sh + cmd' shProg env [Cwd dir] [path] buildOptions buildArgs GenApply {} -> captureStdout GenPrimopCode -> do need [input] - Stdout stdout <- cmd' (FileStdin input) [path] buildArgs buildOptions + Stdout stdout <- cmd' prog (FileStdin input) buildArgs buildOptions -- see Note [Capture stdout as a ByteString] writeFileChangedBS output stdout GhcPkg Copy _ -> do - Stdout pkgDesc <- cmd' [path] + Stdout pkgDesc <- cmd' prog [ "--expand-pkgroot" , "--no-user-package-db" , "describe" , input -- the package name ] - cmd' (Stdin pkgDesc) [path] (buildArgs ++ ["-"]) buildOptions + cmd' prog (Stdin pkgDesc) (buildArgs ++ ["-"]) buildOptions GhcPkg Unregister _ -> do -- unregistering is allowed to fail (e.g. when a package -- isn't already present) - Exit _ <- cmd' [path] (buildArgs ++ [input]) buildOptions + Exit _ <- cmd' prog (buildArgs ++ [input]) buildOptions return () - Haddock BuildPackage -> runHaddock output path buildArgs buildInputs + Haddock BuildPackage -> runHaddock output prog buildArgs buildInputs Ghc _ _ -> -- Use a response file for ghc invocations to avoid issues with command line @@ -349,52 +356,54 @@ instance H.Builder Builder where -- yet due to #26560. withResponseFileIfLongCmd output - (toCmdArgument [path] <> toCmdArgument buildArgs) + prog + (toCmdArgument buildArgs) buildInputs (toCmdArgument buildOptions) HsCpp {} -> captureStdout - Make dir -> cmd' buildOptions path ["-C", dir] buildArgs + Make dir -> cmd' prog buildOptions ["-C", dir] buildArgs Makeinfo -> do - cmd' [path] "--no-split" [ "-o", output] [input] buildOptions + cmd' prog "--no-split" [ "-o", output] [input] buildOptions Xelatex -> -- xelatex produces an incredible amount of output, almost -- all of which is useless. Suppress it unless user -- requests a loud build. if verbosity >= Diagnostic - then cmd' [Cwd output] [path] buildArgs buildOptions - else do (Stdouterr out, Exit code) <- cmd' [Cwd output] [path] buildArgs buildOptions + then cmd' prog [Cwd output] buildArgs buildOptions + else do (Stdouterr out, Exit code) <- cmd' prog [Cwd output] buildArgs buildOptions when (code /= ExitSuccess) $ do liftIO $ BSL.hPutStrLn stderr out putFailure "xelatex failed!" fail "xelatex failed" - Makeindex -> unit $ cmd' [Cwd output] [path] (buildArgs ++ [input]) buildOptions + Makeindex -> unit $ cmd' prog [Cwd output] (buildArgs ++ [input]) buildOptions - Tar _ -> cmd' buildOptions [path] buildArgs + Tar _ -> cmd' prog buildOptions buildArgs -- RunTest produces a very large amount of (colorised) output; -- Don't attempt to capture it. Testsuite RunTest -> do - Exit code <- cmd [path] buildArgs buildOptions + Exit code <- cmd' prog buildArgs buildOptions when (code /= ExitSuccess) $ do fail "tests failed" - _ -> cmd' [path] buildArgs buildOptions + _ -> cmd' prog buildArgs buildOptions -- | Invoke @haddock@ given a path to it and a list of arguments. On Windows, -- the input file arguments are passed as a response file. runHaddock :: FilePath -- ^ base name to use for response file - -> FilePath -- ^ path to @haddock@ + -> ExeSpawnPath -- ^ path to @haddock@ -> [String] -> [FilePath] -- ^ input file paths -> Action () runHaddock outputFilePath haddockPath flagArgs fileInputs = withResponseFileIfLongCmd outputFilePath - (toCmdArgument [haddockPath] <> toCmdArgument flagArgs) + haddockPath + (toCmdArgument flagArgs) fileInputs (CmdArgument []) @@ -469,6 +478,12 @@ systemBuilderPath builder = case builder of ++ quote keyname ++ " is not specified" ++ inCfg return "" -- TODO: Use a safe interface. else do + when (windowsHost && isMsysPath path) . error $ + unlines + [ "The path to builder " ++ quote keyname ++ inCfg + , "is an MSYS path: " ++ quote path ++ "." + , "Please re-run ./configure to fix this issue." + ] -- angerman: I find this lookupInPath rather questionable. -- if we specify CC, LD, ... *without* a path, that is intentional -- lookupInPath should be done by the person invoking the configure @@ -478,8 +493,8 @@ systemBuilderPath builder = case builder of fullPath <- lookupInPath path case (windowsHost, hasExtension fullPath) of (False, _ ) -> return path - (True , True ) -> fixAbsolutePathOnWindows fullPath - (True , False) -> fixAbsolutePathOnWindows fullPath <&> (<.> exe) + (True , True ) -> return $ unifyPath fullPath + (True , False) -> return $ unifyPath fullPath <.> exe -- Without this function, on Windows we can observe a bad builder path -- for 'autoreconf'. If the relevant system.config field is set to @@ -545,8 +560,8 @@ isSpecified = fmap (not . null) . systemBuilderPath -- | Wrapper for Shake's 'cmd' -- -- See Note [cmd wrapper] -cmd' :: (Partial, CmdWrap args) => args :-> Action r -cmd' = cmdArgs mempty +cmd' :: (Partial, CmdWrap args) => ExeSpawnPath -> args :-> Action r +cmd' = cmdArgs . toCmdArgument -- See Note [cmd wrapper] ===================================== hadrian/src/Hadrian/Builder.hs ===================================== @@ -61,10 +61,10 @@ class ShakeValue b => Builder b where runBuilderWith builder buildInfo = do let args = buildArgs buildInfo needBuilders [builder] - path <- builderPath builder + prog <- exeSpawnPath =<< builderPath builder let msg = if null args then "" else " (" ++ intercalate ", " args ++ ")" putBuild $ "| Run " ++ show builder ++ msg - quietly $ cmd (buildOptions buildInfo) [path] args + quietly $ cmdExe prog (buildOptions buildInfo) args needBuilders :: Builder b => [b] -> Action () needBuilders bs = do ===================================== hadrian/src/Hadrian/Builder/Ar.hs ===================================== @@ -36,7 +36,7 @@ instance NFData ArMode -- via a response file is not supported by some versions of @ar@, in which -- case you should use 'runArWithoutTempFile' instead. runAr :: FilePath -- ^ base name to use for response files - -> FilePath -- ^ path to @ar@ + -> ExeSpawnPath -- ^ path to @ar@ -> [String] -- ^ other arguments -> [FilePath] -- ^ input file paths -> [CmdOption] -- ^ Additional options @@ -44,17 +44,17 @@ runAr :: FilePath -- ^ base name to use for response files runAr outputFilePath arPath flagArgs fileArgs buildOptions = do rspFile <- responseFilePath outputFilePath writeFileAtomic rspFile $ unwords fileArgs - cmd [arPath] flagArgs ('@' : rspFile) buildOptions + cmdExe arPath flagArgs ('@' : rspFile) buildOptions -- | Invoke @ar@ given a path to it and a list of arguments. Note that @ar@ -- will be called multiple times if the list of files to be archived is too -- long and doesn't fit into the command line length limit. This function is -- typically much slower than 'runAr'. -runArWithoutTempFile :: FilePath -- ^ path to @ar@ +runArWithoutTempFile :: ExeSpawnPath -- ^ path to @ar@ -> [String] -- ^ other arguments -> [FilePath] -- ^ input file paths -> [CmdOption] -- ^ Additional options -> Action () runArWithoutTempFile arPath flagArgs fileArgs buildOptions = forM_ (chunksOfSize cmdLineLengthLimit fileArgs) $ \argsChunk -> - unit (cmd [arPath] (flagArgs ++ argsChunk) buildOptions) + unit (cmdExe arPath (flagArgs ++ argsChunk) buildOptions) ===================================== hadrian/src/Hadrian/Oracles/Path.hs ===================================== @@ -1,17 +1,13 @@ {-# LANGUAGE TypeFamilies #-} module Hadrian.Oracles.Path ( - lookupInPath, fixAbsolutePathOnWindows, fixUnixPathsOnWindows, - pathOracle + lookupInPath, pathOracle ) where import Control.Monad -import Data.Char -import Data.List.Extra import Development.Shake import Development.Shake.Classes import Development.Shake.FilePath import System.Directory -import System.Info.Extra import Hadrian.Utilities @@ -21,54 +17,13 @@ lookupInPath name | name == takeFileName name = askOracle $ LookupInPath name | otherwise = return name --- | Fix an absolute path on Windows: --- * "/c/" => "C:/" --- * "/usr/bin/tar.exe" => "C:/msys/usr/bin/tar.exe" -fixAbsolutePathOnWindows :: FilePath -> Action FilePath -fixAbsolutePathOnWindows path = - if isWindows - then do - let (dir, file) = splitFileName path - winDir <- askOracle $ WindowsPath dir - return $ winDir -/- file - else - return path - --- | Fix a unix path list on Windows: --- * "C:\\foo\\bar;C:\\msys2\\bin" => "/c/foo/bar:/c/msys2/bin" -fixUnixPathsOnWindows :: FilePath -> Action FilePath -fixUnixPathsOnWindows paths = - if isWindows - then askOracle $ UnixPathList paths - else return paths - newtype LookupInPath = LookupInPath String deriving (Binary, Eq, Hashable, NFData, Show) type instance RuleResult LookupInPath = String -newtype WindowsPath = WindowsPath FilePath - deriving (Binary, Eq, Hashable, NFData, Show) -type instance RuleResult WindowsPath = String - -newtype UnixPathList = UnixPathList FilePath - deriving (Binary, Eq, Hashable, NFData, Show) -type instance RuleResult UnixPathList = String - -- | Oracles for looking up paths. These are slow and require caching. pathOracle :: Rules () pathOracle = do - void $ addOracleCache $ \(WindowsPath path) -> do - Stdout out <- quietly $ cmd ["cygpath", "-m", path] - let windowsPath = unifyPath $ dropWhileEnd isSpace out - putVerbose $ "| Windows path mapping: " ++ path ++ " => " ++ windowsPath - return windowsPath - - void $ addOracleCache $ \(UnixPathList paths) -> do - Stdout out <- quietly $ cmd ["cygpath", "-p", "-u", paths] - let unixPaths = unifyPath $ dropWhileEnd isSpace out - putVerbose $ "| Unix path mapping: " ++ paths ++ " => " ++ unixPaths - return unixPaths - void $ addOracleCache $ \(LookupInPath name) -> do path <- liftIO getSearchPath exes <- liftIO (findExecutablesInDirectories path name) ===================================== hadrian/src/Hadrian/Utilities.hs ===================================== @@ -10,6 +10,8 @@ module Hadrian.Utilities ( -- * FilePath manipulation unifyPath, (-/-), makeRelativeNoSysLink, makeAbsolute, + isMsysPath, windowsToMsysPathList, + ExeSpawnPath, exeSpawnPath, cmdExe, -- * Accessing Shake's type-indexed map insertExtra, lookupExtra, userSetting, @@ -52,7 +54,9 @@ import Data.Typeable (TypeRep, typeOf) import Development.Shake hiding (Normal) import qualified Development.Shake as Shake import Development.Shake.Classes -import Development.Shake.Command (CmdArgument (..), IsCmdArgument (toCmdArgument)) +import Control.Exception.Extra (Partial) +import Development.Shake.Command + (CmdArgument (..), CmdArguments (cmdArguments), IsCmdArgument (toCmdArgument)) import Development.Shake.FilePath import GHC.ResponseFile (escapeArgs) import System.Environment (lookupEnv) @@ -144,17 +148,51 @@ zeroOne True = "1" unifyPath :: FilePath -> FilePath unifyPath = toStandard . normaliseEx -{- Note [Absolute paths and MSYS] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When dealing with absolute paths in Hadrian, we opt to always use Unix-style -forward slashes for separating paths. -This is because, on Windows, the MSYS toolchain can reliably handle paths such -as /c/foo, while it occasionally falls over on paths of the form C:\foo. +{- Note [MSYS paths] +~~~~~~~~~~~~~~~~~~~~ +On Windows, GHC is built using an MSYS toolchain, which understands two +different types of paths: + - Windows C:\foo\bar (forward slashes also accepted) + - POSIX /c/foo/bar /usr/baz/quux + +On the other hand, like any other Haskell program that depends on 'filepath', +when compiled on Windows, Hadrian by default only understands Windows file paths. + +Separately, backslashes are a source of tricky bugs, as they require escaping +in most circumstances. + +So, on Windows, we settle on using Windows-style paths with forward slashes. +Hadrian manipulates existing paths using '(-/-)' and 'makeAbsolute', which +maintain this convention. What's left to handle are the paths Hadrian receives, +such as the paths of toolchain programs. Those are converted to the standing +path convention using FP_CANONICALISE_WIN_PATH, which uses 'cygpath'. + +The end result is that Hadrian itself never needs to turn a POSIX path into a +Windows path, and hence never needs to call 'cygpath'. -} +-- | Is this an MSYS path, e.g. @\/usr\/bin\/tar@ or @\/c\/foo@, rather than a +-- Windows one? +-- +-- See Note [MSYS paths]. +isMsysPath :: FilePath -> Bool +isMsysPath ('/' : _) = True +isMsysPath _ = False + +-- | Rewrite a Windows path list, e.g. @C:\\foo;C:\\msys64\\usr\\share@, into +-- the MSYS syntax @\/c\/foo:\/c\/msys64\/usr\/share@ that MSYS tools expect. +-- +-- See Note [MSYS paths]. +windowsToMsysPathList :: String -> String +windowsToMsysPathList = intercalate ":" . map toMsysPath . splitOn ";" + where + toMsysPath path = case replaceEq '\\' '/' path of + drive : ':' : rest | isAlpha drive -> '/' : toLower drive : rest + msysPath -> msysPath + -- | Combine paths with a forward slash regardless of platform. -- --- See Note [Absolute paths and MSYS]. +-- See Note [MSYS paths]. (-/-) :: FilePath -> FilePath -> FilePath _ -/- b | isAbsolute b @@ -170,13 +208,83 @@ infixr 6 -/- -- | Like 'System.Directory.makeAbsolute' from @directory@, but always -- using forward slashes. -- --- See Note [Absolute paths and MSYS]. +-- See Note [MSYS paths]. makeAbsolute :: FilePath -> IO FilePath makeAbsolute fp = do cwd <- IO.getCurrentDirectory let fp' = cwd -/- fp return $ Posix.normalise fp' +{- Note [NeedCurrentDirectoryForExePath] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The Windows API specifies some rather convoluted rules for whether the current +directory is included in the search when looking for an executable (e.g. for +CreateProcess). The documentation states: + + https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv... + + NeedCurrentDirectoryForExePathA function + Determines whether the current directory should be included in the search path + for the specified executable. + + If CreateProcess is called with a relative executable name, it will + automatically search for the executable, calling this function to determine + the search path. + + The value of the NoDefaultCurrentDirectoryInExePath environment variable + determines the value this function returns. + If the value of the ExeName parameter contains a backslash (\), this function + will always return TRUE. If it does not contain a backslash, the existence of + the NoDefaultCurrentDirectoryInExePath environment variable is checked, and + not its value. + +In practice, this means that when we create a process with the executable being +specified using a relative path, whether the lookup succeeds depends on +minutiae of the path. Assuming that NoDefaultCurrentDirectoryInExePath is set, +the behaviour is as follows: + + bin\target.exe -- SUCCEEDS: contains backslash + bin/target.exe -- FAILS + ./bin/target.exe -- SUCCEEDS: ./ specifically means "in CWD" + +To avoid process spawning behaviour depending on the value of the +NoDefaultCurrentDirectoryInExePath environment variable, we have a few choices +for how to specify executable paths when creating a process: + + 1. Always use absolute paths. + 2. Always use backslashes. + 3. Add "./" to the front of relative paths. + +We choose to implement (1), see 'exeSpawnPath'. It's the most robust option, as +it pins down the exact executable path (no search needed); (2) would go against +Note [MSYS paths]. +-} + +-- | An executable path suitable for 'createProcess'. +-- +-- See Note [NeedCurrentDirectoryForExePath]. +newtype ExeSpawnPath = ExeSpawnPath FilePath + +instance IsCmdArgument ExeSpawnPath where + toCmdArgument (ExeSpawnPath path) = toCmdArgument [path] + +-- | Resolve the path of a program into an 'ExeSpawnPath' suitable for a +-- 'createProcess' invocation. +-- +-- See Note [NeedCurrentDirectoryForExePath]. +exeSpawnPath :: FilePath -> Action ExeSpawnPath +exeSpawnPath path + -- Don't touch a bare program name (e.g. "clang"), as that resolves from PATH. + | path == takeFileName path = return $ ExeSpawnPath path + | otherwise = ExeSpawnPath <$> liftIO (makeAbsolute path) + +-- | Like Shake's 'cmd', except that the program to run must be given as an +-- 'ExeSpawnPath'. Prefer this over 'cmd', which would accept any 'String'. +-- +-- See Note [NeedCurrentDirectoryForExePath]. +cmdExe :: (Partial, CmdArguments args) => ExeSpawnPath -> args +cmdExe = cmdArguments . toCmdArgument + -- | This is like Posix makeRelative, but assumes no sys links in the input -- paths. This allows the result to start with possibly many "../"s. Input -- paths must both be relative, or be on the same drive @@ -329,23 +437,25 @@ isGeneratedSource file = buildRoot <&> (`isPrefixOf` file) -- response file arguments are placed into a response file and escaped with @GHC.ResponseFile.escapeArgs@. withResponseFileIfLongCmd :: CmdResult c - => FilePath -- ^ Response base name. The reponse file is placed in @_build/rsp/\<Response base name\>@. - -> CmdArgument -- ^ Command and arguments before the response file arguments. - -> [String] -- ^ Response file aruguments. - -> CmdArgument -- ^ Command arguments after the response file arguments. + => FilePath -- ^ Response base name. The reponse file is placed in @_build/rsp/\<Response base name\>@. + -> ExeSpawnPath -- ^ The program to run. + -> CmdArgument -- ^ Command arguments before the response file arguments. + -> [String] -- ^ Response file aruguments. + -> CmdArgument -- ^ Command arguments after the response file arguments. -> Action c -withResponseFileIfLongCmd outputFilePath argsPre argsResp argsPost = do +withResponseFileIfLongCmd outputFilePath prog argsPre argsResp argsPost = do let cmdLineLengh = sum [ 1 + length arg -- add one to account for space inbetween arguments - | let CmdArgument args = argsPre <> toCmdArgument argsResp <> argsPost + | let CmdArgument args = + toCmdArgument prog <> argsPre <> toCmdArgument argsResp <> argsPost , Right arg <- args ] if cmdLineLengh < cmdLineLengthLimit - then cmd argsPre argsResp argsPost + then cmdExe prog argsPre argsResp argsPost else do rspFile <- responseFilePath outputFilePath writeFileAtomic rspFile (escapeArgs argsResp) - cmd argsPre ['@' : rspFile] argsPost + cmdExe prog argsPre ['@' : rspFile] argsPost -- | Convert a command's output file path to a response file path to be used for that command. -- Response files are placed in a dedicated @rps@ directory under the build directory. This avoids @@ -431,14 +541,16 @@ fixFile file f = do makeExecutable :: FilePath -> Action () makeExecutable file = do putProgressInfo $ "| Make " ++ quote file ++ " executable." - quietly $ cmd "chmod +x " [file] + chmodProg <- exeSpawnPath "chmod" + quietly $ cmdExe chmodProg ["+x", file] -- | Move a file. Note that we cannot track the source, because it is moved. moveFile :: FilePath -> FilePath -> Action () moveFile source target = do putProgressInfo =<< renderAction "Move file" source target - quietly $ cmd ["mv", source, target] + mvProg <- exeSpawnPath "mv" + quietly $ cmdExe mvProg [source, target] -- | Remove a file that doesn't necessarily exist. removeFile :: FilePath -> Action () @@ -456,13 +568,15 @@ createDirectory dir = do copyDirectory :: FilePath -> FilePath -> Action () copyDirectory source target = do putProgressInfo =<< renderAction "Copy directory" source target - quietly $ cmd ["cp", "-r", source, target] + cpProg <- exeSpawnPath "cp" + quietly $ cmdExe cpProg ["-r", source, target] -- | Move a directory. The contents of the source directory is untracked. moveDirectory :: FilePath -> FilePath -> Action () moveDirectory source target = do putProgressInfo =<< renderAction "Move directory" source target - quietly $ cmd ["mv", source, target] + mvProg <- exeSpawnPath "mv" + quietly $ cmdExe mvProg [source, target] -- | Remove a directory that doesn't necessarily exist. removeDirectory :: FilePath -> Action () ===================================== hadrian/src/Oracles/Setting.hs ===================================== @@ -6,7 +6,7 @@ module Oracles.Setting ( -- * Helpers ghcCanonVersion, cmdLineLengthLimit, targetSupportsRPaths, topDirectory, - libsuf, ghcVersionStage, bashPath, targetStage, crossStage, queryTarget, queryTargetTarget, + libsuf, ghcVersionStage, shPath, targetStage, crossStage, queryTarget, queryTargetTarget, isHostStage, -- ** Target platform things @@ -20,7 +20,6 @@ import System.Directory import System.Info.Extra import Hadrian.Expression import Hadrian.Oracles.TextFile -import Hadrian.Oracles.Path import Control.Monad.Trans (lift) import Control.Monad.Trans.Maybe (runMaybeT) @@ -133,9 +132,9 @@ buildSetting key stage = tgtConfig stage $ case key of getSetting :: ProjectSetting -> Expr c b String getSetting = expr . setting --- | The path to a Bourne shell interpreter. -bashPath :: Action FilePath -bashPath = setting BourneShell +-- | The path to a Bourne shell interpreter (@sh@). +shPath :: Action FilePath +shPath = setting BourneShell isWinHost :: Action Bool isWinHost = anyHostOs [OSMinGW32] @@ -203,11 +202,12 @@ ghcCanonVersion = do -- | Absolute path to the GHC source tree. topDirectory :: Action FilePath topDirectory = do - x <- fixAbsolutePathOnWindows =<< setting GhcSourcePath - canonicalize x - where - -- We must canonicalize as the source directory may be accessed via a symlink. See #22451. - canonicalize = if isWindows then return else liftIO . canonicalizePath + ghcSourcePath <- setting GhcSourcePath + if isWindows + -- On Windows: enforce the path convention of Note [MSYS paths]. + then return $ unifyPath ghcSourcePath + -- Otherwise: canonicalise to handle symlinks; see #22451. + else liftIO $ canonicalizePath ghcSourcePath ghcVersionStage :: Stage -> Action String ghcVersionStage (Stage0 {}) = setting GhcVersion ===================================== hadrian/src/Oracles/TestSettings.hs ===================================== @@ -13,7 +13,6 @@ import Hadrian.Oracles.TextFile import Oracles.Setting (topDirectory, setting, ProjectSetting(..), crossStage) import Packages import Settings.Program (programContext) -import Hadrian.Oracles.Path testConfigFile :: Action FilePath testConfigFile = buildRoot <&> (-/- "test/ghcconfig") @@ -156,8 +155,5 @@ getTestExePath testGhc pkg = do cross <- getBooleanSetting TestCrossCompiling let cross_prefix = if cross then dropWhileEnd ((/=) '-') (takeFileName compiler_path) else "" -- get relative path for the given program in the given stage - let make_absolute rel_path = do - abs_path <- liftIO (makeAbsolute rel_path) - fixAbsolutePathOnWindows abs_path - make_absolute (bindir </> (cross_prefix ++ programBasename pkg) <.> exe) + liftIO $ makeAbsolute (bindir </> (cross_prefix ++ programBasename pkg) <.> exe) -- get relative path for the given program in the given stage ===================================== hadrian/src/Rules/BinaryDist.hs ===================================== @@ -6,7 +6,6 @@ import Context import Data.Either import qualified Data.Set as Set import Expression -import Hadrian.Oracles.Path (fixUnixPathsOnWindows) import Oracles.Flavour import Oracles.Setting import Packages @@ -248,7 +247,9 @@ buildBinDistDir root conf@BindistConfig{..} = do -- Not going to work for cross ghcPkgName <- programName (vanillaContext Stage1 ghcPkg) - cmd_ (bindistFilesDir -/- "bin" -/- ghcPkgName) ["recache", "--package-db", bindistFilesDir -/- "lib" -/- "package.conf.d" ] + ghcPkgProg <- exeSpawnPath (bindistFilesDir -/- "bin" -/- ghcPkgName) + cmdExe ghcPkgProg ["recache", "--package-db", bindistFilesDir -/- "lib" -/- "package.conf.d" ] + :: Action () need ["docs"] @@ -364,8 +365,8 @@ bindistRules = do let ghcVersionPretty = "ghc-" ++ version ++ "-" ++ targetPlatform -- Finally, we create the archive <root>/bindist/ghc-X.Y.Z-platform.tar.xz - tarPath <- builderPath (Tar Create) - cmd [Cwd $ root -/- bindist_folder] tarPath + tarProg <- exeSpawnPath =<< builderPath (Tar Create) + cmdExe tarProg [Cwd $ root -/- bindist_folder] [ "-c", compressorTarFlag compressor, "-f" , ghcVersionPretty <.> "tar" <.> compressorExtension compressor , ghcVersionPretty ] @@ -393,16 +394,11 @@ bindistRules = do -- style paths. This happens because MSYS2 automatically converts env variables to -- Windows-style paths. To fix this, we convert ACLOCAL_PATH back to Unix style. -- This is done both in the boot Python script and here when building a bindist. + -- See Note [MSYS paths]. win_host <- isWinHost - env <- if not win_host - then pure [] - else do - aclocalPathMay <- getEnv "ACLOCAL_PATH" - case aclocalPathMay of - Nothing -> pure [] - Just aclocalPath -> do - unixAclocalPath <- fixUnixPathsOnWindows aclocalPath - pure [AddEnv "ACLOCAL_PATH" unixAclocalPath] + aclocalPathMay <- if win_host then getEnv "ACLOCAL_PATH" else pure Nothing + let env = [ AddEnv "ACLOCAL_PATH" (windowsToMsysPathList aclocalPath) + | Just aclocalPath <- [aclocalPathMay] ] buildWithCmdOptions env $ target (vanillaContext Stage1 ghc) (Autoreconf $ ghcRoot -/- "distrib") [] [] @@ -568,7 +564,8 @@ createVersionWrapper executable_stage pkg versioned_exe install_path = do | pkg == ghciWrapper = (1 :: Int) | otherwise = 0 - cmd ghcPath (["-no-hs-main", "-o", install_path, "-I"++version_wrapper_dir + ghcProg <- exeSpawnPath ghcPath + cmdExe ghcProg (["-no-hs-main", "-o", install_path, "-I"++version_wrapper_dir , "-optc-DEXE_PATH=\"" ++ versioned_exe ++ "\"" , "-optc-DINTERACTIVE_PROCESS=" ++ show interactive ] ++ wrapper_files) ===================================== hadrian/src/Rules/Changelog.hs ===================================== @@ -42,8 +42,9 @@ changelogRules = do top <- topDirectory let outFile = top -/- "docs" -/- "users_guide" -/- version ++ "-notes.rst" - quietly $ cmd (FileStdout outFile) - [progPath] [top -/- "changelog.d/", "--version", version] + prog <- exeSpawnPath progPath + quietly $ cmdExe prog (FileStdout outFile) + [top -/- "changelog.d/", "--version", version] :: Action () putSuccess $ "| Generated release notes: " ++ outFile ===================================== hadrian/src/Rules/Codes.hs ===================================== @@ -34,4 +34,5 @@ codes usage = do cmdLine = unwords ( codesProgram : args ) putBuild $ "| Computing " ++ describeUsage usage ++ " diagnostic codes." putBuild $ "| " <> cmdLine - cmd_ cmdLine + codesProg <- exeSpawnPath codesProgram + cmdExe codesProg args ===================================== hadrian/src/Rules/Lint.hs ===================================== @@ -19,11 +19,17 @@ lintRules = do "libraries" -/- "base" -/- "include" -/- "HsBaseConfig.h" %> \_ -> -- ./configure is called here manually because we need to generate -- HsBaseConfig.h, which is created from HsBaseConfig.h.in. ./configure - cmd_ (Cwd "libraries/base") "./configure" + runConfigure "libraries/base" "rts" -/- "include" -/- "ghcautoconf.h" %> \_ -> - cmd_ (Cwd "rts") "./configure" + runConfigure "rts" "rts" -/- "include" -/- "ghcplatform.h" %> \_ -> - cmd_ (Cwd "rts") "./configure" + runConfigure "rts" + +-- | Run a package's @configure@ script, from that package's directory. +runConfigure :: FilePath -> Action () +runConfigure dir = do + configureProg <- exeSpawnPath (dir -/- "configure") + cmdExe configureProg [Cwd dir] lint :: Action () -> Action () lint lintAction = do @@ -46,9 +52,8 @@ runHLint includeDirs defines dir = do hostArch <- (<> "_HOST_ARCH") <$> queryHostTarget queryArch let hlintYaml = dir </> ".hlint.yaml" defines' = hostArch : defines - cmdLine = unwords $ - [ "hlint" - , "--colour=never" + hlintArgs = + [ "--colour=never" , "-j" <> show threads ] ++ map ("--cpp-define=" <>) defines' ++ @@ -56,8 +61,10 @@ runHLint includeDirs defines dir = do [ "-h" <> hlintYaml , dir ] + cmdLine = unwords ("hlint" : hlintArgs) putBuild $ "| " <> cmdLine - cmd_ cmdLine + hlintProg <- exeSpawnPath "hlint" + cmdExe hlintProg hlintArgs base :: Action () base = do ===================================== hadrian/src/Rules/Nofib.hs ===================================== @@ -39,9 +39,10 @@ nofibRules = do -- the GHC to benchmark and perl to -- nofib's makefiles. let nofibArgs = ["WithNofibHc=" ++ (top -/- ghcPath)] - unit $ cmd (Cwd "nofib") [makePath] ["clean"] - unit $ cmd (Cwd "nofib") [makePath] (nofibArgs ++ ["boot"]) - (Exit e, Stdouterr log) <- cmd (Cwd "nofib") [makePath] nofibArgs + makeProg <- exeSpawnPath makePath + unit $ cmdExe makeProg (Cwd "nofib") ["clean"] + unit $ cmdExe makeProg (Cwd "nofib") (nofibArgs ++ ["boot"]) + (Exit e, Stdouterr log) <- cmdExe makeProg (Cwd "nofib") nofibArgs writeFileAtomic fp log if e == ExitSuccess then putVerbose $ "nofib log available at " ++ fp ===================================== hadrian/src/Rules/Test.hs ===================================== @@ -20,7 +20,6 @@ import qualified System.Directory as IO import GHC.Toolchain as Toolchain import GHC.Toolchain.Program as Toolchain -import Hadrian.Oracles.Path checkPprProgPath, checkPprSourcePath :: FilePath checkPprProgPath = "test/bin/check-ppr" <.> exe @@ -160,7 +159,8 @@ testRules = do bindir <- getBinaryDirectory testGhc test_args <- outOfTreeCompilerArgs let dynPrograms = hasDynamic test_args - cmd [bindir </> "ghc" <.> exe] $ + ghcProg <- exeSpawnPath (bindir </> "ghc" <.> exe) + cmdExe ghcProg $ concatMap (\p -> ["-package", pkgName p]) depsPkgs ++ ["-o", top -/- path, top -/- sourcePath] ++ mextra ++ @@ -177,7 +177,8 @@ testRules = do ghcConfigProgPath <- programPath =<< programContext stage0InTree ghcConfig cwd <- liftIO $ IO.getCurrentDirectory need [makeRelative cwd ghcPath, ghcConfigProgPath] - cmd [FileStdout $ root -/- ghcConfigPath] ghcConfigProgPath [ghcPath] + ghcConfigProg <- exeSpawnPath ghcConfigProgPath + cmdExe ghcConfigProg [FileStdout $ root -/- ghcConfigPath] [ghcPath] root -/- timeoutPath %> \_ -> timeoutProgBuilder @@ -292,11 +293,7 @@ relativePathStage s p = programPath =<< programContext s p absolutePathStage :: Stage -> Package -> Action FilePath absolutePathStage s p = - relativePathStage s p >>= make_absolute - where - make_absolute rel_path = do - abs_path <- liftIO (makeAbsolute rel_path) - fixAbsolutePathOnWindows abs_path + liftIO . makeAbsolute =<< relativePathStage s p -- | Given a test compiler and a hadrian dependency (target), check if we -- can build the target with the compiler ===================================== m4/find_python.m4 ===================================== @@ -37,12 +37,7 @@ AC_DEFUN([FIND_PYTHON],[ AC_MSG_WARN([Python 3.7 or later is required, but $PYTHON reports $PythonVersion]) ]) - dnl Canonicalise path for Windows - if test "$HostOS" = "mingw32" - then - PythonCmd=$(cygpath -m "$PYTHON") - else - PythonCmd="$PYTHON" - fi + PythonCmd="$PYTHON" + FP_CANONICALISE_WIN_PATH([PythonCmd]) AC_SUBST([PythonCmd]) ]) ===================================== m4/fp_canonicalise_win_path.m4 ===================================== @@ -0,0 +1,11 @@ +# FP_CANONICALISE_WIN_PATH(VARIABLE) +# ---------------------------------- +# On Windows, rewrite the value of the path VARIABLE to the mixed form: +# C:/foo/bar +# +# See Note [MSYS paths] in hadrian/src/Hadrian/Utilities.hs. +# +# Requires FPTOOLS_SET_PLATFORMS_VARS to have been run, for $windows. +AC_DEFUN([FP_CANONICALISE_WIN_PATH], +[AS_IF([test "$windows" = "YES" && test -n "$$1"], + [$1=`cygpath -m "$$1"`])])# FP_CANONICALISE_WIN_PATH ===================================== m4/fp_find_nm.m4 ===================================== @@ -9,12 +9,11 @@ AC_DEFUN([FP_FIND_NM], AC_MSG_ERROR([cannot find nm in your PATH]) fi fi + NmCmd="$NM" + FP_CANONICALISE_WIN_PATH([NmCmd]) if test "$HostOS" = "mingw32" then - NmCmd=$(cygpath -m "$NM") NM_STAGE0=$NmCmd - else - NmCmd="$NM" fi AC_SUBST([NmCmd]) if test "$HostOS" != "mingw32"; then ===================================== m4/fp_find_root.m4 ===================================== @@ -4,15 +4,8 @@ AC_DEFUN([FP_FIND_ROOT],[ AC_MSG_CHECKING(for path to top of build tree) - if test "$windows" = YES - then - dnl Make sure this is a c:/foo/bar (mixed) style path. Some parts of - dnl the build system might depend on it (such as the sed expression - dnl `"s|$(TOP)/||i"` in addCFileDeps in rules/build-dependencies.mk). - hardtop=$(cygpath -m "$(pwd)") - else - hardtop=$(pwd) - fi + hardtop=$(pwd) + FP_CANONICALISE_WIN_PATH([hardtop]) dnl Remove common automounter nonsense hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|'` ===================================== m4/fp_prog_ar.m4 ===================================== @@ -10,9 +10,7 @@ if test -z "$fp_prog_ar"; then if test "$HostOS" = "mingw32" then AC_PATH_PROG([fp_prog_ar], [ar]) - if test -n "$fp_prog_ar"; then - fp_prog_ar=$(cygpath -m $fp_prog_ar) - fi + FP_CANONICALISE_WIN_PATH([fp_prog_ar]) else AC_CHECK_TARGET_TOOL([AR], [ar]) fp_prog_ar="$AR" ===================================== m4/fp_prog_ar_args.m4 ===================================== @@ -30,12 +30,8 @@ else fi fi]) fp_prog_ar_args=$fp_cv_prog_ar_args -if test "$HostOS" = "mingw32" -then - ArCmd=$(cygpath -m "$fp_prog_ar") -else - ArCmd="$fp_prog_ar" -fi +ArCmd="$fp_prog_ar" +FP_CANONICALISE_WIN_PATH([ArCmd]) AC_SUBST([ArCmd]) AC_SUBST([ArArgs], ["$fp_prog_ar_args"]) ===================================== m4/fp_prog_sh.m4 ===================================== @@ -6,10 +6,6 @@ AC_DEFUN([FP_PROG_SH], AC_REQUIRE([FPTOOLS_SET_PLATFORMS_VARS]) dnl for $windows AC_ARG_VAR(SH,[Use as the full path to a Bourne shell. [default=autodetect]]) AC_PATH_PROGS([SH], [sh bash]) - if test "$windows" = "YES"; then - dnl use mixed (-m) mode to get C:/mingw64/... with forward slashes. - dnl windows (-w) mode will give us C:\... and mess with escaping. - SH=`cygpath -m "$SH"` - fi + FP_CANONICALISE_WIN_PATH([SH]) AC_SUBST([SH])[]dnl ])# FP_PROG_SH ===================================== m4/fptools_alex.m4 ===================================== @@ -10,7 +10,9 @@ dnl https://gitlab.haskell.org/ghc/ghc/wikis/building/preparation/tools dnl AC_DEFUN([FPTOOLS_ALEX], [AC_PATH_PROG(ALEX,[alex],) -AC_SUBST(AlexCmd,$ALEX) +AlexCmd="$ALEX" +FP_CANONICALISE_WIN_PATH([AlexCmd]) +AC_SUBST(AlexCmd) AC_CACHE_CHECK([for version of alex], fptools_cv_alex_version, changequote(, )dnl [if test x"$AlexCmd" != x; then ===================================== m4/fptools_happy.m4 ===================================== @@ -10,7 +10,9 @@ dnl https://gitlab.haskell.org/ghc/ghc/wikis/building/preparation/tools dnl AC_DEFUN([FPTOOLS_HAPPY], [AC_PATH_PROG(HAPPY,[happy],) -AC_SUBST(HappyCmd,$HAPPY) +HappyCmd="$HAPPY" +FP_CANONICALISE_WIN_PATH([HappyCmd]) +AC_SUBST(HappyCmd) AC_CACHE_CHECK([for version of happy], fptools_cv_happy_version, changequote(, )dnl [if test x"$HappyCmd" != x; then ===================================== utils/hsc2hs ===================================== @@ -1 +1 @@ -Subproject commit 3b3f18fff306cb95b71acc7c866461f552e0aeaf +Subproject commit 0ac065c152e8fbae6c05e9db424baee66b98797e View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c673ecf057deee858acbbaa7e6c9207... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c673ecf057deee858acbbaa7e6c9207... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Marge Bot (@marge-bot)