git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 7/8] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Jun 8, 2009, 13:39 UTC
Message-ID
<nwND53LJ3yJOus0fY2Tjm-DbTAR8lJKtmBZRYJ4EcvNx7qWStwbs9w@cipher.nrlssc.navy.mil>
In-Reply-To
<20090608114351.GA13775@coredump.intra.peff.net>
Jeff King wrote:
Show 30 quoted lines
> On Fri, Jun 05, 2009 at 06:36:15PM -0500, Brandon Casey wrote:
> 
>> From: Junio C Hamano <gitster@pobox.com>
>>
>> Some platforms (like SunOS and family) have kept their common binaries at
>> some historical moment in time, and introduced new binaries with modern
>> features in a special location like /usr/xpg4/bin or /usr/ucb.  Some of the
>> features provided by these modern binaries are expected and required by git.
>> If the featureful binaries are not in the users path, then git could end up
>> using the less featureful binary and fail.
>>
>> So provide a mechanism to prepend elements to the users PATH at runtime so
>> the modern binaries will be found.
> 
> So this bit me already, and it's only been in next for a day. :) I
> _already_ have /usr/xpg4/bin in my PATH before /usr/bin, but with this
> patch, I get it stuck at the _beginning_ of my PATH automagically. Which
> overrides, against my wishes, the "even more sane than /usr/xpg4/bin"
> part of my PATH that comes at the beginning.
> 
> Specifically, I have "~peff/local/bin" at the beginning of my PATH which
> contains a 'vi' that points to vim. Running "git rebase -i" now puts
> /usr/xpg4/bin at the beginning of the PATH (before ~peff/local/bin),
> which means I end up running the crappy system vi instead. For bonus
> fun, "git commit" still runs the correct 'vi' because it doesn't happen
> to be implemented as a shell script.
> 
> Am I crazy for not having EDITOR=vim instead of EDITOR=vi? Perhaps. But
> I wanted to point out that tweaking the PATH behind the user's back does
> cause surprises in the real world.

Good points. I'm fine with dropping this patch, especially when it causes problems for a real Solaris user, which I'm not.

I don't like that git has a dependency on the user's PATH being set correctly though. That's why I liked the patch. I guess I could modify all the uses of sed and friends to look like $SED and then set SED to /usr/xpg4/bin/sed on Solaris. It doesn't sound like that is necessary in practice though.

btw, this patch does help the test suite when the test suite is run using make. The patch added SANE_TOOL_PATH to PATH in the Makefile.

-brandon
Previous: Jeff KingNext: Jeff King
Message 11 of 30 in “enhancing builds on Solaris”
  1. 0/8 enhancing builds on SolarisBrandon Casey, Jun 5, 2009
  2. 1/8 Makefile: use /usr/ucb/install on SunOS platforms rather than ginstallBrandon Casey, Jun 5, 2009
  3. 2/8 Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile argumentsBrandon Casey, Jun 5, 2009
  4. 3/8 diff-delta.c: "diff.h" is not a required includeBrandon Casey, Jun 5, 2009
  5. 4/8 On Solaris choose the OLD_ICONV iconv() declaration based on the UNIX specBrandon Casey, Jun 5, 2009
  6. 5/8 git-compat-util.h: tweak the way _XOPEN_SOURCE is set on SolarisBrandon Casey, Jun 5, 2009
  7. 6/8 Makefile: define __sun__ on SunOSBrandon Casey, Jun 5, 2009
  8. 7/8 Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATHBrandon Casey, Jun 5, 2009
  9. 8/8 Makefile: add section for SunOS 5.7Brandon Casey, Jun 5, 2009
  10. Jeff KingJun 8, 2009
  11. Brandon CaseyJun 8, 2009
  12. Jeff KingJun 8, 2009
  13. Brandon CaseyJun 8, 2009
  14. Junio C HamanoJun 8, 2009
  15. Jeff KingJun 8, 2009
  16. Brandon CaseyJun 8, 2009
  17. Brandon CaseyJun 9, 2009
  18. 3/8 diff-delta.c: "delta.h" is not a required includeBrandon Casey, Jun 6, 2009
  19. Nicolas PitreJun 6, 2009
  20. Brandon CaseyJun 6, 2009
  21. Nicolas PitreJun 6, 2009
  22. Brandon CaseyJun 6, 2009
  23. git-compat-util.h: avoid using c99 flex array feature with Sun compiler 5.8Brandon Casey, Jun 8, 2009
  24. Jakub NarebskiJun 6, 2009
  25. Brandon CaseyJun 7, 2009
  26. configure: test whether -lresolv is neededRalf Wildenhues, Jun 7, 2009
  27. Brandon CaseyJun 5, 2009
  28. Junio C HamanoJun 6, 2009
  29. Brandon CaseyJun 6, 2009
  30. Jeff KingJun 8, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.