Re: [PATCH 02/10] cmake: do find Git for Windows' shell interpreter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sibi,

On Fri, 25 Sep 2020, Sibi Siddharthan wrote:

> > diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
> > index 5007f173f1..d14fa4f3dc 100644
> > --- a/contrib/buildsystems/CMakeLists.txt
> > +++ b/contrib/buildsystems/CMakeLists.txt
> > @@ -43,8 +43,11 @@ set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
> >
> >  find_program(SH_EXE sh)
> >  if(NOT SH_EXE)
> > -       message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one."
> > -                       "On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/";)
> > +       set(SH_EXE "C:/Program Files/Git/bin/sh.exe")
> > +       if(NOT EXISTS ${SH_EXE})
> > +               message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one."
> > +                               "On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/";)
> > +       endif()
> >  endif()
> >
> Let's not point SH_EXE to the 'program files' directory.

It is not doing that, except as a fall-back in case the `sh` program
was not found in the `PATH`.

> find_program() searches 'PATH' for sh.

Right.

> Since the Git-for-windows installer does append
> 'your_installation_directory'/Git/bin to the PATH variable, it should
> be fine.

No, it does not. Quite purposefully so.

The `/bin/` directory is kind of a hack to reinstate _some_ level of
support for use cases that relied on Git for Windows v1.x installing its
binaries into that directory (v2.x distributes them between `/usr/bin/`
and `/mingw64/bin/`).

What _does_ get appended, at least by default, is the `/cmd/` directory
(which does _not_ contain `sh.exe`).

Now, there _is_ an option in the Git for Windows installer to append all
of its Unix tools to the `PATH`, but it is highly discouraged to do so.

> 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 ;-))

Ciao,
Dscho



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux