haskell-platform icon indicating copy to clipboard operation
haskell-platform copied to clipboard

Installer do not add 'msys\usr\bin' directory into PATH

Open djlim7 opened this issue 8 years ago • 5 comments

By default, installer program adds some PATH environment variables, but MSYS binary folder's path is not included.

C:\Program Files\Haskell Platform\8.0.2\msys\usr\bin\

Some extensions (like ghc-mod) use MSYS to build. But because of PATH setting, installation fails. Please add the route into project.

djlim7 avatar Feb 15 '17 10:02 djlim7

The HP does not include the MSYS folder's path by default since the odds are very high it would cause user problems at some later point (see below for details). So, we leave the step of including it in the PATH up to the user . I believe the release notes (https://www.haskell.org/platform/#windows) mentions a way to do this that doesn't affect the PATH directly.

The problem with simply adding the MSYS2 folder's path is that MSYS2 contains some executables with the exact same names as ones provided by Windows (e.g., dir, find, echo).

Including the directory to these Unix-like tools on the Windows PATH will cause problems, regardless of whether appended or prepended. If put early in the PATH, the Unix-tools will mask the Windows equivalents, and if placed later in the PATH, the opposite will happen. Some have called this type of problem: "PATH pollution."

The former failure (Windows-specific executables masked) will confuse the end user, and likely at a very different time from when the PATH was modified (e.g., weeks after installing the unix-like tools, the user cannot figure out why some other tool or batch file fails on the "echo" command). The latter failure will cause the build of configure-style packages, which we are trying to address here, to fail.

randen avatar Feb 15 '17 17:02 randen

Agreed. We could update the website to include extra information that lets users know of the option, I suppose...

gbaz avatar Feb 15 '17 18:02 gbaz

I know what happens if installer automatically does, but the installer supports option to avoid all the PATHs. And installer adds PATHs of other Unix-like tools (installed with Haskell Platform), like gcc and g++. I opened this issue because MSYS was exceptional.

I think this problem can be solved by specifying installer's option.

djlim7 avatar Feb 18 '17 13:02 djlim7

Please see #279 also.

djlim7 avatar Jun 29 '17 00:06 djlim7

The gcc and g++ provided by GHC aren't msys2 (a.k.a newlib based) application. They're native ported applications so they're a lot safer to export.

Mistuke avatar Dec 25 '17 09:12 Mistuke