threads / discuss / 62725

meson-test syntax error

Subject: meson-test syntax error

## tl;dr

10 messages between Jan 2, 2025 and Jan 3, 2025.

replies: 9people: 5as markdown or json

Andy Koppe· Jan 2, 2025, 12:17 UTC · lore

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· Jan 2, 2025, 14:25 UTC · re: Andy Koppe · lore

Re: meson-test syntax error

Hi,
Andy Koppe wrote:
Show 14 quoted lines
> 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· Jan 2, 2025, 14:37 UTC · re: Jonathan Nieder · lore

Re: meson-test syntax error

Jonathan Nieder <jrnieder@gmail.com> writes:
Show 21 quoted lines
> 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· Jan 2, 2025, 15:22 UTC · re: Junio C Hamano · lore

Re: meson-test syntax error

Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> Andy Koppe wrote:
Show 8 quoted lines
>>>   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");
[...]
Show 6 quoted lines
>> 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· Jan 2, 2025, 15:39 UTC · re: Jonathan Nieder · lore

Re: meson-test syntax error

Jonathan Nieder <jrnieder@gmail.com> writes:
Show 21 quoted lines
> 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· Jan 2, 2025, 15:41 UTC · re: Junio C Hamano · lore

Re: meson-test syntax error

Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> 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· Jan 2, 2025, 16:26 UTC · re: Junio C Hamano · lore

Re: meson-test syntax error

Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
> 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· Jan 2, 2025, 17:23 UTC · re: Junio C Hamano · lore

Re: meson-test syntax error

On Jan 02 2025, Junio C Hamano wrote:
Show 11 quoted lines
> 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· Jan 2, 2025, 17:27 UTC · re: Andreas Schwab · lore

Re: meson-test syntax error

Andreas Schwab <schwab@linux-m68k.org> writes:
Show 16 quoted lines
> 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· Jan 3, 2025, 06:40 UTC · re: Junio C Hamano · lore

Re: meson-test syntax error

On Thu, Jan 02, 2025 at 07:39:54AM -0800, Junio C Hamano wrote:
Show 35 quoted lines
> 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

← back to recent threads