# meson-test syntax error

10 messages from 2025-01-02 to 2025-01-03. Participants: Andy Koppe, Jonathan Nieder, Junio C Hamano, Andreas Schwab, Patrick Steinhardt.
Thread: https://gitlist.dev/t/62725

## Andy Koppe, 2025-01-02 12:17

Subject: meson-test syntax error
Message-ID: <CAHWeT-boK3x6mup11boEinNDQiAxxf0vwvZkxsGRc_GRvXYA8g@mail.gmail.com>
URL: https://gitlist.dev/e/CAHWeT-boK3x6mup11boEinNDQiAxxf0vwvZkxsGRc_GRvXYA8g%40mail.gmail.com

```
The new meson-test rule in t/Makefile causes a syntax error when the
default shell does not support non-standard process substitution:

  make[1]: Entering directory '/src/git/t'
  rm -f -r 'test-results'
  /bin/sh: 10: Syntax error: "(" unexpected
  make[1]: *** [Makefile:119: check-meson] Error 2

Due to this line:

  diff -u <(echo "$$meson_tests") <(echo "$$actual_tests");

This can of course be worked around with 'make test SHELL=/bin/bash',
but is that expected?

Kind regards,
Andy

```

## Jonathan Nieder, 2025-01-02 14:25

Subject: Re: meson-test syntax error
Message-ID: <Z3ah2YQSx4ZreBpK@google.com>
URL: https://gitlist.dev/e/Z3ah2YQSx4ZreBpK%40google.com
In-Reply-To: <CAHWeT-boK3x6mup11boEinNDQiAxxf0vwvZkxsGRc_GRvXYA8g@mail.gmail.com>

```
Hi,

Andy Koppe wrote:

> The new meson-test rule in t/Makefile causes a syntax error when the
> default shell does not support non-standard process substitution:
>
>   make[1]: Entering directory '/src/git/t'
>   rm -f -r 'test-results'
>   /bin/sh: 10: Syntax error: "(" unexpected
>   make[1]: *** [Makefile:119: check-meson] Error 2
>
> Due to this line:
>
>   diff -u <(echo "$$meson_tests") <(echo "$$actual_tests");
>
> This can of course be worked around with 'make test SHELL=/bin/bash',
> but is that expected?

I ran into the same today.  Let's discuss in the review thread
(https://lore.kernel.org/git/20241213-pks-meson-ci-v2-5-634affccc694@pks.im/).

Thanks,
Jonathan

```

## Junio C Hamano, 2025-01-02 14:37

Subject: Re: meson-test syntax error
Message-ID: <xmqq5xmxwabj.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq5xmxwabj.fsf%40gitster.g
In-Reply-To: <Z3ah2YQSx4ZreBpK@google.com>

```
Jonathan Nieder <jrnieder@gmail.com> writes:

> Hi,
>
> Andy Koppe wrote:
>
>> The new meson-test rule in t/Makefile causes a syntax error when the
>> default shell does not support non-standard process substitution:
>>
>>   make[1]: Entering directory '/src/git/t'
>>   rm -f -r 'test-results'
>>   /bin/sh: 10: Syntax error: "(" unexpected
>>   make[1]: *** [Makefile:119: check-meson] Error 2
>>
>> Due to this line:
>>
>>   diff -u <(echo "$$meson_tests") <(echo "$$actual_tests");
>>
>> This can of course be worked around with 'make test SHELL=/bin/bash',
>> but is that expected?
>
> I ran into the same today.  Let's discuss in the review thread
> (https://lore.kernel.org/git/20241213-pks-meson-ci-v2-5-634affccc694@pks.im/).

Probably this one?

<20241227-b4-pks-meson-docs-v2-11-f61e63edbfa1@pks.im>

```

## Jonathan Nieder, 2025-01-02 15:22

Subject: Re: meson-test syntax error
Message-ID: <Z3avRmaMr70FOs8A@google.com>
URL: https://gitlist.dev/e/Z3avRmaMr70FOs8A%40google.com
In-Reply-To: <xmqq5xmxwabj.fsf@gitster.g>

```
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> Andy Koppe wrote:

>>>   make[1]: Entering directory '/src/git/t'
>>>   rm -f -r 'test-results'
>>>   /bin/sh: 10: Syntax error: "(" unexpected
>>>   make[1]: *** [Makefile:119: check-meson] Error 2
>>>
>>> Due to this line:
>>>
>>>   diff -u <(echo "$$meson_tests") <(echo "$$actual_tests");
[...]
>> I ran into the same today.  Let's discuss in the review thread
>> (https://lore.kernel.org/git/20241213-pks-meson-ci-v2-5-634affccc694@pks.im/).
>
> Probably this one?
>
> <20241227-b4-pks-meson-docs-v2-11-f61e63edbfa1@pks.im>

Ah, yes, that's the one I mean.  Sorry for the noise.

Jonathan

```

## Junio C Hamano, 2025-01-02 15:39

Subject: Re: meson-test syntax error
Message-ID: <xmqqr05lusvp.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqr05lusvp.fsf%40gitster.g
In-Reply-To: <Z3avRmaMr70FOs8A@google.com>

```
Jonathan Nieder <jrnieder@gmail.com> writes:

> Junio C Hamano wrote:
>> Jonathan Nieder <jrnieder@gmail.com> writes:
>>> Andy Koppe wrote:
>
>>>>   make[1]: Entering directory '/src/git/t'
>>>>   rm -f -r 'test-results'
>>>>   /bin/sh: 10: Syntax error: "(" unexpected
>>>>   make[1]: *** [Makefile:119: check-meson] Error 2
>>>>
>>>> Due to this line:
>>>>
>>>>   diff -u <(echo "$$meson_tests") <(echo "$$actual_tests");
> [...]
>>> I ran into the same today.  Let's discuss in the review thread
>>> (https://lore.kernel.org/git/20241213-pks-meson-ci-v2-5-634affccc694@pks.im/).
>>
>> Probably this one?
>>
>> <20241227-b4-pks-meson-docs-v2-11-f61e63edbfa1@pks.im>
>
> Ah, yes, that's the one I mean.  Sorry for the noise.

Sorry for being extra sloppy on this one.  A patch like that with
blatant bash-ism shouldn't have slipped the review process.

One thing I had trouble with is that, with /bin/sh linked to
/bin/bash, none of these

    $ SHELL=/bin/dash make test
    $ cd t && SHELL=/bin/dash make test
    $ cd t && SHELL=/bin/dash make check-meson

seem to fail for me.

```

## Junio C Hamano, 2025-01-02 15:41

Subject: Re: meson-test syntax error
Message-ID: <xmqqmsg9ussz.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqmsg9ussz.fsf%40gitster.g
In-Reply-To: <xmqqr05lusvp.fsf@gitster.g>

```
Junio C Hamano <gitster@pobox.com> writes:

> One thing I had trouble with is that, with /bin/sh linked to
> /bin/bash, none of these
>
>     $ SHELL=/bin/dash make test
>     $ cd t && SHELL=/bin/dash make test
>     $ cd t && SHELL=/bin/dash make check-meson
>
> seem to fail for me.

Ah, I had to do this:

      $ cd t && make SHELL=/bin/dash check-meson

to make it fail.  Sorry for the noise.

```

## Junio C Hamano, 2025-01-02 16:26

Subject: Re: meson-test syntax error
Message-ID: <xmqqed1luqqq.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqed1luqqq.fsf%40gitster.g
In-Reply-To: <xmqqmsg9ussz.fsf@gitster.g>

```
Junio C Hamano <gitster@pobox.com> writes:

> Ah, I had to do this:
>
>       $ cd t && make SHELL=/bin/dash check-meson
>
> to make it fail.  Sorry for the noise.

And

	$ make SHELL=/bin/dash test

does not seem to pass SHELL=/bin/dash down when it does this part of
the Makefile

        test: all
                $(MAKE) -C t/ all

at the top level.  Oh well.

```

## Andreas Schwab, 2025-01-02 17:23

Subject: Re: meson-test syntax error
Message-ID: <87a5c9uo3n.fsf@igel.home>
URL: https://gitlist.dev/e/87a5c9uo3n.fsf%40igel.home
In-Reply-To: <xmqqed1luqqq.fsf@gitster.g>

```
On Jan 02 2025, Junio C Hamano wrote:

> And
>
> 	$ make SHELL=/bin/dash test
>
> does not seem to pass SHELL=/bin/dash down when it does this part of
> the Makefile
>
>         test: all
>                 $(MAKE) -C t/ all
>
> at the top level.  Oh well.

Command line options (which include macro definitions) are passed
implicitly to sub makes via the MAKEFLAGS env var.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

```

## Junio C Hamano, 2025-01-02 17:27

Subject: Re: meson-test syntax error
Message-ID: <xmqqa5c9unwu.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqa5c9unwu.fsf%40gitster.g
In-Reply-To: <87a5c9uo3n.fsf@igel.home>

```
Andreas Schwab <schwab@linux-m68k.org> writes:

> On Jan 02 2025, Junio C Hamano wrote:
>
>> And
>>
>> 	$ make SHELL=/bin/dash test
>>
>> does not seem to pass SHELL=/bin/dash down when it does this part of
>> the Makefile
>>
>>         test: all
>>                 $(MAKE) -C t/ all
>>
>> at the top level.  Oh well.
>
> Command line options (which include macro definitions) are passed
> implicitly to sub makes via the MAKEFLAGS env var.

Yes, that is what I thought.  My complaint was that it didn't seem
to be happening, and it did not cause the bash-ism in check-meson
target to barf.

Thanks.

```

## Patrick Steinhardt, 2025-01-03 06:40

Subject: Re: meson-test syntax error
Message-ID: <Z3eGS68PkwDtBl1V@pks.im>
URL: https://gitlist.dev/e/Z3eGS68PkwDtBl1V%40pks.im
In-Reply-To: <xmqqr05lusvp.fsf@gitster.g>

```
On Thu, Jan 02, 2025 at 07:39:54AM -0800, Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
> 
> > Junio C Hamano wrote:
> >> Jonathan Nieder <jrnieder@gmail.com> writes:
> >>> Andy Koppe wrote:
> >
> >>>>   make[1]: Entering directory '/src/git/t'
> >>>>   rm -f -r 'test-results'
> >>>>   /bin/sh: 10: Syntax error: "(" unexpected
> >>>>   make[1]: *** [Makefile:119: check-meson] Error 2
> >>>>
> >>>> Due to this line:
> >>>>
> >>>>   diff -u <(echo "$$meson_tests") <(echo "$$actual_tests");
> > [...]
> >>> I ran into the same today.  Let's discuss in the review thread
> >>> (https://lore.kernel.org/git/20241213-pks-meson-ci-v2-5-634affccc694@pks.im/).
> >>
> >> Probably this one?
> >>
> >> <20241227-b4-pks-meson-docs-v2-11-f61e63edbfa1@pks.im>
> >
> > Ah, yes, that's the one I mean.  Sorry for the noise.
> 
> Sorry for being extra sloppy on this one.  A patch like that with
> blatant bash-ism shouldn't have slipped the review process.
> 
> One thing I had trouble with is that, with /bin/sh linked to
> /bin/bash, none of these
> 
>     $ SHELL=/bin/dash make test
>     $ cd t && SHELL=/bin/dash make test
>     $ cd t && SHELL=/bin/dash make check-meson
> 
> seem to fail for me.

Sorry, as well. Thanks for the report and investigations!

Patrick

```
