Re: [PATCH 02/10] cmake: do find Git for Windows' shell interpreter
From: Johannes Schindelin <hidden>
Date: 2020-09-29 19:40:04
Hi Danh, On Tue, 29 Sep 2020, Đoàn Trần Công Danh wrote:
On 2020-09-28 15:56:13+0200, Johannes Schindelin [off-list ref] wrote:quoted
On Sun, 27 Sep 2020, Đoàn Trần Công Danh wrote:quoted
On 2020-09-26 22:32:25+0200, Johannes Schindelin [off-list ref] wrote:quoted
quoted
I personally don't install my dev tools(except Visual Studio) to Program Files(because of the _space_), it messes up the Makefiles.Sure, and that's your prerogative. There's unfortunately no good way to support your use case. Luckily, the vast majority of Git for Windows' users do not change the default location, and this patch is for them. (And "them" in this case includes me, personally ;-))This doesn't fit into my view of Git for Windows' users For some users that have the Administrator right, it's the default location if they grant the Administrator right for the installer. For those poor souls that works for enterprise companies, and thoses that not feel comfortable give Administrator right to _another_ installer, the installer will install into (hopeful, I type it right): %USERPROFILE%/AppData/Local/Programs/GitThose poor souls that work for enterprise companies often have Git for Windows installed by default. And of course, that default would be in `C:\Program Files\Git`.Yes, that's correct, but that Git is usually very old, and I'm not sure about its layout. Obviously, you know better in this regard :-p
In Git for Windows v1.x, it would have contained the real Bash (at least in 32-bit Windows; in 64-bit Windows, it would have been `C:\Program Files (x86)\Git\bin`). But v1.x is long deprecated, it's over 5 years old. The `C:\Program Files\Git\bin\sh.exe` stand-in is actually not _all_ that old, I only reintroduced it relatively recently. Nevertheless, it is the best bet for a default fall-back that I can think of.
quoted
quoted
I think it's better to offer SH_EXE as an OPTION, let user specify it as will. And we'll search in PATH if it's not specified, fallback to 2 default value if not found.That's exactly as it is right now. You can specify `SH_EXE` (but only if running CMake manually, not via Visual Studio). If you don't, it searches `PATH`, and with my patch it then falls back to trying to find `sh.exe` in Git for Windows' default location. So I think we're in agreement here?Yes, seems good.
Excellent! Dscho