* Portability of git shell scripts?
@ 2016-05-04 18:17 Armin Kunaschik
2016-05-04 18:35 ` Torsten Bögershausen
2016-05-04 21:20 ` Jeff King
0 siblings, 2 replies; 5+ messages in thread
From: Armin Kunaschik @ 2016-05-04 18:17 UTC (permalink / raw)
To: git
Hi list,
I'm trying to compile/test/use git 2.8.2 on AIX 6.1 with no bash available.
/bin/sh is a hard link to /bin/ksh which is a ksh88, a posix shell.
Is this supposed to work?
As an example: make test fails on nearly every t34* test and on tests
which contain rebase.
The installation of bash (and manually changing the shebang to
/bin/bash) "fixes" all rebase test failures. So obviously git-rebase
is not portable at some point.
Does it make any sense to put work into making these scripts portable,
that is, work with posix shells?
And, as last resort, is it possible to configure git use bash in some
or all shell scripts?
Regards,
Armin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Portability of git shell scripts?
2016-05-04 18:17 Portability of git shell scripts? Armin Kunaschik
@ 2016-05-04 18:35 ` Torsten Bögershausen
2016-05-04 21:20 ` Jeff King
1 sibling, 0 replies; 5+ messages in thread
From: Torsten Bögershausen @ 2016-05-04 18:35 UTC (permalink / raw)
To: Armin Kunaschik, git
On 04.05.16 20:17, Armin Kunaschik wrote:
> Hi list,
>
> I'm trying to compile/test/use git 2.8.2 on AIX 6.1 with no bash available.
> /bin/sh is a hard link to /bin/ksh which is a ksh88, a posix shell.
> Is this supposed to work?
>
> As an example: make test fails on nearly every t34* test and on tests
> which contain rebase.
> The installation of bash (and manually changing the shebang to
> /bin/bash) "fixes" all rebase test failures. So obviously git-rebase
> is not portable at some point.
>
> Does it make any sense to put work into making these scripts portable,
> that is, work with posix shells?
> And, as last resort, is it possible to configure git use bash in some
> or all shell scripts?
>
> Regards,
> Armin
The Makefile has a knob to use a specifc shell:
# Define SHELL_PATH to a POSIX shell if your /bin/sh is broken.
Does this help ?
Otherwise:
I don't know how much posix ksh88 is, it may help, if you can post some output ?
I use sometimes
debug=t verbose=t ./t34XXXX.sh 2>&1 ≤ tee xx.txt
but there may be better debugging utilities these days.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Portability of git shell scripts?
2016-05-04 18:17 Portability of git shell scripts? Armin Kunaschik
2016-05-04 18:35 ` Torsten Bögershausen
@ 2016-05-04 21:20 ` Jeff King
2016-05-06 16:57 ` Armin Kunaschik
1 sibling, 1 reply; 5+ messages in thread
From: Jeff King @ 2016-05-04 21:20 UTC (permalink / raw)
To: Armin Kunaschik; +Cc: git
On Wed, May 04, 2016 at 08:17:38PM +0200, Armin Kunaschik wrote:
> I'm trying to compile/test/use git 2.8.2 on AIX 6.1 with no bash available.
> /bin/sh is a hard link to /bin/ksh which is a ksh88, a posix shell.
> Is this supposed to work?
We aim for a practical subset of Bourne shells, including bash, dash,
ash, ksh, etc. There's at least one Bourne-ish shell known not to work,
which is Solaris /bin/sh[1]. POSIX is usually a good guide, but we aim
for practical portability more than adhering strictly to the standards
document.
I've tested with mksh in the past (though it's possible that we've
introduced a regression since then). But I think we've run into problems
with ksh93[2]. I don't know about ksh88, or what construct it doesn't
like. It may or may not be easy to work around.
> As an example: make test fails on nearly every t34* test and on tests
> which contain rebase.
> The installation of bash (and manually changing the shebang to
> /bin/bash) "fixes" all rebase test failures. So obviously git-rebase
> is not portable at some point.
Right. Any modern-ish Bourne shell will do, so moving to bash is one way
to fix it.
> Does it make any sense to put work into making these scripts portable,
> that is, work with posix shells?
Maybe. :) If you can find what it is that ksh88 is unhappy with, we can
see how painful it is to adapt to. But given my looking into ksh93 in
[2], I suspect it will be easier to just use a more modern shell.
> And, as last resort, is it possible to configure git use bash in some
> or all shell scripts?
You can set SHELL_PATH in your config.mak file.
-Peff
[1] Solaris /bin/sh doesn't even understand $(), so we declared it as
hopeless long ago. I think most people just replace it with bash,
but I suspect /usr/xpg6/bin/sh probably works, too.
[2] http://thread.gmane.org/gmane.comp.version-control.git/268657/focus=268666
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Portability of git shell scripts?
2016-05-04 21:20 ` Jeff King
@ 2016-05-06 16:57 ` Armin Kunaschik
2016-05-07 2:53 ` Jeff King
0 siblings, 1 reply; 5+ messages in thread
From: Armin Kunaschik @ 2016-05-06 16:57 UTC (permalink / raw)
To: Jeff King; +Cc: git
On Wed, May 4, 2016 at 11:20 PM, Jeff King <peff@peff.net> wrote:
> On Wed, May 04, 2016 at 08:17:38PM +0200, Armin Kunaschik wrote:
>
>> I'm trying to compile/test/use git 2.8.2 on AIX 6.1 with no bash available.
>> /bin/sh is a hard link to /bin/ksh which is a ksh88, a posix shell.
>> Is this supposed to work?
>
> We aim for a practical subset of Bourne shells, including bash, dash,
> ash, ksh, etc. There's at least one Bourne-ish shell known not to work,
> which is Solaris /bin/sh[1]. POSIX is usually a good guide, but we aim
> for practical portability more than adhering strictly to the standards
> document.
>
> I've tested with mksh in the past (though it's possible that we've
> introduced a regression since then). But I think we've run into problems
> with ksh93[2]. I don't know about ksh88, or what construct it doesn't
> like. It may or may not be easy to work around.
In general ksh (88 or 93) is posix compliant... and bash is moving away
from posix. :-) But I know what you mean.
>> As an example: make test fails on nearly every t34* test and on tests
>> which contain rebase.
>> The installation of bash (and manually changing the shebang to
>> /bin/bash) "fixes" all rebase test failures. So obviously git-rebase
>> is not portable at some point.
>
> Right. Any modern-ish Bourne shell will do, so moving to bash is one way
> to fix it.
My last compile of git 2.2.2 did far better than the current 2.8.2. So
it looks like
there were more recent changes that broke portability.
>> Does it make any sense to put work into making these scripts portable,
>> that is, work with posix shells?
>
> Maybe. :) If you can find what it is that ksh88 is unhappy with, we can
> see how painful it is to adapt to. But given my looking into ksh93 in
> [2], I suspect it will be easier to just use a more modern shell.
Regarding [2] this was a bug which was fixed quite fast. To me this is no
real showstopper. Modernity of ksh93 depends on the letter after the 93 :-)
>> And, as last resort, is it possible to configure git use bash in some
>> or all shell scripts?
>
> You can set SHELL_PATH in your config.mak file.
I tried a build with SHELL_PATH=/bin/bash. Many problems "went away".
Others appeared. I'll give it a few more days to look into it.
First finding:
make test does not make it through t3513-revert-submodule.sh anymore.
The test is not portable since it uses the z-flags of GNU-tar. When -z
is removed,
(and extension is changed back to tar) everything runs and tests smoothly.
Is this report enough to start the magic to change things?
Regards,
Armin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Portability of git shell scripts?
2016-05-06 16:57 ` Armin Kunaschik
@ 2016-05-07 2:53 ` Jeff King
0 siblings, 0 replies; 5+ messages in thread
From: Jeff King @ 2016-05-07 2:53 UTC (permalink / raw)
To: Armin Kunaschik; +Cc: git
On Fri, May 06, 2016 at 06:57:45PM +0200, Armin Kunaschik wrote:
> > Right. Any modern-ish Bourne shell will do, so moving to bash is one
> > way to fix it.
>
> My last compile of git 2.2.2 did far better than the current 2.8.2. So
> it looks like there were more recent changes that broke portability.
If you have a working version and a non-working version, the results of
"git bisect" would be very helpful to find the change (or the output of
the test run with "-v -i" to show what's going on in the failing test).
-Peff
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-05-07 3:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04 18:17 Portability of git shell scripts? Armin Kunaschik
2016-05-04 18:35 ` Torsten Bögershausen
2016-05-04 21:20 ` Jeff King
2016-05-06 16:57 ` Armin Kunaschik
2016-05-07 2:53 ` Jeff King
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).