-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimize PATH polution #53
Comments
I wonder, is running Windows scripts inside an MSYS environment necessary? |
Ah, thanks. I wonder how well that works on Windows... I'm not sure if I've missed your point, but currently git's |
Global |
Yes |
It'd be nicer if the |
MSYS itself is not so bad. It's Git's |
I'm looking at the contents of |
You're right. I wonder if we're piggybacking on Git's MSYS now. @snoyberg? |
Yes, I dropped the custom-hacked-together msys1 that was there previously and rely on the msys2 provided by Git. In case you're wondering, the reason I went the route of using Git is:
|
I made a relevant post over at #43 (comment) |
And to get back to the issue at hand, what are the reasons for including |
Unless I'm mistaken, it's necessary for installing the network package or anything else with an autoconf script. |
Could installing packages be restricted to only after the user enters a special environment (including that |
I think people will be very frustrated by |
Then maybe an installer option? Anyways, one can avoid the most obvious conflicts ( |
I think MSYS1 (or at least our version of it) managed to avoid things like find/echo, so the only things that changed were things that weren't there before (rm, mv, cp, ls). Having it replace the Windows versions of expected utilities is a bit unfortunate. We should still be able to have a working network install and not break most .bat files. |
It could be as easy as moving Git's MSYS lower in precedence somehow, although that seems fraught with potential problems. |
Remember there is the system path and the user path that get merged to form one path. I think the user patch takes preference, and that's what we edit, so putting something after the default system things is probably impossible (but I don't guarantee it). |
True, I don't think |
But that means |
I'm not advocating this approach, but if we added to |
Writing to HCLM requires admin, which the latest movement of directory was designed to avoid. |
Roger |
|
Another terrible hacky idea: wrap cabal.bat@echo off
setlocal
call %~dp0\set-msys-env.bat
real-cabal-somewhere.exe %* |
I'm not 100% convinced that is a terrible idea... The only problem is that the user can install their own cabal.exe, and we couldn't wrap that. To do it robustly you'd need to have a different executable, e.g. something like |
Yeah, custom cabal installs is the tough part. Provided their cabal is lower precedence, we could search for it ourselves on the |
Sounds like the best idea so far is to cripple MSYS a bit and rename some of its tools... |
Actually, the user path comes last. This seems like a terrible design in general, but it does play in your favor here. |
Hmm, if that's true then why are my scripts breaking? I need to look into that. Perhaps I'm running "minghc.bat" from the script which is why it's breaking. |
Since we're using MSYS2, I went ahead and closed #20. |
So we only mask |
We now advise people use Stack instead, MinGHC is no longer supported. Stack neatly avoids PATH pollution. |
I'm not sure how far we can go with this, but git's ancillary tools overlap with Windows built-in tools. For example, the packaged git's
./usr/bin
folder hasecho
,find
,[.exe
(??),dir
, etc. These overlap with the standard Windows commands with the same name (except for[
...that's just weird). Does git actually need these on the path to work? Even if it does, we need to figure out a way to stop these from polluting the PATH. I have simple Windows scripts that don't work when MinGHC paths are set.The text was updated successfully, but these errors were encountered: