threads / discuss / 57814

Fix for failing tests on Solaris

Subject: Fix for failing tests on Solaris

## tl;dr

3 messages between Apr 29, 2022 and Apr 29, 2022.

replies: 2people: 3as markdown or json

Vladimir Marek· Apr 29, 2022, 06:23 UTC · lore
Hello,
Sorry if this is not the best way to report issues.

Solaris ships git[1]. We run it's test suite and we were having multiple failures[2]. I noticed that the tests do expect binaries to be found in [3]:

SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin

That paths contain posix conformant binaries, but the tests do expect Linux-like behaving binaries.

The patch I am about to apply to git

--- git-2.35.1/config.mak.uname +++ git-2.35.1/config.mak.uname

@@ -162,7 +162,7 @@ ifeq ($(uname_S),SunOS)
        NEEDS_SOCKET = YesPlease
        NEEDS_NSL = YesPlease
        SHELL_PATH = /bin/bash
-       SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
+       SANE_TOOL_PATH = /usr/gnu/bin
        HAVE_ALLOCA_H = YesPlease
        NO_STRCASESTR = YesPlease
        NO_MEMMEM = YesPlease

Makes all tests but t7812 pass successfully. t7812 fails on locales and
utf-8 which do behave differently in Solaris.

I would suggest to update the tests to use /usr/gnu/bin path.

[1] https://github.com/oracle/solaris-userland/tree/master/components/git
[2] https://github.com/oracle/solaris-userland/tree/master/components/git/test
[3] https://github.com/git/git/blob/master/config.mak.uname#L176

Thank you
-- 
	Vlad
Carlo Marcelo Arenas Belón· Apr 29, 2022, 16:09 UTC · re: Vladimir Marek · lore

Re: Fix for failing tests on Solaris

On Fri, Apr 29, 2022 at 08:23:37AM +0200, Vladimir Marek wrote:
> 
> That paths contain posix conformant binaries, but the tests do expect
> Linux-like behaving binaries.

Expecting Linux-like behaviour is indeed not what the tests should be doing, so correcting that might ALSO help other people that don't have an alternative GNU implementation available IMHO

So detailing those failures and fixing them might be preferable (even if likely more difficult)

Show 8 quoted lines
> --- git-2.35.1/config.mak.uname
> +++ git-2.35.1/config.mak.uname
> @@ -162,7 +162,7 @@ ifeq ($(uname_S),SunOS)
>         NEEDS_SOCKET = YesPlease
>         NEEDS_NSL = YesPlease
>         SHELL_PATH = /bin/bash
> -       SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
> +       SANE_TOOL_PATH = /usr/gnu/bin

I haven't used Solaris for a while (since around OpenSolaris Indiana development stopped), but wouldn't this break in Solaris 10 and older?

> Makes all tests but t7812 pass successfully. t7812 fails on locales and
> utf-8 which do behave differently in Solaris.

And additional fix for that (since you seem to have access to a fresh Solaris 11.4 installation at least), would be forthcomming.

Wondering also if there is a way to plug one of those from Oracle Cloud through a GitHub actions so we could prevent future issues by including Solaris in our CI runs.

Carlo
Junio C Hamano· Apr 29, 2022, 16:48 UTC · re: Carlo Marcelo Arenas Belón · lore

Re: Fix for failing tests on Solaris

Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:
Show 21 quoted lines
>> --- git-2.35.1/config.mak.uname
>> +++ git-2.35.1/config.mak.uname
>> @@ -162,7 +162,7 @@ ifeq ($(uname_S),SunOS)
>>         NEEDS_SOCKET = YesPlease
>>         NEEDS_NSL = YesPlease
>>         SHELL_PATH = /bin/bash
>> -       SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
>> +       SANE_TOOL_PATH = /usr/gnu/bin
>
> I haven't used Solaris for a while (since around OpenSolaris Indiana
> development stopped), but wouldn't this break in Solaris 10 and older?
>
>> Makes all tests but t7812 pass successfully. t7812 fails on locales and
>> utf-8 which do behave differently in Solaris.
>
> And additional fix for that (since you seem to have access to a fresh
> Solaris 11.4 installation at least), would be forthcomming.
>
> Wondering also if there is a way to plug one of those from Oracle Cloud
> through a GitHub actions so we could prevent future issues by including
> Solaris in our CI runs.

I do not think we want to take this patch until we know how exactly the tests failing for Vladimir fail without GNUism, which we do not want to rely on. If a test by mistake used "sed -i -e '<script>'" GNUism which /usr/xpg[46]/bin/sed does not support, for example, we want to know about it, so that we can move away from such a use of GNUism.

Thanks.

← back to recent threads