Hacks for AIX

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Hacks for AIX

From: Chris Cowan <hidden>
Date: 2016-06-15 22:44:57

I saw some earlier postings about this, so I thought I would share my
solution (I'm using xlc, BTW).   The following tests were broken for
me (using a pull from 2 days ago).

    * t0002-gitfile.sh
    * t1002-read-tree-m-u-2way.sh
    * t2201-add-update-typechange.sh
    * t4109-apply-multifrag.sh
    * t4110-apply-scan.sh
    * t7002-grep.sh


The problems all seem to be rooted in the default utilities shipped with AIX:

    * /usr/bin/grep - behaves badly in t7002.   I believe it is test
12 and related to the -n -w -e combination of options.
    * /usr/bin/diff - has problems with -u and -U.
                         I saw the $GIT_CMP_TEST env var, but this is
not used everywhere within the test scripts above.
    * /usr/bin/patch - really old version, doesn't do well with some
diff formats.   I avoid using it.
    * /usr/bin/install - doesn't behave the expected way either.

In some cases, the tests could have been made more portable by using a
plain "diff" rather than "diff -u", for example.

Fortunately, there are optional freeware versions that can be
installed for all of these (along with tar and wish too).   These
versions if installed, are all found in /usr/linux/bin (or
equivalently /opt/freeware/bin), I just wish they weren't optional.  I
have found that having these utilities installed and prepending
/usr/linux/bin to the PATH results in a clean make test and build.

I also saw one instance where the behavior of git-grep was affected by
the grep selected at build time.    I'm not sure if there's other
instances within the code base, but I'm wondering whether the
configure script can be changed to do the check for /usr/linux/bin and
use those versions?   I can imagine that similar problems may occur on
Solaris and HPUX.

Otherwise, I'm quite happy with git.
-- 
CC

Re: Hacks for AIX

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:44:57


On Wed, 16 Jul 2008, Chris Cowan wrote:
I also saw one instance where the behavior of git-grep was affected by
the grep selected at build time.    I'm not sure if there's other
instances within the code base, but I'm wondering whether the
configure script can be changed to do the check for /usr/linux/bin and
use those versions?   I can imagine that similar problems may occur on
Solaris and HPUX.
The grep selection at compile time is purely a choice between "no external 
grep at all" and "whatever external grep is in $PATH".

exec_grep() literally does

	..
	pid = fork();
	if (pid < 0)
		return pid;
	if (!pid) {
		execvp("grep", (char **) argv);
		exit(255);
	}
	..

so you can choose your version of external grep at run-time by just 
setting PATH appropriately.

Or you can just decide that you don't want to use any external grep binary 
at all, which is the compile-time choice of NO_EXTERNAL_GREP. In that 
case, git will do the grep implementation all internally. It can do so, 
but then it relies on the regex() library which is often less optimized 
than the external grep.

Note the "often". It's possible that the external grep is never worth it, 
in which case you should use NO_EXTERNAL_GREP. GNU grep happens to be very 
good.

Even with an external grep configured in, you'll end up using the internal 
one for the case where you ask for the index information ("--cached") or 
when you ask for a particular version of the tree rather than the 
checked-out tree. So regardless, you'll fall back to the internal version 
for some things.

			Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help